Skip to content

feat(kimi-code): add non-interactive kimi plugins command#1398

Open
cyijun wants to merge 17 commits into
MoonshotAI:mainfrom
cyijun:feat/kimi-plugins-cli
Open

feat(kimi-code): add non-interactive kimi plugins command#1398
cyijun wants to merge 17 commits into
MoonshotAI:mainfrom
cyijun:feat/kimi-plugins-cli

Conversation

@cyijun

@cyijun cyijun commented Jul 5, 2026

Copy link
Copy Markdown

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

  • Added the kimi plugins top-level CLI subcommand with the following actions:
    • list, info, install, remove, enable, disable for installed plugins
    • marketplace to browse the default marketplace and any custom registries
    • registry list/add/remove to manage custom marketplace registries
  • Exposed plugin management SDK methods on KimiHarness: listPlugins, installPlugin, setPluginEnabled, removePlugin, getPluginInfo
  • Added a plugin-registries.json persistence utility and merged marketplace loader so custom registries are combined with the default catalog
  • Wired telemetry initialization/shutdown lifecycle into the plugins command handlers
  • Added changesets for both @moonshot-ai/kimi-code and @moonshot-ai/kimi-code-sdk
  • Updated user documentation in both English and Chinese

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15f6761

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@moonshot-ai/kimi-code Minor
@moonshot-ai/kimi-code-sdk Minor
@moonshot-ai/acp-adapter Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread apps/kimi-code/src/utils/plugin-marketplace.ts Outdated
Comment thread apps/kimi-code/src/cli/sub/plugins.ts Outdated
@cyijun

cyijun commented Jul 5, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread apps/kimi-code/src/utils/plugin-registries.ts
@cyijun

cyijun commented Jul 5, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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;

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 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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.

Feature Request: Add non-interactive kimi plugins CLI command for plugin management

1 participant