Skip to content

feat(cli): add orca skills install and orca skills update for headless skill setup - #9201

Merged
brennanb2025 merged 21 commits into
stablyai:mainfrom
scastanoh21:feat/add-command-to-install-skills
Jul 30, 2026
Merged

brennanb2025 merged 21 commits into
stablyai:mainfrom
scastanoh21:feat/add-command-to-install-skills

Conversation

@scastanoh21

@scastanoh21 scastanoh21 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds orca skills install and orca skills update — local-only (no running Orca runtime needed) CLI commands that install and refresh Orca's bundled agent skills without the desktop app. Today the only documented paths are the npx skills add ... --global / npx skills update ... --global commands pre-filled by Orca's Settings UI — on a headless host (SSH, container, CI) there's no Settings UI to copy them from.

  • orca skills install / orca skills update with no args list the installable/updatable skill names.
  • --skill <name> [--skill <name> ...] or --all resolve to the same npx skills add <repo> --skill <names...> / npx skills update <names...> commands Settings would show (via the shared buildAgentFeatureSkill{Install,Update}Command helpers), then run them via npx, forwarding output and exit code.
  • Both act globally by default (add --global, matching current Settings behavior); --local targets the current project instead.
  • --dry-run prints the resolved command without running it. --json is only valid together with --dry-run (a real run streams npx's own non-JSON stdout live) and is rejected otherwise with a clear error.
  • Legacy skill-guide topic aliases (e.g. a renamed skill's old name) resolve to the current canonical skill name, same as skills get.
  • The two handlers share one implementation (createSkillMutationHandler), and the shared update-command builder now accepts multiple skill names plus a { global } option — single-string callers in the Settings UI are unaffected (the parameter is a string | readonly string[] union defaulting to global).

Also simplifies orca skills list's plain-text output to just the bare skill names, one per line — the previous format printed name: <full multi-sentence description> as one very long unwrapped line per skill, which was unreadable in a real terminal. --json output is unchanged (still includes full descriptions).

Documented both commands in docs/reference/headless-linux-server.md for the headless-host use case they target.

Screenshots

No visual change (CLI-only; no renderer/UI code touched).

Testing

  • pnpm lint — passes for all changed files (oxlint, styled-scrollbars check, reliability gates, max-lines ratchet, bundled-skill-guides/skill-bundle-manifest verification, localization catalog/coverage all green). Note: pnpm run lint:switch-exhaustiveness fails on main itself (pre-existing, in src/renderer/src/components/native-chat/native-chat-session-option-labels.ts and src/renderer/src/components/skills/skill-freshness-group.tsx) — confirmed by stashing this branch's changes and re-running against a clean checkout; neither file is touched by this PR.
  • pnpm typecheck — clean (node, cli, web configs).
  • pnpm test — passes for everything this PR touches: src/cli 506/506, src/shared/agent-feature-install-commands.test.ts 7/7, and a 290-file / 2665-test renderer sweep covering every UI caller of the shared update-command helper whose signature changed. The full monorepo run has 43 pre-existing failures across 8 renderer test files (window.localStorage undefined in the local sandbox's happy-dom environment) — confirmed pre-existing by stashing this branch's changes and reproducing identically on a clean checkout; none of those files are touched by this PR.
  • pnpm build — the desktop + native build passed on the earlier install-only commits; this delta only adds CLI + src/shared code (no native/electron/web runtime surface), re-verified via pnpm build:cli plus all three typecheck configs, and exercised against the rebuilt binary (orca skills install/update, list, group help).
  • Added high-quality tests: orca skills install and orca skills update behavior (listing, --skill/--all/--local/--dry-run combinations, --json-without---dry-run rejection, unknown-skill/conflicting-flag errors, legacy alias resolution, real npx spawn args + exit-code/error propagation via a mocked child_process), the simplified skills list output, group/root help listing both new commands, and the multi-skill + { global } update-command builder in src/shared/agent-feature-install-commands.test.ts.

AI Review Report

Reviewed with Claude Code (this PR was written by an AI coding agent under human supervision).

  • Cross-platform: npx is spawned with shell: process.platform === 'win32' (Windows only resolves .cmd shims through a shell; macOS/Linux spawn npx directly), mirroring the existing pattern in src/cli/runtime/launch.ts. No hardcoded path separators; no OS-specific string literals beyond that one guarded branch.
  • SSH/remote/local: skills list/get/install/update are all local-only handlers (never touch ctx.client/RuntimeClient), so they work identically over SSH-managed terminals, WSL, or a bare local shell — no runtime/network dependency.
  • Agent/integration compatibility: purely additive CLI surface. Existing skill names/URLs are reused from src/shared/agent-feature-install-commands.ts (the same source Settings uses). The one shared-module change — widening buildAgentFeatureSkillUpdateCommand to accept a name array + { global } — is backward compatible for its many single-string UI callers (verified by the 290-file renderer sweep passing unmodified).
  • Performance: no hot-path impact; every skills handler lazily import()s the large generated skill-guide table only when it runs, so unrelated CLI commands don't pay that cost.
  • UI quality: N/A, no UI changed.
  • Security: npx is invoked with an explicit argv array (never a shell string built from user input) except for the Windows shell: true case, where the only interpolated values are the fixed ORCA_SKILLS_REPOSITORY_URL constant and skill names validated against a canonical allowlist before use (unknown names are rejected, never passed through). No new file writes from Orca itself — installation/updating is delegated to the existing, already-documented npx skills community tool, exactly as Orca Settings already recommends; this PR only adds CLI-native ways to construct/run those same commands.

Security Audit

  • Input handling: --skill values are resolved against the bundled skill registry (BUNDLED_SKILL_GUIDES, including legacy aliases) before use; anything not in that allowlist is rejected with an invalid_argument error listing the valid names. No arbitrary string is passed through to command execution.
  • Command execution: child_process.spawn is called with an argv array, not a shell string, on macOS/Linux. On Windows, shell: true is required for Node to resolve the npx.cmd shim, but the argv values passed alongside it are limited to the fixed repo URL and allowlisted skill names above, so this does not introduce a shell-injection surface.
  • Path handling: none — no filesystem paths are constructed or written by this change.
  • Auth/secrets: none touched.
  • Dependencies: no new dependencies added; this shells out to the existing external npx skills package (already the documented install/update mechanism referenced throughout src/shared/agent-feature-install-commands.ts and Orca Settings).
  • IPC: none — CLI-only change with no Electron main/renderer IPC surface touched.

Notes

  • No platform-specific behavior beyond the documented Windows shell: true requirement for spawning npx.
  • No remote/SSH-specific behavior — the commands are local-only and do not require a reachable Orca runtime.
  • Follow-up (out of scope here): the pre-existing lint:switch-exhaustiveness failures and the pre-existing renderer test failures noted above are unrelated to this change and were not introduced or touched by it.

Twitter/X: @scastano21

ELI5

Headless hosts can install and update Orca's bundled agent skills from the CLI with orca skills install and orca skills update. You no longer need the desktop Settings UI to copy npx commands.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds orca skills install and orca skills update for selecting bundled skills, resolving aliases, validating flags, previewing commands, and executing npx skills globally or locally. CLI parsing, command builders, help text, specifications, tests, and headless Linux documentation are updated. Non-JSON skill listing now outputs canonical names only.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main CLI change: adding headless skills install/update commands.
Description check ✅ Passed The description follows the template with Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes sections filled in.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3761de2c-7653-45c8-9ad8-b68bd0e5f045

📥 Commits

Reviewing files that changed from the base of the PR and between 1c54171 and 332ff9e5910c1cbe039ee6da23e233c1a19d48bb.

📒 Files selected for processing (8)
  • docs/reference/headless-linux-server.md
  • src/cli/args.ts
  • src/cli/handlers/skills.ts
  • src/cli/help.ts
  • src/cli/skills.test.ts
  • src/cli/specs/skills.ts
  • src/shared/agent-feature-install-commands.test.ts
  • src/shared/agent-feature-install-commands.ts

Comment thread src/cli/handlers/skills.ts Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor

Taking a look!

@scastanoh21 scastanoh21 changed the title feat(cli): add orca skills install for headless skill setup feat(cli): add orca skills install and orca skills update for headless skill setup Jul 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6cd6c853-fd47-4a69-be6d-8b525ebce58a

📥 Commits

Reviewing files that changed from the base of the PR and between f1765dfeea71cef513a0620819540e8ff6b0783b and f9e8fb46a692719022272e0c6cb48a9045190d7f.

📒 Files selected for processing (7)
  • docs/reference/headless-linux-server.md
  • src/cli/handlers/skills.ts
  • src/cli/help.ts
  • src/cli/skills.test.ts
  • src/cli/specs/skills.ts
  • src/shared/agent-feature-install-commands.test.ts
  • src/shared/agent-feature-install-commands.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/cli/help.ts
  • src/cli/specs/skills.ts

Comment thread src/cli/handlers/skills.ts Resolved
Comment thread src/cli/handlers/skills.ts Resolved
scastanoh21 and others added 6 commits July 20, 2026 19:34
Headless hosts (SSH, containers, CI) have no desktop Settings UI to copy the
`npx skills add ... --global` command from, so there was no way to install
Orca's bundled agent skills there. `orca skills install` lists installable
skills, resolves the same command Settings would show, and runs it via `npx`
(or just prints it with `--dry-run`). `--local` installs into the current
project instead of globally. Also simplifies `orca skills list`'s text output
to bare names (the prior one-line-per-skill format with full descriptions was
unreadable in a real terminal); `--json` is unchanged.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
CodeRabbit flagged that --json inherited npx's raw stdout during a real
(non-dry-run) install instead of emitting JSON, breaking the machine-readable
contract --json implies. A real install streams npx's own output live (useful
for a possibly slow network install), so buffering it into a JSON envelope
would trade away that visibility; reject the combination instead and point
callers at --dry-run --json for a JSON-formatted preview.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Addresses CodeRabbit's docstring-coverage flag on this PR's changed files.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Headless hosts had no CLI-native way to refresh already-installed skills — the
`npx skills update` rail was only reachable from the desktop Settings UI. Add a
symmetric `orca skills update` that mirrors install's flags (--skill/--all,
--local, --dry-run, --json) and resolves to `npx skills update <names...>`.

The install and update handlers now share one implementation
(createSkillMutationHandler); the shared update-command builder accepts
multiple skill names and a { global } option (single-string callers in the
Settings UI are unaffected).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Addresses two CodeRabbit review comments on the skills install/update commands.

- Build `npx skills add` with a repeated `--skill <name>` per skill instead of
  one space-joined `--skill a b`. The installed skills CLI (v1.5.19) `add`
  parser accepts both forms, but the per-flag form is portable across CLI
  versions and keeps the dry-run string and the spawned argv identical. `update`
  keeps positional names, matching `skills update [skills...]`.
- Wrap the child-process `error` event in a RuntimeClientError so a missing
  npx/Node on a headless host reports an actionable message instead of a raw
  spawn error, consistent with the other failure paths in this file.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Use shared argument builders for both displayed and executed commands, select project scope explicitly for local updates, and invoke the Windows command shim without shell-mode argument rewriting. Reject missing skill values and keep command documentation and consumer expectations synchronized.
@brennanb2025
brennanb2025 force-pushed the feat/add-command-to-install-skills branch from fe2f9ff to fb38267 Compare July 21, 2026 02:45
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for the contribution! I rebased the branch onto current main and tightened the execution path: local updates now select project scope explicitly, displayed commands and spawned argv share the same builders, Windows invokes the npx shim without shell-mode argument rewriting, and missing --skill values fail clearly. I also synchronized the affected docs/onboarding expectation and verified 536 focused tests, all typecheck targets, touched-file lint/format, max-lines, generated skill checks, and rebuilt-CLI smoke cases.

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
The manifest-based router landed after this branch was written, so `skills
install`/`skills update` were unroutable once rebased onto main. Also mirror
the real RuntimeClientError in the test mock: format.ts narrows with
`instanceof` against ./runtime/types, so a look-alike collapsed every error
into the generic runtime_error shape.
Three real defects on the path this feature targets:

- `skills add` opens an interactive agent picker and blocks forever on any
  allocated TTY, which is every ssh session. Verified against the real CLI
  under a pty: it hangs and installs nothing. Send `-y`, and `npx --yes` so a
  cold package cache cannot prompt either. The copyable Settings strings are
  unchanged — `yes` defaults to false.
- Windows hardcoded `npx.cmd` behind cmd.exe, so an `npx.exe` shim was missed
  and a missing npx surfaced as cmd.exe's own exit code, making the friendly
  ENOENT message unreachable. Reuse resolveCliCommand + getSpawnArgsForWindows.
- --dry-run built its command string separately from the spawned argv, so the
  two could drift. Render the argv instead.

Also revert the unrelated `skills list` output change (out of scope) and
correct the docs/spec notes that promised --json on a real run.
Round-2 review findings:

- resolveCliCommand can return an npx that is off PATH, but npx is an
  `env node` script: without node alongside it the child exits 127 with no
  'error' event, so the actionable message never fired. Put the resolved
  directory (and the version-manager bins) on the child's PATH.
- The SSH relay and WSL bridge forward argv to the Orca host, so a real run
  would install onto the desktop and silently skip the machine the user is on.
  Refuse when ORCA_CLI_CWD marks a forwarded shell; --dry-run still works.
- getSpawnArgsForWindows rejects cmd metacharacters, which a username like
  'A&B' puts in the resolved npx path. Report that instead of a bare throw.
- --skill had no help text, and the specs/docs claimed --json needs --dry-run
  when the skill listing supports it too.
resolveCliCommand returns the bare name when it finds nothing, and
dirname('npx') is '.', so the previous commit prepended the caller's cwd to
the child's PATH — an executable named npx in a checked-out repo would run
with inherited stdio instead of the missing-npx message. Verified closed
against a repro.

Also narrow the spawn-args catch to UnsafeWindowsBatchArgumentsError so an
unrelated throw is not mislabelled, and drop getVersionManagerBinPaths: every
version manager ships node beside npx, so the resolved sibling is enough.
The tests asserted against the ambient PATH, so a dev machine with a trailing
separator or a '.' entry failed them spuriously. Stub it and assert the exact
constructed value instead, which also kills more mutations than not.toContain.
A one-entry stub made 'append the whole inherited PATH' and 'append its first
entry' indistinguishable, which is exactly what the assertion is for.
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for this — the headless gap is real and a CLI-native path is the right shape. I reviewed it end to end, rebased it onto current main, and pushed fixes. Details on what I changed and why:

It didn't dispatch on current main. The manifest-based handler router landed after you opened this, so skills install / skills update weren't registered in src/cli/handler-group-manifest.ts and both commands were unroutable once merged. registry-parity.test.ts catches this, but CI never ran on the PR, so nothing surfaced it. Registered both keys.

The install hung on any TTY and installed nothing. This is the big one. skills add opens an interactive agent picker unless it gets -y. I verified against the real CLI under a pty with agent-detection env stripped:

  • old argv: blocked, killed at 181s, nothing written to disk
  • with -y: exit 0 in ~28s, both skills installed

ssh allocates a TTY by default, so this failed on exactly the hosts the feature targets. It only worked in my first tests because the skills CLI auto-detects an agent environment and forces non-interactive. Now the CLI sends npx --yes ... -y (--yes so a cold package cache can't prompt either). The strings Settings shows you are unchanged — the new yes option defaults to false, and I added a test that fails if -y ever leaks into a copyable command.

Windows. The hand-rolled cmd.exe /d /s /c npx.cmd missed npx.exe shims, and because cmd.exe always exists, a missing npx came back as cmd's own exit code — so the actionable "Install Node.js" message you wrote could never fire on Windows. Now uses resolveCliCommand + getSpawnArgsForWindows, the same pair src/main/skills/skill-update-run.ts uses.

SSH relay / WSL. These commands write to the invoker's disk, which every other orca command doesn't. The relay and WSL bridge forward argv to the Orca host, so a real run would have installed onto the desktop and silently skipped the machine you're on. They now refuse there and print the command to run instead; --dry-run still works.

Smaller things: --dry-run built its command string separately from the spawned argv, so the two could drift — it now renders the argv. Reverted the orca skills list output change as out of scope for this PR (happy to take it as a standalone one; the "unreadable long line" complaint is fair). Corrected the docs/spec notes that promised --json on a real run, and added coverage for repeated --skill, which was the documented primary invocation and had none.

Known and accepted, not blocking: the CLI trusts npx's exit code rather than re-scanning disk the way SkillUpdateRunner does, and skills update exits 0 for a skill that was never installed. Both are documented now rather than papered over.

Verified: typecheck, pnpm lint, and 660 tests green; golden path exercised end to end through the built binary under a real pty.

Comment on lines +173 to +175
function formatNpxCommand(args: string[]): string {
return `npx ${args.join(' ')}`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 --dry-run command display doesn't shell-quote arguments

formatNpxCommand joins args with a raw space: a skill name containing a space or metacharacter would produce a displayed command that doesn't round-trip correctly in a shell. Right now all skill names are validated against an allowlist (lowercase, hyphens only) and the URL is a constant, so there's no current exposure — but if either ever changes the user-visible command shown by --dry-run could be misleading without any other indication. Consider using a quoting helper (e.g., wrapping each arg in single-quotes and escaping internal ') if this display string is intended to be copy-pasteable.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

Adds orca skills install and orca skills update CLI commands for headless environments (SSH, containers, CI) where Orca's Settings UI is unavailable. The two commands share a single createSkillMutationHandler factory and delegate to the same buildAgentFeatureSkillInstallArgs/buildAgentFeatureSkillUpdateArgs helpers that Settings already uses.

  • New handlers: skills install and skills update validate skill names against the bundled allowlist, detect coding agents present on the host, construct the equivalent npx skills add/npx skills update command with the non-interactive flags an unattended host requires (--yes, -y), and forward live output and exit code; --dry-run prints the resolved command without running it.
  • Shared module widened: buildAgentFeatureSkillInstallCommand now emits one --skill flag per name (previously space-separated after a single --skill), and buildAgentFeatureSkillUpdateCommand gains array + { global } support; both changes are backward-compatible for existing single-string callers confirmed by a 290-file renderer test sweep.
  • New skills-cli-agent-keys module: maps Orca's internal TuiAgent ids to the community skills CLI's --agent namespace, with a test that validates every mapping against the CLI's published valid-key list.

Confidence Score: 5/5

Safe to merge — purely additive CLI surface with no Electron/renderer/IPC code touched, and the one shared-module change is backward-compatible.

All changed paths are covered by targeted tests: skill-name validation, alias resolution, agent detection and mapping, Windows .cmd routing via cmd.exe, ORCA_CLI_CWD forwarding guard, --dry-run/--json lifecycle, and exit-code propagation. The widened install-command builder guards against the dangerous yes:true + no-agents combination at the shared layer. No runtime, IPC, or data-persistence paths are affected.

Files Needing Attention: No files require special attention — the most complex file (src/cli/handlers/skills.ts) is well-covered by the new test suite.

Important Files Changed

Filename Overview
src/cli/handlers/skills.ts Core implementation — adds resolveSelectedSkillNames, resolveInstallAgentKeys, buildNpxSkillsArgs, runNpxSkills, and createSkillMutationHandler; handles Windows .cmd routing, ORCA_CLI_CWD guard, agent detection, and --dry-run/--json lifecycle correctly.
src/shared/agent-feature-install-commands.ts Shared command builders widened: install switches to one --skill per name (repeated flag form), update accepts string
src/shared/skills-cli-agent-keys.ts New module mapping Orca TuiAgent ids to skills-CLI --agent keys; null entries drop unmappable agents gracefully; universal is always appended so skills reach the shared directory even without a specific agent match.
src/cli/skills.test.ts Comprehensive new tests covering listing, --skill/--all/--local/--dry-run/--json combinations, ORCA_CLI_CWD guard, Windows .cmd routing, agent detection/deduplication, exit-code forwarding, and legacy alias resolution via mocked child_process.
src/shared/skills-cli-agent-keys.test.ts New tests pin every SKILLS_CLI_AGENT_KEY_BY_TUI_AGENT value against a hardcoded snapshot of the skills CLI's valid-key list (v1.5.20) and assert full TuiAgent coverage to catch new agents silently falling through.
src/cli/specs/skills.ts Adds allowedFlags, notes, and examples for install and update; correctly omits --agent from update's allowedFlags since update never takes install targets.
src/cli/args.ts Adds 'local' to BOOLEAN_FLAGS and 'skill' to REPEATABLE_STRING_FLAGS; both are narrow, targeted additions with no risk to other commands.
docs/reference/headless-linux-server.md Adds a new section documenting install/update usage, the --agent requirement, --dry-run, and SSH/WSL forwarding behaviour; content matches the implementation accurately.

Reviews (6): Last reviewed commit: "Merge commit 'bbb3e7e5ee4a7c861d2f0e3a17..." | Re-trigger Greptile

… CLI's

Converges with stablyai#11254 (fixes stablyai#9567): a pasted Settings install stalls on npm's
fetch prompt and the skills agent picker exactly as a spawned one does, so
`npx --yes` and `-y` are unconditional on install rather than a CLI-only
opt-in. The desktop and CLI install commands are now byte-identical.

Update keeps them opt-in and the CLI alone passes them: the pasted update
string has to stay `npx skills update <name> --global` because
normalizeWindowsSkillUpdateCommand parses that exact shape to swap in a
reinstall on native Windows, and the extra flags stop it matching. Pinned with
a test so the two cannot drift apart silently.
@brennanb2025

Copy link
Copy Markdown
Contributor

Follow-up after cross-checking this against the wider skill-install cluster — one substantive change, pushed as abc930664d.

The -y fix now applies to the pasted Settings command too, not just the CLI. My earlier fix made the non-interactive flags a CLI-only opt-in, deliberately leaving the Settings strings untouched as out of scope. That was the wrong call: #9567 is about the command Orca pastes into its ephemeral setup terminal, and I confirmed under a real pty that the pasted form stalls exactly the same way. #11254 fixes that same line by making npx --yes / -y unconditional. Rather than land two competing shapes in one builder, this now matches: install always carries both flags, and the desktop and CLI install commands are byte-identical.

Update deliberately stays opt-in, and that asymmetry is load-bearing. normalizeWindowsSkillUpdateCommand matches ^npx\s+skills\s+update\s+([A-Za-z0-9_-]+)\s+--global$ to swap in a reinstall on native Windows, where skills update is unreliable. Adding the flags to the pasted update string stops that regex matching and silently disables the workaround — I verified the non-match directly. So only the CLI, where nothing can answer a prompt, passes them on update. There's now a test pinning the pasted update shape against that regex so the two can't drift apart.

On the two claims flagged as unverified — here's the evidence.

Repeated --skill vs variadic, run against the real CLI in clean temp dirs:

  • --skill orca-cli --skill orchestration -y → exit 0, both skills on disk
  • --skill orca-cli bogus-name-xyz -y → exit 0, only orca-cli installed, and no mention of bogus-name-xyz anywhere in the output

So the variadic form silently swallows names the repo doesn't have. The repeated form is the hardening, not the risk — worth considering for #11254, which currently keeps the variadic shape.

--project is real: skills update --help lists -p, --project Update project skills only, and I ran it end to end.

One thing this does not fix, and shouldn't: orca skills install defaults to --global, so it inherits #4642 — I reproduced it, Failed to install 2 … PromptScript does not support global skill installation, with exit 0. The universal .agents/skills target does land, so the install is usable, but the exit code hides the per-target failure. That's #6580's call to make, not this PR's; the docs now say a 0 exit doesn't mean every target was written.

Gates on the pushed head: typecheck, pnpm lint, and 8424 tests green across the CLI, shared, and every renderer consumer of the shared builder.

`skills add -y` skips the agent picker, and with no agent detected it falls
into a branch that installs into every agent it knows. Measured on a bare home:
52 new top-level agent config directories and 53 symlinks, for agents the host
does not have. Real Windows validation showed the same, 52 dirs / 54 junctions.

Pass an explicit --agent list instead, built from Orca's own detection plus the
shared .agents/skills directory Orca reads, which makes that branch unreachable.
Same bare home with --agent universal: 1 directory, 0 symlinks, skill still
installed. When Orca detects nothing, refuse and ask for --agent rather than
guessing at ~75 targets.

The GUI command is untouched — its picker is deliberate. --agent takes one
comma-separated value rather than repeating, because `agent` is a single-value
flag on other commands and the repeatable set is process-wide.
…nstall

Both reviewers found the same one: `--agent ','` trims to no tokens, which
skipped the no-agent refusal AND emitted no --agent, producing exactly the
command this scoping exists to prevent. Reproduced on the built binary.

Enforced at the choke point instead of on the input — the install args builder
now refuses -y with an empty target list, so no caller present or future can
express that combination. `--agent` with a bare, empty or separator-only value
is a clear error rather than a silent fallback.

Also from review: run the forwarded-shell refusal before target resolution, so
the message never carries the wrong host's agent list or gets replaced by a
no-agent error; give `--agent` command-specific help instead of inheriting the
terminal-launch wording; and follow Orca's own evidence on two mappings —
openclaude reads Claude-owned roots (native-chat-agent-profiles), and trae is
detected by `traecli`, an alias only TRAE CN ships.
The emptiness guard was not enough. The skills CLI drops a --agent value that
starts with `-` without erroring, which leaves its target list empty and falls
into the same all-agents branch as passing no --agent at all — so `--agent -y`
reproduced the 52-directory install on a bare host. Confirmed end to end.

Validate shape, not just emptiness, at the same choke point, so any token that
reaches the argv is one the CLI will keep. `*` stays allowed since asking for
every agent explicitly is a choice, not an accident. An unknown but plausible
key is still left to the CLI, which rejects it loudly before writing anything.

Also pin the two evidence-based mappings and the forwarded-shell ordering, which
mutation testing showed were unasserted.
@brennanb2025
brennanb2025 merged commit 676ef7f into stablyai:main Jul 30, 2026
46 checks passed
@AmethystLiang

Copy link
Copy Markdown
Contributor

looking into it

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…s skill setup (stablyai#9201)

Adds `orca skills install` and `orca skills update` so skills can be set up without the GUI — SSH hosts, containers, CI. Previously `orca skills` had only `list` and `get`, so there was no headless path.

**Agent targeting is scoped explicitly rather than delegated to detection.** The `skills` CLI decides which agents to install into, and with `-y` and zero detected agents it takes `targetAgents = validAgents` — all ~75. That is not a corner case for a headless CLI: a fresh SSH box or container with no agent installed is the normal starting state. Measured on a bare host, the unscoped command created **52 top-level agent directories and 54 junctions** (one real payload in `~/.agents/skills`, the rest links) on Windows, and 52/53 on macOS.

The CLI now passes `--agent` derived from Orca's own detection, mapped to the `skills` key namespace, plus `universal`. Supplying `--agent` makes `runAdd` use it directly and never call `detectInstalledAgents()`, so the fan-out branch is unreachable. On a bare host it now refuses with `No coding agent detected on this host` and exit 1, creating nothing. Same command with scoping: **1 directory, 0 junctions.**

`universal` alone would under-install — Claude Code is not in that set, and 19 of 28 mapped keys write agent-private homes `universal` never touches. `--agent '*'` is the bug itself. The mapping is hedged three ways: `null` for any agent whose key could not be confirmed, `satisfies Record<TuiAgent, …>` so a new Orca agent is a compile error, and a test pinning every mapped key against the CLI's own valid list.

Fixed during review — two holes that each restored the full fan-out through a different door:
- `--agent ','` trimmed to nothing, which skipped the refusal *and* emitted no `--agent`.
- `--agent -y` passed an emptiness check, and the vendor CLI silently drops `-`-leading values, re-emptying its list.

The real invariant is argument *shape*, not emptiness, and it is now enforced at the choke point in `buildAgentFeatureSkillInstallArgs`, so no caller can emit `-y` without a usable target. `*` remains allowed — asking for every agent explicitly is a choice, not an accident. Verified with 51 hostile inputs through the built binary, each recorded argv replayed through the vendor's own parser.

Also fixed: the `ORCA_CLI_CWD` refusal now runs before target resolution (it was quoting the wrong host's agent list), and `--dry-run` is refused in a forwarded shell rather than printing a command naming the wrong machine.

Validated on a real Windows host across PowerShell 7, PowerShell 5.1, cmd.exe and Git Bash: `.cmd` shims route through `cmd.exe` and `.exe` shims spawn directly (proved with instrumented shims, not inferred), the ENOENT path produces an actionable error rather than a silent failure, and `skills update` genuinely restores a corrupted skill byte-for-byte.

Known, not addressed here — both upstream behaviours this only forwards: a partial install failure exits 0, and "no installed skills found" exits 0. Both are invisible to the headless callers this feature exists for.

Co-authored-by: scastanoh21 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants