feat: add deployments env-vars, function-deploy.logs, and cleanup skills install#44
feat: add deployments env-vars, function-deploy.logs, and cleanup skills install#44
Conversation
WalkthroughBumps package version and updates CLI behavior: removes namespace flags from agent-skills install, adds a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/skills.ts`:
- Around line 41-47: The fallback manual command in the catch block doesn't
match the actual install command run by execAsync, which can mislead users;
update the clack.log.warn message (the fallback string) to match the exact
command invoked by execAsync (including the npx skills add insforge/agent-skills
base command, the -y flag and every -a <skill> argument used in the execAsync
call) so that on failure users can copy/paste the same command; ensure you edit
the code near execAsync and the catch's clack.log.warn (and keep the json/
clack.log.success behavior unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1279af0f-ff21-47ba-ba3d-57b08e1069c8
📒 Files selected for processing (2)
package.jsonsrc/lib/skills.ts
- Add `deployments env list/set/delete` for managing deployment env vars - Add `function-deploy.logs` source to logs and diagnose logs commands (maps to /api/logs/functions/build-logs endpoint)
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/commands/diagnose/logs.ts (1)
9-44: Code duplication withsrc/commands/logs.ts.The
SOURCE_PATHmapping andgetLogPath()helper are duplicated verbatim between this file andsrc/commands/logs.ts. Consider extracting these to a shared utility insrc/lib/api/(nearossFetch) to reduce maintenance burden and avoid divergence.♻️ Suggested refactor
Create a shared module, e.g.,
src/lib/api/logs.ts:export const LOG_SOURCES = ['insforge.logs', 'postgREST.logs', 'postgres.logs', 'function.logs', 'function-deploy.logs'] as const; const SOURCE_PATH: Record<string, string> = { 'function-deploy.logs': '/api/logs/functions/build-logs', }; export function getLogPath(source: string, limit: number): string { const custom = SOURCE_PATH[source]; if (custom) return `${custom}?limit=${limit}`; return `/api/logs/${encodeURIComponent(source)}?limit=${limit}`; }Then import and use in both command files.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/diagnose/logs.ts` around lines 9 - 44, Duplicate constants and helper (LOG_SOURCES, SOURCE_PATH, getLogPath) should be extracted into a single shared module and exported so both command files import them; create a new module that exports LOG_SOURCES and getLogPath (keeping SOURCE_PATH private inside that module), move the logic from the current getLogPath and SOURCE_PATH into it, preserve the parse/get behavior and types, then update src/commands/diagnose/logs.ts to import LOG_SOURCES and getLogPath (and similarly update the other command file that duplicates them) so there is a single source of truth for these symbols.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/deployments/env-vars.ts`:
- Line 4: The import statement currently brings in an unused symbol CLIError
alongside handleError, getRootOpts, and ProjectNotLinkedError; remove CLIError
from the import list so only the used symbols (handleError, getRootOpts,
ProjectNotLinkedError) are imported, ensuring the import declaration for
'../../lib/errors.js' no longer includes CLIError.
---
Nitpick comments:
In `@src/commands/diagnose/logs.ts`:
- Around line 9-44: Duplicate constants and helper (LOG_SOURCES, SOURCE_PATH,
getLogPath) should be extracted into a single shared module and exported so both
command files import them; create a new module that exports LOG_SOURCES and
getLogPath (keeping SOURCE_PATH private inside that module), move the logic from
the current getLogPath and SOURCE_PATH into it, preserve the parse/get behavior
and types, then update src/commands/diagnose/logs.ts to import LOG_SOURCES and
getLogPath (and similarly update the other command file that duplicates them) so
there is a single source of truth for these symbols.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 84c363f5-6e78-4dc2-938f-3bac441932e5
📒 Files selected for processing (4)
src/commands/deployments/env-vars.tssrc/commands/diagnose/logs.tssrc/commands/logs.tssrc/index.ts
Summary
-s(skill selection) flag fromnpx skills add insforge/agent-skillscommand, letting the package install all skills by defaultTest plan
insforge linkinstalls agent skills without-sflag🤖 Generated with Claude Code
Note
Remove
-sflags frominstallSkillsagent skills install commandThe
installSkillsfunction in skills.ts no longer passes-s insforge -s insforge-cliscope flags when runningnpx skills add insforge/agent-skills. The warning message shown to users is updated to reflect the new command. This PR also adds adeployments envsubcommand (list/set/delete) and extends log source support to includefunction-deploy.logswith a custom API endpoint.Macroscope summarized c1af1fe.
Summary by CodeRabbit
Chores
New Features
Bug Fixes