Local-first desktop AI coding workspace.
BetterCode runs on your machine, keeps workspace state local, routes tasks across coding runtimes, and gives you a desktop UI for editing, review, git workflows, generated files, and long-running CLI sessions.
python -m venv .venv
source .venv/bin/activate
pip install -e .Run:
bettercodeDevelopment mode:
bettercode --devTip
BetterCode is a desktop app. You need PyQt6 and PyQt6-WebEngine available in the active Python environment.
Desktop packaging plan:
pip install -e .[packaging]
bettercode-package --dry-run- Local desktop shell with a native app window
- Embedded local FastAPI server on
127.0.0.1 - Project-based chat history and workspace state in local SQLite
- Auto Model Select with a local selector model
- Support for local Codex, Claude, and Gemini CLIs
- In-app git actions, code review flow, and project run commands
- Generated file handling outside the repo when the task calls for artifacts like PDFs or CSVs
Desktop app (PyQt6)
|
v
Embedded web UI
|
v
Local FastAPI app
|
+--> Workspace state + chat history (SQLite)
+--> Auto Model Select / selector runtime
+--> Codex CLI
+--> Claude CLI
+--> Gemini CLI
BetterCode does not depend on a hosted BetterCode backend. The app runs locally and keeps its own state in ~/.bettercode unless you override BETTERCODE_HOME.
- Python
>=3.10 PyQt6PyQt6-WebEngine- One or more installed coding runtimes:
codexclaudegemini
- Ollama for Auto Model Select
BetterCode can pre-process a request locally and choose a runtime/model for the job.
By default it expects:
ollama serve
ollama pull qwen2.5-coder:1.5bIf you do not want automatic routing, you can still choose a model directly in the app.
- Multiple local projects
- Per-project chat history
- Saved context between turns
- Generated files attached to each project
- Streaming CLI passthrough while a runtime is working
- Model selection and selection reasoning
- Suggested replies
- Completion notifications when BetterCode is not the active window
- Review page with changed files and recent files
- Select files before running review
- Primary and optional secondary reviewer
- Findings can be pushed back into chat for implementation
- File selection
- Stage / unstage actions
- Commit and push from inside the app
BetterCode separates generated outputs from real project files.
- Real repo files stay in the project
- Generated outputs can be staged in
.bettercode-generated - BetterCode moves those outputs into:
~/.bettercode/generated-files/workspace-<id>/
- Generated files are visible per project in the sidebar
- Clicking a generated file opens it with the system default app
Environment variables:
BETTERCODE_HOMEBETTERCODE_DEVOLLAMA_HOSTBETTERCODE_SELECTOR_MODELBETTERCODE_SELECTOR_KEEP_ALIVEBETTERCODE_MAX_COST_TIERBETTERCODE_PROXY_API_BASEBETTERCODE_PROXY_TOKEN
- App state:
~/.bettercode/state.db - Generated files:
~/.bettercode/generated-files/ - API keys: stored through
keyring
Qt WebEngine may need:
sudo apt-get install libxcb-cursor0Make sure Ollama is installed, running, and has the selector model:
ollama serve
ollama pull qwen2.5-coder:1.5bMake sure the current Python environment includes:
pip install PyQt6 PyQt6-WebEngineThis repo is still moving fast and the UI is evolving quickly. If you want to work on it, start by reading the code in:
bettercode/web/api.pybettercode/web/static/app.jsbettercode/web/desktop.py
MIT