MoonshotAI / MoonshotAI/kimi-code
feat(cli): add --prompt-interactive to seed an initial prompt without leaving the interactive session
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Today kimi -p "..." runs once and exits; there is no way to hand Kimi an initial prompt while keeping the interactive session alive.
Motivation: agent-to-agent handoffs. Persistent multi-agent setups increasingly launch one agent CLI from another and keep it alive for ongoing interaction. Other agent CLIs support this directly — claude "prompt" and codex "prompt" accept an initial prompt and keep the REPL open, and opencode --prompt "..." seeds the TUI with an initial prompt on launch. Kimi is the outlier: an orchestrator must spawn kimi, watch the pane to detect that startup completed, and only then inject the first prompt as a second step. A single flag turns that dance into one command:
kimi --prompt-interactive "Summarize today's changes and wait for further instructions"
Proposal. Add -P / --prompt-interactive <text>: after startup completes, submit the value through the normal input pipeline and keep the session open. The value can be a plain prompt or a slash command (e.g. seeding a session with /init or a skill trigger). Behavior notes:
- mutually exclusive with
-p/--prompt; empty values rejected - composable with
--yolo,--plan,--continue, and--session <id> - no behavior change for existing invocations
Other use cases. Shell aliases that pre-seed a review prompt; IDE/editor integration that opens Kimi with the current file or selection as context; starting a session with a complex multi-line prompt without pasting it after launch.
Additional information
- I previously ported this to kimi-code as PR #23, which was closed pending prior discussion — hence this issue first.
- I have a working implementation of the above (including the engineV2 session-less startup path) and can open a PR promptly if the feature is accepted.
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
Start at the CLI option entry point and normal input pipeline, then trace the engineV2 session-less startup path. Compare existing -p/--prompt handling with the requested flag and its listed option combinations; done means the initial prompt or slash command is submitted after startup while the session remains open, without changing existing invocations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100