Skip to content

feat: add deployments env-vars, function-deploy.logs, and cleanup skills install#44

Merged
jwfing merged 2 commits intomainfrom
chore/link-skills
Apr 1, 2026
Merged

feat: add deployments env-vars, function-deploy.logs, and cleanup skills install#44
jwfing merged 2 commits intomainfrom
chore/link-skills

Conversation

@jwfing
Copy link
Copy Markdown
Member

@jwfing jwfing commented Mar 31, 2026

Summary

  • Remove -s (skill selection) flag from npx skills add insforge/agent-skills command, letting the package install all skills by default
  • add deployments env-vars, function-deploy.logs
  • Update fallback error message to match the simplified command
  • Bump version to 0.1.37

Test plan

  • insforge link installs agent skills without -s flag
  • Failed install shows correct manual command in warning message

🤖 Generated with Claude Code

Note

Remove -s flags from installSkills agent skills install command

The installSkills function in skills.ts no longer passes -s insforge -s insforge-cli scope flags when running npx skills add insforge/agent-skills. The warning message shown to users is updated to reflect the new command. This PR also adds a deployments env subcommand (list/set/delete) and extends log source support to include function-deploy.logs with a custom API endpoint.

Macroscope summarized c1af1fe.

Summary by CodeRabbit

  • Chores

    • Bumped package version to 0.1.37
  • New Features

    • Added CLI subcommands to manage deployment environment variables (list, set, delete).
    • Added support for a new logs source so function deployment build logs can be retrieved.
  • Bug Fixes

    • Simplified skill installation command and corresponding failure message to reduce complexity.

@jwfing jwfing requested a review from tonychang04 March 31, 2026 23:35
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Walkthrough

Bumps package version and updates CLI behavior: removes namespace flags from agent-skills install, adds a new deployments env command (list/set/delete), and introduces function-deploy.logs as a supported log source with a custom log path; registers the new deployments subcommand in the CLI entrypoint.

Changes

Cohort / File(s) Summary
Package Version
package.json
Version bumped from 0.1.360.1.37.
Skills Installation
src/lib/skills.ts
installSkills now runs npx skills add insforge/agent-skills without -s insforge -s insforge-cli; corresponding failure message trimmed.
Deployments Env CLI
src/commands/deployments/env-vars.ts, src/index.ts
Added deployments env subcommands: list, set <key> <value>, delete <id>; handlers call backend endpoints via ossFetch; registered via registerDeploymentsEnvVarsCommand(deploymentsCmd) in src/index.ts.
Logs: new source + path logic
src/commands/logs.ts, src/commands/diagnose/logs.ts
Added function-deploy.logs to valid sources and LOG_SOURCES; introduced SOURCE_PATH / getLogPath(source, limit) to route that source to a custom /api/logs/functions/build-logs?limit= endpoint; fetch logic updated to use helper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • tonychang04

Poem

"🐇 I hopped through code with nimble paws,
Bumped a version, trimmed some claws,
New env commands — list, set, delete,
Logs found a path with tidy feet,
A little rabbit-cheer for every CLI feat!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title captures three distinct changes (deployments env-vars, function-deploy.logs, and skills install cleanup), but the raw_summary shows the main focus is on removing -s flags from skills install with supporting features, while the title treats all three changes equally.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/link-skills

Comment @coderabbitai help to get the list of available commands and usage tips.

@jwfing jwfing requested a review from CarmenDou March 31, 2026 23:35
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a3d523d and 35f5d08.

📒 Files selected for processing (2)
  • package.json
  • src/lib/skills.ts

@jwfing jwfing marked this pull request as draft March 31, 2026 23:59
- 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)
@jwfing jwfing marked this pull request as ready for review April 1, 2026 01:00
@jwfing jwfing changed the title chore: remove -s flag from agent skills install feat: add deployments env-vars, function-deploy.logs, and cleanup skills install Apr 1, 2026
@jwfing jwfing requested review from CarmenDou and tonychang04 April 1, 2026 01:02
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/commands/diagnose/logs.ts (1)

9-44: Code duplication with src/commands/logs.ts.

The SOURCE_PATH mapping and getLogPath() helper are duplicated verbatim between this file and src/commands/logs.ts. Consider extracting these to a shared utility in src/lib/api/ (near ossFetch) 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

📥 Commits

Reviewing files that changed from the base of the PR and between 35f5d08 and c1af1fe.

📒 Files selected for processing (4)
  • src/commands/deployments/env-vars.ts
  • src/commands/diagnose/logs.ts
  • src/commands/logs.ts
  • src/index.ts

@jwfing jwfing merged commit b9e3250 into main Apr 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants