Skip to content

feat: Moonshot Kimi Code CLI (K3), optional, with phone notifications - #16

Merged
oz6un merged 1 commit into
mainfrom
feat/kimi-code-cli
Aug 20, 2026
Merged

feat: Moonshot Kimi Code CLI (K3), optional, with phone notifications#16
oz6un merged 1 commit into
mainfrom
feat/kimi-code-cli

Conversation

@oz6un

@oz6un oz6un commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Adds an opt-in INSTALL_KIMI=1 that 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 on Stop (turn hand-back,
    the genuine "over to you" — Kimi has no idle/needs-input event, and Stop fires
    once per hand-back, confirmed by capturing a real payload) and StopFailure.
    Backgrounds the curl (setsid) because Kimi's [[hooks]] has no async flag.
  • files/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 the 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.
  • files/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% during this work; no health alerting since Remove hourly health-check push notifications #13).

Auth (headless-friendly)

kimi login uses the RFC 8628 device-code flow — prints a URL + code you approve
in any browser, no localhost callback, no port-forwarding.

Verified

  • Install + kimi login (device flow) + a real Stop hook → Pushover status:1.
  • make setup converges idempotently (install skipped, notifier re-rendered, hooks not duplicated, default_model intact).
  • make check green (shellcheck + bash -n + residue).

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>
@oz6un
oz6un merged commit 12d5335 into main Aug 20, 2026
1 check passed
@oz6un
oz6un deleted the feat/kimi-code-cli branch August 20, 2026 15:29
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