Skip to content

feat(cli): make kimi web and rotate-token access URLs clickable#2132

Open
bowenliang123 wants to merge 1 commit into
MoonshotAI:mainfrom
bowenliang123:feat/clickable-kimi-web-urls
Open

feat(cli): make kimi web and rotate-token access URLs clickable#2132
bowenliang123 wants to merge 1 commit into
MoonshotAI:mainfrom
bowenliang123:feat/clickable-kimi-web-urls

Conversation

@bowenliang123

@bowenliang123 bowenliang123 commented Jul 24, 2026

Copy link
Copy Markdown

Related Issue

No linked issue.

Problem

When running kimi web or kimi web rotate-token, the printed Local/Network access URLs contain the bearer-token fragment but are plain text. Users have to manually select and copy the URL into a browser; in supported terminals there is no click-to-open affordance.

What changed

Wrap the access URLs in OSC 8 terminal hyperlinks using the existing toTerminalHyperlink utility, so terminals that support the sequence (iTerm2, VS Code terminal, Windows Terminal, etc.) render the URL as clickable. The hyperlink target is the full URL including the #token= fragment, so clicking opens the authenticated Web UI directly.

  • apps/kimi-code/src/cli/sub/web/run.ts: ready banner and one-line ready output now emit hyperlinks.
  • apps/kimi-code/src/cli/sub/web/rotate-token.ts: re-printed access links after rotation also emit hyperlinks.
  • apps/kimi-code/test/cli/web/web.test.ts: updated the stripAnsi helper to strip OSC 8 escape sequences so plain-text assertions keep passing.

Before

  Local:    http://127.0.0.1:58627/#token=abc123
  Network:  http://192.168.1.5:58627/#token=abc123

The URL is plain text; the user must select and copy it into a browser.

After

In supported terminals the same line is now an OSC 8 hyperlinks (clickable to open links in browser) :

  Local:    http://127.0.0.1:58627/#token=abc123
  Network:  http://192.168.1.5:58627/#token=abc123

⌘/Ctrl-clicking the link opens the authenticated Web UI directly. The visible text and token handling are unchanged; only the underlying escape sequence is added.

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 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ed0ce07

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

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