Try Bifrost Enterprise free for 14 days. Request access

9 Best Open Source AI Coding Agents

Open source AI coding agents publish the agent's own code under licenses such as MIT or Apache 2.0. This guide ranks nine of them, including OpenCode, Codex CLI, Cline, and Kilo Code, and shows how one Bifrost gateway governs model access, spend, and tool calls for all of them.

9 Best Open Source AI Coding Agents

TL;DR

  • OpenCode (MIT) and Codex CLI (Apache 2.0) lead the open source AI coding agents in 2026 on model choice, MCP support, and admin-managed settings; Cline and Kilo Code lead inside VS Code and JetBrains.
  • An open source license covers the agent's code only: prompts and source code still go to whichever model provider the agent calls.
  • Roo Code shut down on May 15, 2026, and Gemini CLI's free tier moved to Antigravity CLI on June 18, 2026, so teams using either need a migration plan.
  • All nine agents accept a custom model endpoint, so one gateway can hold provider keys, budgets, and logs for all of them.
  • Bifrost governs these agents with virtual keys, per-team budgets, MCP tool filtering, and request logs, and adds about 11 microseconds of overhead per request at 5,000 RPS.

Open source AI coding agents are terminal, editor, and desktop tools that read a repository, plan changes, edit files, and run commands, with the agent's own source code published under a license such as MIT or Apache 2.0. The license covers the agent, not the model it calls, so a team that adopts several of these agents still needs one place to control model access, spend, and tool calls. Bifrost, the open-source AI gateway built by Maxim AI, is the best choice for enterprises running mission-critical AI workloads that require top-tier performance, scalability, and reliability, and it sits behind every agent in this list as that control point. This guide ranks nine open source coding agents on license, model choice, MCP support, and team controls, then shows how to run all of them through one gateway.

What Are Open Source AI Coding Agents?

An open source AI coding agent is a coding assistant whose agent loop (planning, file edits, shell commands, and tool calls) is published under an OSI-approved open source license. Teams can read the code, fork it, self-host it, and point it at the model provider of their choice.

The agent is one of four systems in a coding session: it calls a model API for each reasoning step, calls Model Context Protocol (MCP) servers for external context, and edits and runs code in the repository. Closed-source agents such as Claude Code and Cursor are covered in our ranking of the best AI coding agents for enterprise teams.

A developer prompts an open source coding agent, which calls a model API, connects to MCP servers, and edits and runs code in the local repository

Figure 1: An open source license covers the agent, not the model it calls, so model access and tool access still need their own controls.

As Figure 1 shows, model endpoints, MCP servers, and their credentials sit outside the agent, so platform teams pair these agents with a gateway for CLI coding agents.

How to Evaluate an Open Source AI Coding Assistant

Evaluate an open source AI coding assistant on license scope, endpoint and model choice, permission model, sandboxing, admin-managed settings, and project health. Model choice decides cost and data handling; the permission model and sandbox decide what a wrong tool call can damage.

Criterion What to check Why it matters for a team
License scope MIT or Apache 2.0, and any closed component Cline's JetBrains plugin is not open source
Endpoint choice Custom OpenAI- or Anthropic-compatible base URL Decides whether traffic can pass through a gateway
Local models Ollama, LM Studio, vLLM, or SGLang Keeps source code on infrastructure the team controls
Permission model Approve, ask, or deny rules and auto modes Limits what runs without a human
Sandboxing OS or container sandbox, network default Contains a bad command
Admin settings System or MDM-managed config users cannot override Lets security set policy once
Project health Archived status, release cadence, stewardship Two known agents changed status in 2026

The permission check sits between the model's request and the repository, so it is the first control a security review examines. Our guide to AI coding agent security covers the threat model.

A task goes to the model, which requests a tool call; a permission check runs or denies it, and the result returns to the model

Figure 2: The permission check is where open source agents differ most, and it is the control a security team reviews first.

Open Source AI Coding Agents Compared at a Glance

The table compares nine open source AI coding agents using each project's repository and docs as of November 2026. Row 0 is the Bifrost AI gateway, which runs in front of the agents rather than replacing any of them.

# Agent License Main form factor Custom endpoint Local models MCP GitHub stars
0 Bifrost (gateway in front of all nine) Apache 2.0 Self-hosted AI gateway Serves OpenAI, Anthropic, GenAI routes Routes to Ollama, vLLM, SGLang One /mcp endpoint n/a
1 OpenCode MIT Terminal UI, desktop, web OpenAI and Anthropic compatible Ollama, LM Studio, vLLM Yes 228k
2 Codex CLI Apache 2.0 CLI, IDE extension, desktop Responses API providers Ollama, LM Studio Yes 136k
3 Cline Apache 2.0 (JetBrains plugin closed) VS Code, JetBrains, CLI OpenAI and Anthropic compatible Ollama, LM Studio Yes 72k
4 Kilo Code MIT VS Code, JetBrains, CLI OpenAI compatible, Anthropic Messages Ollama, LM Studio Yes 28k
5 OpenHands MIT (Cloud, Enterprise commercial) Self-hosted web UI, CLI, SDK Custom model and base URL Ollama, LM Studio, vLLM, SGLang Yes 94k
6 Qwen Code Apache 2.0 CLI, desktop, IDE integrations OpenAI and Anthropic compatible Ollama, vLLM Yes 31k
7 goose Apache 2.0 Desktop app, CLI OpenAI and Anthropic compatible Ollama, LM Studio, vLLM Yes 57k
8 Aider Apache 2.0 Terminal CLI OpenAI compatible Ollama, LM Studio Not documented 50k
9 Gemini CLI Apache 2.0 CLI, VS Code companion Gemini API base URL only Gemma for routing only Yes 109k

Bifrost has published setup guides for four of the nine (OpenCode, Codex CLI, Gemini CLI, and Qwen Code) in its coding agent integration docs.

The 9 Best Open Source Coding Agents in 2026

The best open source coding agents in 2026 are OpenCode, Codex CLI, Cline, Kilo Code, OpenHands, Qwen Code, goose, Aider, and Gemini CLI, ranked by model flexibility, admin controls, and project health, with each license read from the project's LICENSE file.

1. OpenCode

OpenCode is an MIT-licensed terminal coding agent with a terminal UI, a desktop app in beta, a web app, and an SDK with a server mode. Its repository moved from sst to anomalyco in 2026, and V2 ships as the @opencode/cli package.

  • Models: custom OpenAI- and Anthropic-compatible providers, automatic Ollama detection, and LM Studio and vLLM discovery
  • Controls: allow, ask, or deny rules per action; managed settings from /etc/opencode or macOS MDM; policies that deny providers, MCP servers, or tools
  • Commercial tier: OpenCode Console adds model subscriptions, Teams, and an Enterprise plan with SSO and SCIM

Bifrost has a documented OpenCode setup, and our guide to running OpenCode with Claude, Gemini, and Bedrock models walks through it.

Best for: teams that want one terminal agent across every model provider, including local models.

2. Codex CLI

Codex CLI is OpenAI's Apache 2.0 terminal agent, with a non-interactive codex exec mode, an IDE extension, a desktop app, a GitHub Action, and an SDK.

  • Models: custom providers in config.toml that speak the Responses API, plus local models through --oss with Ollama or LM Studio
  • Controls: an OS sandbox (Seatbelt on macOS, bubblewrap and seccomp on Linux) with network off by default, plus approval policies
  • Admin: a managed requirements.toml delivered from the cloud, the device, or macOS MDM

Bifrost connects Codex CLI through a custom Responses API provider, and the Codex CLI multi-provider guide shows how to switch it to Claude or Gemini models.

Best for: teams that want an OS-level sandbox and centrally managed configuration.

3. Cline

Cline is an Apache 2.0 agent from Cline Bot Inc. that runs as a VS Code extension, a JetBrains plugin, a CLI, a desktop app, and an SDK.

  • Models: an OpenAI Compatible provider with a custom base URL, a custom Anthropic base URL, and Ollama or LM Studio
  • Controls: Plan and Act modes, per-action approval, Auto Approve, and YOLO mode; telemetry is on by default
  • Enterprise: SSO, RBAC, remote configuration, model and tool controls, and OpenTelemetry export

Bifrost has no dedicated Cline guide; the OpenAI Compatible provider takes the same kind of base URL the documented agents use.

Best for: VS Code teams that want a human to approve each step.

4. Kilo Code

Kilo Code is an MIT-licensed agent for VS Code, JetBrains, and the terminal, with a cloud agent and pull request reviews. Its README states that the Kilo CLI is a fork of OpenCode, and kilo run --auto runs it in CI.

  • Models: custom providers on an OpenAI-compatible or Anthropic Messages API, plus Ollama and LM Studio; Kilo's docs state models are billed at provider rates with no markup
  • Controls: allow, ask, or deny rules, an OS sandbox for macOS and Linux that is off by default, and a telemetry switch
  • Plans: Teams and Enterprise add SSO, SCIM, audit logs, and model limits

Bifrost has no Kilo Code guide; a gateway endpoint goes in the custom provider's base URL.

Best for: teams that want the same agent in VS Code, JetBrains, and CI.

5. OpenHands

OpenHands is an MIT-licensed platform whose main repository is now Agent Canvas, a self-hosted web control center that also runs Claude Code, Codex, Gemini CLI, and OpenCode over the Agent Client Protocol. A separate CLI and a Python SDK are MIT-licensed too.

  • Models: a Custom Model and Base URL in advanced settings, plus LM Studio, Ollama, vLLM, and SGLang
  • Controls: a confirmation policy, a security analyzer, and Docker sandboxes
  • Commercial: OpenHands Cloud and a self-hosted Enterprise edition

OpenHands has no Bifrost guide; its Base URL field accepts a custom endpoint.

Best for: platform teams that run agent tasks in sandboxed containers rather than on laptops.

6. Qwen Code

Qwen Code is the Qwen team's Apache 2.0 terminal agent, originally based on Gemini CLI and developed independently since v0.1, with a desktop app, IDE integrations, and SDKs.

  • Models: modelProviders with a baseUrl in settings.json, ANTHROPIC_BASE_URL, and Ollama or vLLM for local models
  • Controls: Plan, Ask Permissions, Auto-Edit, Auto, and YOLO modes, plus Seatbelt or Docker sandboxing
  • Admin: /etc/qwen-code/settings.json overrides every other settings file

Bifrost has a documented Qwen Code configuration that reaches any configured provider through one OpenAI-compatible endpoint.

Best for: teams that want a Gemini CLI-style terminal agent that is not tied to one provider.

7. goose

The goose agent is Apache 2.0-licensed, with a desktop app, a CLI, and an API. Its README places it in the Agentic AI Foundation at the Linux Foundation, and the repository moved from block/goose to aaif-goose/goose.

  • Models: OPENAI_HOST and ANTHROPIC_HOST overrides, custom provider files, and Ollama, LM Studio, or vLLM
  • MCP: every extension is an MCP server, and GOOSE_ALLOWLIST limits which ones load
  • Controls: GOOSE_MODE defaults to auto, so managed rollouts should set approve or smart_approve

There is no Bifrost guide for goose; its host overrides accept a custom endpoint, and its extensions can sit behind one MCP gateway.

Best for: teams that want a foundation-governed agent with a desktop app and an extension allowlist.

8. Aider

Aider is an Apache 2.0 terminal pair programmer that works through git and also takes instructions from comments left in code. Its latest GitHub release is v0.86.0 from August 2025, a slower cadence than the rest of this list.

  • Models: OPENAI_API_BASE for OpenAI-compatible endpoints, and OLLAMA_API_BASE or LM_STUDIO_API_BASE for local models
  • Controls: opt-in analytics and a --yes-always flag for unattended runs
  • MCP: not documented

Aider has no Bifrost guide; OPENAI_API_BASE is where a gateway URL goes.

Best for: developers who want a lightweight, git-centered terminal assistant.

9. Gemini CLI

Gemini CLI is Google's Apache 2.0 terminal agent, with a headless JSON mode, a VS Code companion, and GitHub Actions. The Gemini CLI README states that free-tier and Google AI Pro and Ultra users moved to Antigravity CLI on June 18, 2026; it now targets Gemini Code Assist Standard and Enterprise licenses and paid API keys.

  • Models: Gemini API and Vertex AI only; GOOGLE_GEMINI_BASE_URL points the Gemini API at a proxy
  • Controls: approval modes, Seatbelt or Docker sandboxes, and admin controls that block YOLO mode and allowlist MCP servers

Bifrost serves Gemini CLI on its GenAI-compatible route and can translate those requests to OpenAI, Anthropic, or Groq models, which removes the Gemini-only limit.

Best for: teams already licensed for Gemini Code Assist Standard or Enterprise.

Roo Code is not ranked: its archived repository states the extension shut down on May 15, 2026.

Running a Local Coding Agent with Self-Hosted Models

A local coding agent sends inference to a model the team hosts, such as one served by Ollama, LM Studio, vLLM, or SGLang. Eight of the nine agents document local model support; Gemini CLI uses a local Gemma model only for experimental routing decisions.

The constraint is tool calling: a model that handles chat well can still fail an agentic session, so test each model on real tasks first. Running Ollama on every laptop also duplicates GPU spend and leaves no central record, so a shared model server behind Bifrost works better at team scale:

Governing Open Source Coding Agents Through Bifrost

Bifrost governs open source coding agents by sitting between each agent and its model providers. Developers point OpenCode, Codex CLI, Gemini CLI, Qwen Code, or any agent with a custom OpenAI-compatible base URL at Bifrost, the AI gateway, and it applies one set of virtual keys, budgets, rate limits, tool permissions, and logs to all of them.

Without a gateway, governance fragments: OpenCode, Cline, Kilo Code, and OpenHands each sell an enterprise tier with its own SSO and limits, and nothing shows spend across them. The AI governance tools for coding agents roundup covers that gap.

Best for: Bifrost is built for enterprises running mission-critical AI workloads that require top-tier performance, scalability, and reliability. It serves as a centralized AI gateway to route, govern, and secure all AI traffic across models and environments with ultra low latency. Bifrost unifies LLM gateway, MCP gateway, and Agents gateway capabilities into a single platform. Designed for regulated industries and strict enterprise requirements, it supports air-gapped deployments, VPC isolation, and on-prem infrastructure. It provides full control over data, access, and execution, along with strong security, policy enforcement, and governance capabilities.

OpenCode, Codex CLI, Gemini CLI, Qwen Code, and other agents send traffic to the Bifrost AI gateway, which routes to hosted models, self-hosted models, and MCP servers

Figure 3: Policy lives in the gateway, so changing an agent or a model does not change who can spend what.

What the gateway enforces for every agent in Figure 3:

The Bifrost CLI launches the documented agents with the gateway URL, credential, and model set, and strips inherited provider keys from the child process:

npx -y @maximhq/bifrost-cli
bifrost context add production --base-url https://gateway.example.com --use
printf '%s\n' "$BIFROST_VIRTUAL_KEY" | bifrost auth set-virtual-key --stdin
bifrost opencode --model openai/gpt-5
bifrost run gemini --model anthropic/claude-sonnet-4-6

Bifrost CLI v1.0 added gateway contexts and SSO sign-in. Bifrost adds about 11 microseconds of overhead per request at 5,000 RPS in published gateway benchmarks, and it is self-hosted in the team's own VPC or on-prem environment, as the Bifrost Enterprise page describes.

For agents on employee laptops, AI Gateway + Bifrost Edge extends the same policy to each device. The gateway stays the control plane for keys, budgets, and guardrails, and Bifrost Edge routes supported coding agents, including Codex CLI and OpenCode, through it without per-machine setup. Edge requires the Enterprise Gateway, and the same AI governance controls apply on both paths.

How to Choose an Open Source AI Coding Agent

Choose an open source AI coding agent by where engineers work first, then by how much model flexibility the team needs. Terminal teams should start with OpenCode or Codex CLI, editor teams with Cline or Kilo Code, and teams running unattended tasks with OpenHands.

Decision flow that picks a terminal, editor, sandboxed, or desktop coding agent by where engineers work, with every choice routed through the Bifrost gateway

Figure 4: The agent choice follows the workflow, while keys, budgets, and logs stay in one gateway whichever agent a team picks.

Most organizations run more than one agent, so the gateway decision outlasts the agent decision. See our guide to LLM gateways for coding agents, and the enterprise AI coding agents ranking for closed-source tools.

Frequently Asked Questions

What is the best open source AI coding agent?

OpenCode is the best open source AI coding agent for most teams in 2026. It is MIT-licensed, has about 228,000 GitHub stars, works with OpenAI-compatible, Anthropic-compatible, and local models, and supports managed settings and per-action permission rules. Codex CLI is the stronger choice when an OS-level sandbox is the priority.

Is Claude Code open source?

No. Anthropic publishes a public Claude Code repository, but its license file reserves all rights to Anthropic and makes use subject to Anthropic's commercial terms. Teams that need an open source license can choose OpenCode, Codex CLI, Qwen Code, or Aider, all of which use MIT or Apache 2.0.

Is OpenAI Codex open source?

Yes. Codex CLI is open source under the Apache 2.0 license, in OpenAI's public GitHub repository. The models it calls are not open source, and usage is billed through a ChatGPT plan or an API key. Its --oss flag runs local models through Ollama or LM Studio.

What is the best open source alternative to Claude Code?

OpenCode is the closest open source alternative to Claude Code: both are terminal agents with MCP support and permission rules, and OpenCode works with any model provider. Teams can also keep Claude Code and route it through a Claude Code gateway.

Are open source AI coding agents free?

The software is free, but running it is not. Each agent calls a model, hosted model usage is billed per token by the provider, and self-hosted models move that cost to GPU infrastructure. OpenCode, Cline, and Kilo Code also sell paid team and enterprise tiers.

Can an AI coding agent run with local models?

Yes. OpenCode, Codex CLI, Cline, Kilo Code, OpenHands, Qwen Code, goose, and Aider all document local model support through Ollama, LM Studio, or vLLM. The model must support tool calling and streaming to work in an agent loop, and a shared server behind Bifrost as the AI gateway lets one model serve many developers.

Run Open Source AI Coding Agents Through One Gateway

Open source AI coding agents give teams control over the agent; Bifrost gives them control over the models, tools, and spend behind it, with one set of virtual keys, budgets, MCP permissions, and logs for every agent in this list. The CLI agents resource page covers setup patterns. To see how Bifrost governs coding agents across an engineering organization, book a demo with the Bifrost team.