An open-source on-device coding agent that runs entirely in your terminal.

- AI-powered coding assistant — automated code writing, editing, and research
- Dual modes:
PLAN(read-only analysis) andBUILD(full read/write/execute) - Multi-step tool agent — uses
ToolLoopAgentto autonomously read, write, edit files and run commands until the task is done (up to 25 steps) - Multiple LLM providers: OpenAI, Anthropic (Claude), Google Gemini, OpenRouter, Groq, Mistral
- 7 local tools:
readFile,listDirectory,glob,grep,writeFile,editFile,bash— all sandboxed to your project directory - Persistent sessions — conversation history stored locally via SQLite (Drizzle ORM)
- 31 themes — Nightfox, Catppuccin, Dracula, Tokyo Night, Nord, and many more
- Terminal UI — built with OpenTUI with mouse support, scrollable messages, dialogs, and toast notifications
- Theme persistence — saved to
~/.border-code/preferences.json - Command palette —
Shift+Tabto open quick actions
- Remote control — manage Border Code from your phone or tablet via a web API
- Web session — expose the agent interface as a web app for browser-based use
- Bun 1.x or later
# Clone and install
git clone https://github.com/r2hu1/border-code
cd border-code
bun install
# Run the CLI
bun run dev:cli- Open the command palette (
Shift+Tab) - Select LLM Providers
- Choose a provider (e.g. OpenAI, Anthropic)
- Enter your API key
- Choose a model
| Key | Action |
|---|---|
Tab |
Toggle mode (PLAN / BUILD) |
Shift+Tab |
Open command palette |
Enter |
Submit prompt |
Shift+Enter |
New line |
/ (at start) |
Open command palette |
Esc |
Close dialog / interrupt |
| Mouse | Click items, scroll messages |
PLAN — the agent can only read files and search the codebase. Use this to ask questions, review code, or plan changes.
BUILD — the agent gets full read/write/execute access. It can edit files, create new ones, and run shell commands.
border-code/
├── packages/
│ ├── cli/ # Terminal UI app (OpenTUI + React)
│ ├── core/api/ # Core engine (AI, DB, config, tools)
│ └── shared/ # Shared types and schemas
├── local.db # SQLite database (gitignored)
└── assets/ # Screenshots
Browse and select themes via the command palette. All 31 themes are defined in packages/cli/src/themes/presets.ts and include: Nightfox (default), Catppuccin Mocha, Dracula, Monokai Pro, Tokyo Night, Nord, Synthwave, One Dark, Gruvbox Dark, Rose Pine, Kanagawa, GitHub Dark, and more.
bun run dev:cli # Run in watch mode with hot-reload
bun run format # Format code with Biome
bun run lint # Lint code with Biome
bun run db:generate # Generate Drizzle migrations
bun run db:migrate # Apply migrations
bun run db:push # Push schema changesContributions are welcome! Open an issue or submit a pull request.
- Code is formatted with Biome (tabs, double quotes).
- The codebase uses TypeScript throughout.
- UI components use OpenTUI's React JSX (import
@opentui/react).
MIT