feat: add Kimi Code CLI support#190
Open
classicrob wants to merge 1 commit into
Open
Conversation
Add support for Kimi CLI (https://github.com/MoonshotAI/kimi-cli) as a new engine backend, similar to the existing Claude Code and Codex integrations. New files: - src/takopi/schemas/kimi.py: msgspec models for Kimi's stream-json output - src/takopi/runners/kimi.py: KimiRunner implementation - tests/test_kimi_schema.py: schema parsing tests - tests/test_kimi_runner.py: runner and translation tests - tests/fixtures/kimi_stream_json_session.jsonl: test fixture Features: - Session resumption via --session flag - Model selection via config - Extra CLI args support - Tool call translation (Shell, Write, Read, etc.) Configuration example: ```toml default_engine = "kimi" [kimi] model = "kimi-k2" extra_args = ["--thinking"] ``` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Hey also if there's any way I can contribute PRs more effectively, lmk. This felt like a fairly straightforward one, I just added Kimi cli support personally bc I love the model and wanted to explore its parallel subagent capabilities and thought other people might also want it. |
Contributor
|
@classicrob heya, I think you can create a transport plugin instead called takopi-kimi for example and then open a pr to add it to the plugins list on the docs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
New files:
src/takopi/schemas/kimi.py- msgspec models for Kimi'sstream-jsonoutput formatsrc/takopi/runners/kimi.py-KimiRunnerimplementation with full event translationtests/test_kimi_schema.py- Schema parsing tests (6 tests)tests/test_kimi_runner.py- Runner and translation tests (14 tests)tests/fixtures/kimi_stream_json_session.jsonl- Test fixtureModified:
pyproject.toml- Added entry point for kimi backendConfiguration
Key Implementation Details
--resume <id>--session <id>system.init,resulteventsassistant,tool,user)message.contentarraytool_callsarray with JSONargumentsTest plan
🤖 Generated with Claude Code