feat: Moonshot Kimi Code CLI (K3), optional, with phone notifications - #16
Merged
Conversation
Adds an opt-in INSTALL_KIMI=1 that installs Moonshot's Kimi Code CLI alongside Claude Code and Codex, wired to the same presence-aware Pushover pipe — mirroring the Codex work (#14). - files/kimi-notify.tmpl: Pushover hook. Fires on Stop (turn hand-back — the genuine "over to you"; Kimi has no idle event and Stop fires once per hand-back, confirmed from a captured payload) and StopFailure. Backgrounds the curl (setsid) because Kimi's [[hooks]] has no async flag. - remote-setup.sh: installs from the GLOBAL mirror (code.kimi.ai => region "global"; .com is mainland-CN and mis-targets login) with KIMI_NO_MODIFY_PATH=1, then injects Stop/StopFailure [[hooks]] into ~/.kimi-code/config.toml idempotently (appends — never overwrites, which would drop default_model/providers). config.toml is written by `kimi login`, so injection is post-auth; re-run `make setup` after login. - config.fish owns the ~/.kimi-code/bin PATH entry (added only when present). - setup-user.sh renders the notifier; secrets.env.example gains INSTALL_KIMI. - README + FOOTGUNS: device-code `kimi login`, the region trap, config.toml ownership, and a disk-full note (the box hit 100%, no health alerting). Verified live: install + `kimi login` (device flow) + a real Stop hook → Pushover status:1, and `make setup` converges idempotently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds an opt-in
INSTALL_KIMI=1that installs Moonshot's Kimi Code CLI (K3)alongside Claude Code and Codex, wired to the same presence-aware Pushover pipe —
mirroring the Codex notification work in #14.
What
files/kimi-notify.tmpl— Pushover hook. Fires onStop(turn hand-back,the genuine "over to you" — Kimi has no idle/needs-input event, and
Stopfiresonce per hand-back, confirmed by capturing a real payload) and
StopFailure.Backgrounds the curl (
setsid) because Kimi's[[hooks]]has noasyncflag.files/remote-setup.sh— installs from the global mirror(
code.kimi.ai→ regionglobal;.comis mainland-CN and mis-targets login)with
KIMI_NO_MODIFY_PATH=1, then injects theStop/StopFailure[[hooks]]into
~/.kimi-code/config.tomlidempotently (appends — never overwrites,which would drop
default_model/providers).config.tomlis written bykimi login, so injection is post-auth; re-runmake setupafter login.files/config.fish— owns the~/.kimi-code/binPATH entry (added only when present).setup-user.shrenders the notifier;secrets.env.examplegainsINSTALL_KIMI.kimi login, the region trap,config.tomlownership, and a disk-full note (the box hit 100% during this work; no health alerting since Remove hourly health-check push notifications #13).
Auth (headless-friendly)
kimi loginuses the RFC 8628 device-code flow — prints a URL + code you approvein any browser, no localhost callback, no port-forwarding.
Verified
kimi login(device flow) + a realStophook → Pushover status:1.make setupconverges idempotently (install skipped, notifier re-rendered, hooks not duplicated,default_modelintact).make checkgreen (shellcheck +bash -n+ residue).