Skip to content

feat(cli): add /desktop slash command and kimi install-app subcommand - #3849

Merged
wbxl2000 merged 3 commits into
mainfrom
qer/install-desktop-cmd
Sep 16, 2026
Merged

wbxl2000 merged 3 commits into
mainfrom
qer/install-desktop-cmd

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

Internal request (no linked issue).

Problem

CLI / TUI users have no quick way to discover and install the Kimi Code desktop app — they have to find the download page themselves.

What changed

Both entry points print the desktop app page (https://www.kimi.com/code) and open it in the default browser:

  • New kimi install-app subcommand for the shell (prints the URL, then opens it via the existing cross-platform openUrl helper).
  • New /desktop slash command in the TUI (alias /install-desktop), shown as a status message and opened the same way; registered as always-available.
  • The URL lives in one shared constant (DESKTOP_WEBSITE_URL) used by both surfaces.
  • Tests: action-level tests for the subcommand and the slash-command handler, plus the existing registry / visible-subcommand list assertions updated.
  • Docs: kimi install-app section in the kimi command reference and a /desktop row in the slash-command table, en + zh mirrors kept in sync.

Changeset included: @moonshot-ai/kimi-code major, per explicit approval for the next major release.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (internal request; external-PR rule not applicable).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill — changeset included (major, explicitly approved).
  • Ran gen-docs skill — reference pages updated in both locales.

Both entry points print the Kimi Code desktop app page
(https://www.kimi.com/code) and open it in the default browser:
the kimi install-app subcommand from the shell, and /desktop
(alias /install-desktop) from the TUI.
@changeset-bot

changeset-bot Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c0b86d1

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

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Major

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@c0b86d1
npx https://pkg.pr.new/@moonshot-ai/kimi-code@c0b86d1

commit: c0b86d1

@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: ff2dac6ca2

ℹ️ 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/constant/app.ts Outdated
export const PRODUCT_NAME = 'Kimi Code';
export const CLI_COMMAND_NAME = 'kimi';
export const PROCESS_NAME = 'kimi-code';
export const DESKTOP_WEBSITE_URL = 'https://www.kimi.com/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 Derive the desktop URL from the active region

When the CLI is configured for the supported global region, this hardcoded .com URL sends users to the mainland site instead of the .ai site declared by KIMI_REGION_PROFILES. Both new entry points therefore open the wrong storefront for global users; use the existing region-aware kimiCodeOfficialInstallUrl() (or otherwise derive /code from currentKimiProfile().siteBase) at invocation time so region changes are also respected.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in b05ccc2: dropped the hardcoded constant entirely; both entry points now resolve the existing region-aware kimiCodeOfficialInstallUrl() (currentKimiProfile().siteBase + /code) at invocation time, so global-region users land on the .ai site and post-login region refreshes are respected. Tests now pin a stub region profile and assert the derived URL end to end.

Replace the hardcoded .com URL with the existing region-aware
kimiCodeOfficialInstallUrl() resolved at invocation time, so
global-region users land on the .ai site and region changes are
respected.

@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: b05ccc23d5

ℹ️ 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 docs/en/reference/kimi-command.md Outdated

### `kimi install-app`

Print the Kimi Code desktop app page (`https://www.kimi.com/code`) and open it in the default browser, so you can download and install the desktop app without leaving the terminal.

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 Document the region-specific desktop URL

When the active region is global, kimiCodeOfficialInstallUrl() opens https://www.kimi.ai/code, but this new section—and the corresponding slash-command rows in both locales—states that the command opens https://www.kimi.com/code. This leaves global users with documentation that contradicts the corrected runtime behavior and directs anyone copying the documented URL to the mainland storefront; describe the URL as region-dependent or list both regional URLs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in c0b86d1: the kimi-command section and the slash-command rows in both locales now describe the URL as region-dependent (https://www.kimi.com/code on the mainland region, https://www.kimi.ai/code on the global region), matching the runtime behavior of kimiCodeOfficialInstallUrl().

@wbxl2000
wbxl2000 merged commit 34ec5d2 into main Sep 16, 2026
15 checks passed
@wbxl2000
wbxl2000 deleted the qer/install-desktop-cmd branch September 16, 2026 12:53
@github-actions github-actions Bot mentioned this pull request Sep 16, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Oct 5, 2026
Step 6 of the incremental sync to 2.1.1: 29 upstream commits over 370
files. 35 conflicts, concentrated in the TUI layer where the fork's
i18n and pi-tui work sits on top of upstream's message components.

Upstream's changes in this step, all absorbed:
- mermaid code blocks render as terminal diagrams, with a new
  `MermaidRenderMode` preference and a settings entry (MoonshotAI#3851)
- Windows CLI binaries are signed with Azure Artifact Signing (MoonshotAI#3858)
- MCP servers flip to needs-auth when a tool call returns 401, and the
  rejected grant's tokens are invalidated (MoonshotAI#3846)
- the `/desktop` slash command and the `install-app` subcommand (MoonshotAI#3849)
- skill scopes: `SkillScope` joins the catalog types and custom-theme
  becomes tui-only (MoonshotAI#3843)
- Windows 8.3 short paths are watched through their long form (MoonshotAI#3840)
- images upload as file references for Kimi models (MoonshotAI#3784)
- `/usage` and `/status` no longer prompt for login before the first
  message (MoonshotAI#3818)
- completed subagent scopes are evicted behind an LRU cache (MoonshotAI#3778)
- the human layer's request/recovery stage names were aligned (MoonshotAI#3766)
  and its names clarified (MoonshotAI#3727)
- WebBridge's display name became "Kimi Browser Extension" (MoonshotAI#3803)
- diff code blocks are highlighted (MoonshotAI#3802)
- feedback surveys are gated by the resolved kfc model id (MoonshotAI#3795)

Fork behaviour that had to survive:
- the i18n layer: every new upstream string went through `t()` with
  en/zh locale entries (mermaid preference, WebBridge intro, usage
  panel), and the fork's locale JSONs were regenerated
- the pi-tui intent cards and the fork's local Markdown component, kept
  over upstream's pi-tui Markdown import in the message components
- the 128 KiB `max_completion_tokens` cap on the kimi trait
- the fork's media tool folding (read-media-file) and the
  `isMediaUploadAuthError` rename carried through
- the Bun toolchain: flake.nix keeps `impureEnvVars`, the native build
  workflow keeps the Bun steps while taking upstream's Azure signing
  env block, and 05-verify.mjs verifies the checksum before the
  Authenticode branch
- proactiveMediaEviction in the LLM requester, after upstream's warning
  dispatch
- the fork's stricter `isUnauthorizedLikeError` (no message-regex
  fallback) and its OAuth token transaction

This merge also fixes a fork bug the new upstream tests exposed: the
TUI's background-task handler had been switched to the v2 `task.*`
event spelling during the v1→v2 migration, but the SDK's event mapper
translates those back to `background.task.*` before delivery (the
fork's own `notify.ts` already listened for the translated names), so
the handler had been dead code at runtime. The handler and the three
test fixtures that fed it now use `background.task.*` again.

Test expectations re-pinned where the fork's shape differs from
upstream's:
- `assistant-message.test.ts` reads the local Markdown's `sourceText`
  instead of pi-tui's `text`
- the new `markdown.test.ts` calls `setPalette(palette, family)`, the
  fork's two-argument signature
- `choice-picker.test.ts` asserts the mermaid entry, because the fork's
  longer settings list pushes `upgrade` past the 8-row page
- "invalidates stored OAuth tokens when a runtime 401 fails the
  refresh": the fork's token transaction removes the revoked tokens
  while the refresh fails, and the transport closes before the caller
  can flip the entry into needs-auth, so the server ends up failed
  rather than needs-auth. The security-relevant half (stale tokens are
  gone) still holds; the status difference is a known gap to revisit.

Verified: typecheck clean across every package and app; full suite
17594 passed / 81 skipped / 1 todo. The four failures under parallel
load (rpc-events ×2, taskManager ×2) pass in isolation — load-induced
flakes, not regressions.
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.

1 participant