You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cli: add orca plugin dev load/unload/reload, list, logs, enable and disable - #36288
An agent (or a person) can now load a plugin folder into the running Orca, see whether it works, read its logs, and turn plugins on and off, all with orca:
orca plugin dev load ./my-theme makes a theme show up in Orca right away. Themes, icons, syntaxes and translations never need approval.
orca plugin dev load ./my-panel refuses with approval_required (exit 3) and says exactly what the plugin would be allowed to do. It also prints the exact command to re-run with --approve <fingerprint>. The agent decides whether to ask its user first.
The orca-cli skill guide now teaches agents the whole loop: create → validate → dev load → iterate → logs, plus how to publish with Git and gh.
Builds on #36279 and #36280, which have both merged.
What Changed
New runtime RPCs: plugins.devLoad, plugins.devUnload, plugins.refresh and plugins.getLogs, all host-admin.
Content-only plugins run at once. Anything else stays loaded but inert until the matching fingerprint is passed. Every grant is audit-logged as "approved via CLI".
plugin dev load|reload|unload, plugin list, plugin logs, plugin enable|disable;
enable/dev load/dev reload take --approve <fingerprint>;
on approval_required/approval_stale, the CLI adds data.command: the caller's exact command plus --approve <fingerprint>.
Re-enabling a disabled plugin that runs code needs --approve again. Re-enabling a content-only plugin, or "enabling" one that is already approved and running, needs nothing.
New skill-guides/orca-cli/references/plugins.md, with a pointer and gate row in orca-cli.md. It covers commands, approval rules ("confirm with your user unless they already asked for exactly this plugin and access"), and publish steps (tag vX.Y.Z, add the orca-plugin topic with gh, check https://www.onorca.dev/plugins/<owner>/<repo>).
docs/reference/plugin-authoring.md gets the CLI dev loop and the same publish steps.
Approval message wording: the stale case now also covers a wrong fingerprint.
The plugin handler groups moved to src/cli/plugin-handler-groups.ts, which keeps the manifest under its line limit.
Why
This finishes Phase 1 of the plugin CLI for agents: the agent can now see the plugin it made running in Orca. Dev load reuses the existing development-folder setting and watcher rather than adding a parallel mechanism, so the desktop Settings list, hot reload, and dev-consent semantics stay exactly as they are. Approval goes through the single host function from #36279, so install and update in Phase 2 will reuse the same flag. Per the CEO's decision there is no orca plugin publish command; agents follow the documented Git and gh steps.
Linked Issue
N/A (maintainer).
Visual Proof
N/A: this is CLI and RPC only. A dev-loaded plugin shows in the existing Settings → Plugins list, which is unchanged.
Testing
Automated tests added/updated
plugin-dev-folders.test.ts:
a content-only folder activates;
a panel stays inert without the flag, then activates with the shown fingerprint;
relative paths and a host with plugins off are refused;
unload works by key and by path.
plugin-runtime.test.ts: the re-run command keeps every other argument and replaces only --approve.
Skill guide tests are updated for the new reference.
Manual end-to-end against a headless orca serve built from this branch (isolated user data, background launch):
a theme dev load gives content-only;
an editor dev load exits 3 with the grant list and the re-run command;
a wrong fingerprint gives approval_stale, and the right one gives "approved with --approve";
disable then enable without the flag asks again;
logs and list work;
the same flow works over --pairing-code (paired-device caller), and a relative path is refused there;
audit.log shows cli:local and cli:paired-device:<id> entries.
pnpm tc, pnpm run check:code-quality:changed, and the cli, plugin, runtime-rpc and shared-plugin test folders pass locally (macOS).
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
SSH/remote: development folders are paths on the Orca host.
With --environment/--pairing-code, the CLI sends an absolute path, and a relative one is refused.
From a bridged shell (ORCA_CLI_CWD), the commands refuse instead of naming the wrong machine's folder.
Legacy SSH relay CLIs cannot reach these methods at all.
Mixed versions: these are all new methods. An older host answers method_not_found, which the CLI maps to runtime_unsupported ("update Orca on that host"). approvalFingerprint is an optional field.
Windows: the host resolves paths with realpath/isAbsolute, and argument quoting in the re-run command follows the existing CLI helper.
Checklist
This PR is small and focused
I explained what changed and why
N/A for visuals with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote impact considered
Typecheck, lint, tests pass locally; CI covers the rest
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Walkthrough
The CLI adds commands to list plugins and logs, enable or disable plugins, and load, reload, or unload development plugins. New RPC methods and folder operations support development-plugin lifecycle actions, with approval handling for plugins that run code. The changes also add command specifications, tests, and plugin authoring and publishing guidance, including a bundled plugin reference.
Priority: Normal
Merge Risk: Low · up to c825d
The constant relocation introduces no identified regression. Pathless reload approval and cross-platform host paths remain bounded concerns to address or explicitly accept.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 28.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly identifies the primary CLI additions for plugin development and management, including load, unload, reload, list, logs, enable, and disable commands.
Description check
The description includes the required sections and provides clear user-facing changes, rationale, linked-issue context, visual-proof justification, testing details, compatibility notes, and checklist …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description includes the required sections and provides clear user-facing changes, rationale, linked-issue context, visual-proof justification, testing details, compatibility notes, and checklist results. The empty Review and omitted AI Disclosure details are non-critical for this maintainer PR.
Full details: Docstring Coverage
Explanation
Docstring coverage is 28.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 25 functions across 18 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Additional comments: 1
docs/reference/plugin-authoring.md-179-180: 1
179-180: Minor · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Include the directory’s license requirement.
The scaffolded plugin has no license, but the directory excludes repositories without a manifest license or detectable LICENSE file. A plugin can pass validation and follow these steps without being listed. Add this prerequisite here and in skill-guides/orca-cli/references/plugins.md. (raw.githubusercontent.com)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 61ece383-c41f-41e1-b2fc-8c0ac46cce08
Commits
Reviewing files that changed from the base of the PR and between f7ff1ee and c71993a.
Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n 160,225p src/cli/handlers/plugin-runtime.ts
rg -n "reload" src/cli/specs/plugin.ts skill-guides/orca-cli/references/plugins.md
Repository: stablyai/orca
Length of output: 3263
Script executed:
set -eu
printf'%s\n''--- plugin spec ---'
sed -n '90,145p' src/cli/specs/plugin.ts
printf'%s\n''--- approval and argument helpers ---'
rg -n -F --glob '*.ts' -e "approve" -e "stringFlag" -e "requirePluginPathArg" -e "plugin dev reload" src/cli | sed -n '1,240p'printf'%s\n''--- bundled guide occurrences ---'
rg -n -F --glob 'src/cli/bundled-skill-guides.ts' -e "plugin dev reload" -e "ORCA plugin dev reload" src/cli/bundled-skill-guides.ts ||trueprintf'%s\n''--- source guide context ---'
sed -n '1,45p' skill-guides/orca-cli/references/plugins.md
printf'%s\n''--- bundled guide context ---'
python3 - <<'PY'from pathlib import Pathp = Path('src/cli/bundled-skill-guides.ts')text = p.read_text()needle = 'plugin dev reload'for i, line in enumerate(text.splitlines(), 1): if needle in line: print(f'{p}:{i}:{line}')PY
Repository: stablyai/orca
Length of output: 13883
Script executed:
set -eu
printf'%s\n''--- command spec and parser references ---'
rg -n -F --glob '*.ts' -e 'allowedFlags' -e 'positionalArgs' -e 'CommandSpec' -e 'commandSpec' -e 'validate' src/cli | sed -n '1,260p'printf'%s\n''--- reload dispatch and tests ---'
sed -n '1,90p' src/cli/plugin-handler-groups.ts
rg -n -F --glob '*.test.ts' -e 'plugin dev reload' -e 'plugins.refresh' -e '--approve' src/cli | sed -n '1,240p'printf'%s\n''--- handler entry context ---'
sed -n '1,175p' src/cli/handlers/plugin-runtime.ts
Repository: stablyai/orca
Length of output: 31000
Script executed:
set -eu
rg -n -F -- 'export function validateCommandAndFlags''function validateCommandAndFlags''export function parseArgs''function parseArgs' src/cli/args.ts
sed -n '1,180p' src/cli/args.ts
sed -n '280,365p' src/cli/args.test.ts
Repository: stablyai/orca
Length of output: 471
Script executed:
set -eu
sed -n '180,270p' src/cli/args.ts
Repository: stablyai/orca
Length of output: 3029
Document --approve only with a directory.
The command accepts a pathless reload, but --approve has no effect in that form. Show the pathless and directory-specific forms separately, and apply the same edit to the bundled guide.
Suggested documentation fix
--- "a/skill-guides/orca-cli/references/plugins.md"+++ "b/skill-guides/orca-cli/references/plugins.md"@@ -9,7 +9,8 @@
ORCA plugin validate <dir|orca-plugin.json|orca-catalog.json> --json
ORCA plugin inspect <dir> --json
ORCA plugin dev load <dir> [--approve <fingerprint>] --json
-ORCA plugin dev reload [<dir>] [--approve <fingerprint>] --json+ORCA plugin dev reload [--json]+ORCA plugin dev reload <dir> [--approve <fingerprint>] --json
ORCA plugin dev unload <dir|plugin-key> --json
ORCA plugin list --json
ORCA plugin logs <plugin-key> --json
Update the equivalent usage text in src/cli/specs/plugin.ts so CLI help does not present --approve as independent of <dir>.
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
ORCA plugin dev reload [<dir>][--approve <fingerprint>] --json
ORCA plugin dev reload [--json]
ORCA plugin dev reload <dir> [--approve <fingerprint>] --json
'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.'
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
#!/bin/bash# Check where ORCA_CLI_CWD is read and how isRemote is derived.
rg -nP -C4 'ORCA_CLI_CWD' src/cli
rg -nP -C4 'isRemote' src/cli/runtime
Repository: stablyai/orca
Length of output: 10962
Script executed:
set -o pipefail
printf'%s\n''--- CLI environment and client construction ---'
rg -n -F -C5 -- '--environment' src/cli src | head -n 240
printf'%s\n''--- RuntimeClient construction and remote assignment ---'
rg -n -F -C6 -- 'new RuntimeClient' src/cli
rg -n -F -C6 -- 'this.remote' src/cli/runtime
printf'%s\n''--- ORCA_CLI_CWD assignment and bridge handling ---'
rg -n -F -C6 -- 'ORCA_CLI_CWD' src | head -n 240
Repository: stablyai/orca
Length of output: 45667
Script executed:
set -o pipefail
printf'%s\n''--- src/cli/index.ts ---'
nl -ba src/cli/index.ts | sed -n '1,180p'printf'%s\n''--- src/cli/runtime/client.ts constructor ---'
nl -ba src/cli/runtime/client.ts | sed -n '1,115p'printf'%s\n''--- RuntimeClient export/constructor wrapper ---'
nl -ba src/cli/runtime-client.ts | sed -n '1,180p'printf'%s\n''--- execution host selection ---'
nl -ba src/cli/execution-host-flag.ts | sed -n '1,360p'
Repository: stablyai/orca
Length of output: 29285
Allow explicitly selected remote environments.
When --environment selects a remote RuntimeClient, ORCA_CLI_CWD can remain set by the bridge. The current guard throws before resolving the plugin path, so the documented recovery fails. Keep rejecting forwarded local clients, but allow ctx.client.isRemote.
Suggested fix
--- "a/src/cli/handlers/plugin-runtime.ts"+++ "b/src/cli/handlers/plugin-runtime.ts"@@ -91,7 +91,7 @@
/** Development folders are paths on the Orca host, which may not be this machine. */
function resolveHostPluginPath(ctx: HandlerContext, value: string): string {
- if (process.env.ORCA_CLI_CWD) {+ if (process.env.ORCA_CLI_CWD && !ctx.client.isRemote) {
throw new RuntimeClientError(
'invalid_environment',
'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.'
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
if(process.env.ORCA_CLI_CWD){
thrownewRuntimeClientError(
'invalid_environment',
'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.'
'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.'
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Remote path check uses the CLI machine's path rules.
isAbsolute runs on the CLI machine. The host can use a different platform. Example: a Linux CLI sends C:\plugins\dusk to a Windows Orca server with --environment. isAbsolute returns false on POSIX, so lines 103-108 reject a valid host path.
The host already validates this in resolveDevFolder in plugin-dev-folders.ts. It rejects relative paths with invalid_argument, using the host's own isAbsolute. For a remote client, pass the value through and let the host decide.
♻️ Proposed fix
--- "a/src/cli/handlers/plugin-runtime.ts"+++ "b/src/cli/handlers/plugin-runtime.ts"@@ -97,16 +97,11 @@
'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.'
)
}
- if (isAbsolute(value)) {- return value- }- if (ctx.client.isRemote) {- throw new RuntimeClientError(- 'invalid_argument',- 'Pass an absolute path on the Orca server; a relative path names a folder on this machine.'- )- }+ if (ctx.client.isRemote || isAbsolute(value)) {+ // The host validates the path with its own platform rules.+ return value+ }
return resolve(ctx.cwd, value)
}
function formatPluginRow(plugin: PluginHostListEntry): string {
plugin dev unload has the same assumption at line 208. A remote Windows path is not a plugin key, so it reaches this function and gets the same result.
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
if(isAbsolute(value)){
returnvalue
}
if(ctx.client.isRemote){
thrownewRuntimeClientError(
'invalid_argument',
'Pass an absolute path on the Orca server; a relative path names a folder on this machine.'
)
}
if(ctx.client.isRemote||isAbsolute(value)){
// The host validates the path with its own platform rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
An agent (or a person) can now load a plugin folder into the running Orca, see whether it works, read its logs, and turn plugins on and off, all with
orca:orca plugin dev load ./my-thememakes a theme show up in Orca right away. Themes, icons, syntaxes and translations never need approval.orca plugin dev load ./my-panelrefuses withapproval_required(exit 3) and says exactly what the plugin would be allowed to do. It also prints the exact command to re-run with--approve <fingerprint>. The agent decides whether to ask its user first.orca-cliskill guide now teaches agents the whole loop: create → validate → dev load → iterate → logs, plus how to publish with Git andgh.Builds on #36279 and #36280, which have both merged.
What Changed
plugins.devLoad,plugins.devUnload,plugins.refreshandplugins.getLogs, allhost-admin.devLoadresolves the path on the host, adds it to the same development-folder list Settings → Plugins edits, refreshes, and then applies plugins: require an explicit approve fingerprint for RPC plugin grants #36279'sapprovePluginFromCli.devUnloadanddisablenever need approval.--jsonand the stable exit codes from cli: add orca plugin create, validate and inspect #36280:plugin dev load|reload|unload,plugin list,plugin logs,plugin enable|disable;enable/dev load/dev reloadtake--approve <fingerprint>;approval_required/approval_stale, the CLI addsdata.command: the caller's exact command plus--approve <fingerprint>.--approveagain. Re-enabling a content-only plugin, or "enabling" one that is already approved and running, needs nothing.skill-guides/orca-cli/references/plugins.md, with a pointer and gate row inorca-cli.md. It covers commands, approval rules ("confirm with your user unless they already asked for exactly this plugin and access"), and publish steps (tagvX.Y.Z, add theorca-plugintopic withgh, checkhttps://www.onorca.dev/plugins/<owner>/<repo>).docs/reference/plugin-authoring.mdgets the CLI dev loop and the same publish steps.src/cli/plugin-handler-groups.ts, which keeps the manifest under its line limit.Why
This finishes Phase 1 of the plugin CLI for agents: the agent can now see the plugin it made running in Orca. Dev load reuses the existing development-folder setting and watcher rather than adding a parallel mechanism, so the desktop Settings list, hot reload, and dev-consent semantics stay exactly as they are. Approval goes through the single host function from #36279, so install and update in Phase 2 will reuse the same flag. Per the CEO's decision there is no
orca plugin publishcommand; agents follow the documented Git andghsteps.Linked Issue
N/A (maintainer).
Visual Proof
N/A: this is CLI and RPC only. A dev-loaded plugin shows in the existing Settings → Plugins list, which is unchanged.
Testing
plugin-dev-folders.test.ts:plugin-runtime.test.ts: the re-run command keeps every other argument and replaces only--approve.orca servebuilt from this branch (isolated user data, background launch):dev loadgivescontent-only;dev loadexits 3 with the grant list and the re-run command;approval_stale, and the right one gives "approved with --approve";disablethenenablewithout the flag asks again;logsandlistwork;--pairing-code(paired-device caller), and a relative path is refused there;audit.logshowscli:localandcli:paired-device:<id>entries.pnpm tc,pnpm run check:code-quality:changed, and the cli, plugin, runtime-rpc and shared-plugin test folders pass locally (macOS).Review
Agent skill upstream boundary
Notes
--environment/--pairing-code, the CLI sends an absolute path, and a relative one is refused.ORCA_CLI_CWD), the commands refuse instead of naming the wrong machine's folder.method_not_found, which the CLI maps toruntime_unsupported("update Orca on that host").approvalFingerprintis an optional field.realpath/isAbsolute, and argument quoting in the re-run command follows the existing CLI helper.Checklist
N/Afor visuals with reason