
A local-first terminal AI coding agent.
Plan, chat, and build inside your local project with a Bun-powered CLI, Hono API, SQLite database, OpenRouter integration, and AI SDK streaming.
Features
- Local-first - CLI, server, and database run entirely on your machine
- Plan & Build modes - Read-only analysis or full file editing and shell execution
- Multi-provider - OpenRouter, Anthropic, OpenAI, or Gemini keys
- Persistent sessions - Local SQLite database stores your conversation history
Install
One command, no dependencies — no Bun or Node runtime required at execution time:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/KONY05/koincode/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/KONY05/koincode/main/install.ps1 | iex
Or install via npm — this pulls down a prebuilt native binary for your platform (no Bun needed):
npm i -g koincode
Also works with other package managers (all resolve from the same npm registry):
bun i -g koincode
pnpm i -g koincode
yarn global add koincode
Or download a binary directly from GitHub Releases.
Getting Started
koincode --anthropic-key <your-key> # or --openai-key / --gemini-key / --openrouter-key
koincode # Start coding
Or run koincode and use /setup from the in-app command menu to add keys interactively.
Optional: Browser tools
Browser tools (automated testing via Playwright) are opt-in:
koincode --enable-browser-tools # Detects Chrome or prompts to download Chromium
koincode --disable-browser-tools
Or use /enable-browser-tools from the command menu inside a session.
Custom port
koincode --port 3000
The server defaults to port 37420 if not specified.
Updating
koincode --update
Works regardless of how koincode was installed (curl, npm, or a package manager) — it detects the install method and updates in place.
All flags
koincode --help
Prints the full list of flags (keys, port, browser tools, update, version).
Building from source
git clone https://github.com/KONY05/koincode.git
cd koincode
bun install
bun run dev:cli
To build and link the CLI globally:
bun run link:cli
koincode
To build standalone binaries:
cd packages/cli && COMPILE=true bash bin/build.sh
# Outputs: dist/koincode-darwin-arm64, dist/koincode-darwin-x64, dist/koincode-linux-x64
Server logs are available at ~/.koincode/server.log.
bun run typecheck
bun run lint