Skip to content

ltianyi992/K-Kode

Repository files navigation

K kode

K kode (kkode) is a Windows-first terminal coding agent inspired by Claude Code and backed by Moonshot Kimi.

Status: 0.1.0-alpha.1

This is an early alpha. The core loop is usable, but the product is still being actively refined.

Project Links

What It Can Do

  • chat in the terminal about the current project
  • read files and search the workspace
  • create and edit files with approval
  • run PowerShell commands with approval
  • persist local sessions and resume them later
  • show tool activity, thinking state, and approval prompts in a Claude Code-inspired terminal flow

Current Scope

  • Windows-first
  • PowerShell-first
  • Moonshot Kimi first
  • local sessions only
  • no MCP, memory, or plugin ecosystem yet

Requirements

  • Node.js 20+
  • a Moonshot API key in MOONSHOT_API_KEY

Quick Start

Clone the repo and run the built CLI directly:

git clone https://github.com/ltianyi992/K-Kode.git
cd K-Kode
$env:MOONSHOT_API_KEY="your-key"
node .\dist\cli.js

Because the compiled dist/ output is committed, end users do not need to build the project just to try the alpha.

Install As kkode

To make kkode available as a command from your terminal:

cd K-Kode
.\scripts\install-local.ps1

This installer rewrites the global Windows launchers so PowerShell users can type kkode directly without changing execution policy.

Or run the underlying command yourself:

npm.cmd link

After linking:

$env:MOONSHOT_API_KEY="your-key"
kkode

Compatibility alias:

kk

Development

Install dependencies:

npm.cmd install

Type-check:

npm.cmd run check

Build:

npm.cmd run build

Run from source:

npm.cmd run dev

Run the built CLI:

npm.cmd run start

Common Commands

CLI flags:

  • --continue
  • --list-sessions
  • --resume <session-id>
  • --resume-latest
  • --prompt <text>
  • --plain-output
  • --version

Interactive slash commands:

  • /help
  • /session
  • /sessions
  • /read <path>
  • /search <text>
  • /replace <path> <old> => <new>
  • /run <command>
  • /exit

Environment Variables

Required:

  • MOONSHOT_API_KEY

Optional:

  • KK_PROVIDER
  • KK_MODEL
  • KK_API_BASE_URL
  • KK_SYSTEM_PROMPT
  • KK_SESSION_DIR
  • KK_SHELL
  • KK_AUTO_APPROVE

Notes

  • KK_PROVIDER=mock lets you test the local loop without calling Moonshot.
  • KK_AUTO_APPROVE=1 skips permission prompts for development-only runs.
  • The current provider uses Moonshot's OpenAI-compatible /v1 API.
  • The default model is kimi-k2.5.
  • Approval prompts support keyboard navigation in a real TTY.
  • Tool output is partially collapsed to keep the terminal readable.

Architecture

See docs/ARCHITECTURE.md.

About

Kimi backed version of claude code

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors