Kode is an open-source AI coding agent for the terminal, powered by Sarvam AI's free sarvam-m model.
Kode officially targets WSL, Linux, and macOS. Native Windows PowerShell or cmd.exe is not currently supported.
- Free LLM: Powered by Sarvam AI's
sarvam-mmodel - completely free for developers - Open Source: Built transparently with TypeScript, no black boxes
- Indian-Made: Sarvam AI is an Indian company building world-class AI models
- Terminal-First: Clean, minimal CLI interface that stays out of your way
- Trustworthy: Always shows diffs before modifying files, git snapshots for undo
npm install -g kode-aiOr build from source:
git clone https://github.com/askpext/kode.git
cd kode
pnpm install
pnpm build-
Get your free API key from Sarvam AI
-
Set the environment variable or configure in
kode.json:export SARVAM_API_KEY=your-api-key -
Run Kode:
kode
Kode is an interactive terminal UI application. Run it directly in your terminal:
cd kode
node dist/cli.jsOnce inside Kode, you can:
- Type natural language requests to understand code, write features, or fix bugs
- Use slash commands for session management
| Command | Description |
|---|---|
/help |
Show all commands |
/new |
Start a new session |
/sessions |
List recent sessions |
/resume <id> |
Resume a specific session |
/undo |
Restore last git snapshot |
/clear |
Clear the screen |
/model |
Open interactive model switcher (sarvam-30b, 105b, etc.) |
/cost |
Show token usage |
Kode has access to these tools via prompt-based calling:
read_file- Read file contents (smart chunking for large files)write_file- Write files (always shows diff first)edit_file/replace_multi- Targeted and multi-block text replacementbash- Run shell commands synchronouslybash_background/bash_status- Spawn and manage long-running dev serversgrep- Search codebase with ripgrepfetch_url- Native web fetching (HTML to Markdown)list_dir- List directory contentstodo_write/todo_read- Planning and task tracking
Create a kode.json in your project root:
{
"provider": {
"apiKey": "your-sarvam-api-key",
"baseUrl": "https://api.sarvam.ai/v1",
"model": "sarvam-m"
},
"permission": {
"bash": "ask",
"write": "ask",
"edit": "ask"
},
"context": {
"maxTokens": 28000,
"compressAt": 0.80
}
}Permission options: ask, allow, deny
Kode automatically reads AGENTS.md or CLAUDE.md from your project root and appends it to the system prompt. Use this file to document:
- Project structure
- Coding conventions
- Architecture decisions
- Testing requirements
- Native Web Browsing - Can fetch documentation and issues directly from URLs
- Background Processes - Run watch servers and test runners asynchronously
- Interactive Model Switcher - Hot-swap between Sarvam models dynamically via TUI
- Never silently modifies files - Always shows colored diffs before writing
- Smart large file handling - Chunks files over 8000 tokens, never crashes
- Git snapshots - Takes a snapshot before every write for instant undo
- Context compression - Automatically summarizes at 80% of 32k token limit
- Runtime: Node.js + TypeScript
- Terminal UI: Ink v5 (React for CLIs)
- LLM: Sarvam AI (
sarvam-mmodel) - uses prompt-based tool calling - Storage: sql.js (SQLite in pure JavaScript)
- Shell: execa
- Config: cosmiconfig
MIT License - See LICENSE for details.
Visit https://sarvam.ai to get your free API key.
Built with ❤️ for developers