Skip to main content

Local-first AI coding agent for the terminal

Project description

Kolega Code

An AI coding agent that runs in your terminal — local-first, model-agnostic, plan-then-build.

PyPI version Python versions License: MIT CI Coverage Docs Changelog

Point Kolega Code at a project directory and it opens an interactive UI where you talk to an agent that can read and edit your code, run shell commands, search the codebase, browse the web, and dispatch specialized sub-agents to get work done.

It's local-first: the agent operates on your actual filesystem and terminal, and your sessions, settings, and API keys stay on your own machine.

Kolega Code in action

Why Kolega Code

  • Plans before it builds. A read-only Plan mode produces a reviewable plan and a shared task list before anything changes; Build mode implements it. Toggle with Shift+Tab.
  • Orchestrates many agents. For larger jobs, the main agent dispatches specialized sub-agents (investigation, browser, coding, general) and can fan them out in parallel for broad audits, large migrations, or implementing a plan's independent parts at once.
  • Local-first by design. It works on your real files and terminal; sessions, settings, and credentials live on your machine, not in someone else's cloud.
  • Bring your own model. Talks to a range of providers and lets you assign different models to different roles.

What it does

  • Reads and edits your code. Opens files, searches across the codebase, creates new files, and applies precise edits.
  • Runs commands. Executes shell commands and watches their output in a dedicated terminal view.
  • Plans before it builds. Plan mode investigates and proposes; Build mode executes.
  • Searches and browses the web. The agent can search for relevant pages, fetch URLs directly, or use the built-in browser agent (powered by Playwright) when a task needs site interaction.
  • Dispatches sub-agents. Hands work off to specialized agents and tracks their activity live.
  • Orchestrates workflows. With gigacode, it fans out many sub-agents in parallel.
  • Works non-interactively too. Run a single prompt with kolega-code ask, get JSON output, and save or resume sessions.

Quick start

1. Install with the script:

curl -fsSL https://kolega.dev/install-kolega-code.sh | sh

Or with uv (or pip):

uv tool install kolega-code
# or: pip install kolega-code

Verify the install:

kolega-code --version

2. Start a session in your project:

kolega-code .

3. Add a provider key. Open the Settings tab to pick a provider and model and save your API key. Then press Shift+Tab anytime to switch between Plan and Build mode.

Resume a previous conversation:

kolega-code . --resume            # latest session
kolega-code . --resume <id>       # a specific thread or session

Two ways to use it

Mode Command Best for
Interactive TUI kolega-code . Day-to-day development, exploration, pair-programming
One-shot kolega-code ask "…" Scripting, automation, quick questions, CI

There are also helper commands for managing sessions and checking your setup:

kolega-code ask "summarize this repository" --project .
kolega-code sessions list --project .
kolega-code doctor --project .

Bring your own model

Kolega Code talks to a range of LLM providers — including Anthropic, OpenAI, Google, Moonshot, and DeepSeek — and lets you assign different models to different roles: a strong long-context model for coding, a fast cheap model for small utility calls, and one for extended "thinking". See Providers & Models.

Sign in with ChatGPT

If you have a paid ChatGPT plan (Plus, Pro, or Business), you can use it to run OpenAI models instead of a separate API key. Run /login chatgpt in the TUI, complete the browser sign-in, and Kolega Code switches to the OpenAI (ChatGPT subscription) provider (default gpt-5.5). Tokens are stored locally (chmod 600) and refreshed automatically; /logout chatgpt removes them. See Sign in with ChatGPT.

Configuration

Set your provider, model, and API keys from the Settings tab in the UI, or via environment variables and flags for non-interactive use:

export KOLEGA_CODE_PROVIDER=deepseek
export DEEPSEEK_API_KEY=...
kolega-code ask "summarize this repository" --project . --provider deepseek --model deepseek-v4-pro

API key variables only provide credentials — pick a provider/model explicitly or save one in Settings. Local session state lives under your platform's state directory unless KOLEGA_CODE_STATE_DIR is set. See the Configuration docs for the full story.

The web_search tool uses DuckDuckGo by default without a key. To choose another backend, set it in Settings or export KOLEGA_CODE_WEB_SEARCH_BACKEND as firecrawl, tavily, or searxng; use FIRECRAWL_API_KEY, TAVILY_API_KEY, or SEARXNG_BASE_URL as needed.

Requirements

  • Python 3.11+
  • An API key for at least one supported provider
  • A terminal that supports a modern TUI (most do)

Documentation

Full documentation lives at kolega-ai.github.io/kolega-code:

Project resources

Contributing

Contributions are welcome. See CONTRIBUTING.md for local setup, running the test suite, and building the docs site. Please report security issues privately per SECURITY.md.

License

Released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kolega_code-0.9.0.tar.gz (9.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kolega_code-0.9.0-py3-none-any.whl (435.6 kB view details)

Uploaded Python 3

File details

Details for the file kolega_code-0.9.0.tar.gz.

File metadata

  • Download URL: kolega_code-0.9.0.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kolega_code-0.9.0.tar.gz
Algorithm Hash digest
SHA256 f1d2c41ecb580aaecee17042e01e20f9556a74ff6a5d86b875f5e86b64b92a43
MD5 587f24d7f3a399fc53d4443b9e6d92d5
BLAKE2b-256 408c8d9d746cf4ca13f7d60371918ee1230ddaee067832193d6f4cbbf6c04901

See more details on using hashes here.

Provenance

The following attestation bundles were made for kolega_code-0.9.0.tar.gz:

Publisher: release.yml on kolega-ai/kolega-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kolega_code-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: kolega_code-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 435.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kolega_code-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05d27cb238188ed8f705007cf3bda753a4a59dad011f36fb799b9142a0d9b36a
MD5 f7be42f5b4f63eee35183abc9f2b89f2
BLAKE2b-256 40b965daa467f6c4b267128e8091435365a69f49e4cd646387fbe736fdc9b8e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for kolega_code-0.9.0-py3-none-any.whl:

Publisher: release.yml on kolega-ai/kolega-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page