feat(kimi-code): add non-interactive kimi plugins command#1398
Conversation
…nd move official check
…rors Handlers previously wrote to stderr and called deps.exit(1) directly, which terminated the process before runWithLifecycle's finally block could shutdown telemetry and close the harness. Move error writing and exit into runWithLifecycle so cleanup always runs first.
🦋 Changeset detectedLatest commit: 15f6761 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0d3213c56
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5783eeab3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19cbe1d99a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ): Promise<string> { | ||
| const key = nameOrUrl.trim(); | ||
| if (key.length === 0) throw new Error('Registry name or URL cannot be empty'); | ||
| if (isUrlLike(key)) return key; |
There was a problem hiding this comment.
Accept relative registry paths
When users pass a direct relative path such as kimi plugins marketplace --registry ./marketplace.json (documented as a direct URL/path and consistent with the existing /plugins marketplace [source] behavior), this check does not classify it as a direct source, so the command falls through to the saved-registry lookup and fails with Registry not found. Since loadPluginMarketplace already resolves relative paths against the current working directory, treat ./... and ../... as direct paths here or parse registry names separately.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 15f6761. isUrlLike now treats ./... and ../... as direct sources, so kimi plugins marketplace --registry ./marketplace.json bypasses the saved-registry lookup and passes the relative path through to loadPluginMarketplace, which resolves it against the current working directory. Added assertions in plugin-registries.test.ts.
| throw new Error(`exit:${code}`); | ||
| }) as (code: number) => never, | ||
| getHarness: vi.fn(), | ||
| getHomeDir: () => '/home/cyijun/.kimi-code', |
There was a problem hiding this comment.
Replace the internal home path fixture
The root AGENTS.md guideline says public text and test data should use neutral placeholders instead of real internal identifiers; this new test fixture bakes in /home/cyijun, exposing a real-looking user identifier and encouraging it to be copied into more expectations. Use a neutral path such as /home/example/.kimi-code or a generated temp path instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 15f6761. Replaced all /home/cyijun/.kimi-code fixtures in plugins.test.ts with the neutral placeholder /home/example/.kimi-code, matching the AGENTS.md public-text guideline.
Related Issue
Resolve #1399
Problem
Currently, plugin management in Kimi Code CLI is only available through the interactive TUI via
/plugins. There is no non-interactive way to install, enable, disable, list, or remove plugins from shell scripts, CI pipelines, or when the user prefers not to open the TUI.What changed
kimi pluginstop-level CLI subcommand with the following actions:list,info,install,remove,enable,disablefor installed pluginsmarketplaceto browse the default marketplace and any custom registriesregistry list/add/removeto manage custom marketplace registriesKimiHarness:listPlugins,installPlugin,setPluginEnabled,removePlugin,getPluginInfoplugin-registries.jsonpersistence utility and merged marketplace loader so custom registries are combined with the default catalog@moonshot-ai/kimi-codeand@moonshot-ai/kimi-code-sdkChecklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.