MoonshotAI / MoonshotAI/kimi-cli
[Feature Request] Add /copy command to copy the current assistant response
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
Problem
Currently, there is no built-in way to copy the current assistant response from a Kimi Code CLI session. Users who want to save a single insightful answer, a code block, or a decision explanation must manually select text from their terminal, which is error-prone and loses formatting.
Proposed Solution
Add a new slash command that copies the current assistant message to the system clipboard:
/copy
This should behave similarly to Claude Code's message copy action — copying only the most recent AI response, not the entire conversation history.
Expected Behavior
/copy: Copies the current assistant response (the latest AI message in the active turn) to the system clipboard in Markdown format.- Code blocks, reasoning steps, and formatting should be preserved.
- It should not include previous user messages or earlier turns.
- Full conversation history export is a separate concern and can be addressed by a potential future
/exportcommand.
Use Cases
- Save a code snippet: Quickly copy a generated function or fix to paste into an editor.
- Document a decision: Copy the agent's reasoning for a specific choice.
- Share an explanation: Forward a concise answer to a colleague without including the full back-and-forth.
- Prompt iteration: Reuse a well-written response as a template.
Alternatives Considered
- Manually selecting text in the terminal: breaks formatting and is hard for long responses.
- Terminal buffer copy-paste: includes surrounding UI noise (timestamps, prompts, etc.).
Additional Context
This is a small but high-impact quality-of-life feature that makes the terminal agent feel more polished for daily workflows. Thank you for considering this request!
中文版
问题
目前 Kimi Code CLI 没有内置方式一键复制当前 AI 回复。用户若想保存某一条有价值的回答、代码片段或决策说明,只能在终端里手动选中文本复制,既容易出错又会丢失格式。
建议方案
新增一个 slash 命令,将当前助手消息复制到系统剪贴板:
/copy
行为上建议参考 Claude Code 的复制当前消息功能:仅复制最新一条 AI 回复,不包含完整对话历史。
预期行为
/copy:将当前助手回复(活跃轮次中的最新 AI 消息)以 Markdown 格式复制到剪贴板。- 保留代码块、推理过程和原始格式。
- 不包含之前的用户消息或更早轮次的内容。
- 完整对话历史导出是另一个独立需求,可通过未来的
/export命令实现。
使用场景
- 保存代码片段:快速复制生成的函数或修复方案,粘贴到编辑器中。
- 记录决策依据:复制 Agent 对某个选择的推理过程。
- 分享 concise 答案:把一条清晰的解释转发给同事,无需带上完整来回对话。
- Prompt 复用:将写得好的回答作为模板复用。
已考虑的替代方案
- 手动在终端里选中复制:容易破坏格式,且长回复很难操作。
- 终端缓冲区复制:会带上周围的 UI 干扰(时间戳、提示符等)。
补充说明
这是一个小而高频的易用性改进,能让终端 Agent 在日常工作流中更顺手。感谢团队考虑这个需求!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the existing slash-command handling and how the active assistant response is stored, then identify the project's clipboard integration point. Done means /copy preserves the latest response's Markdown and formatting without including earlier turns; verify this through the CLI with code blocks and multiple messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100