All resources
Comparison/7 min read

OpenCode alternatives: open-source, free and cloud options

Published · Updated

Summary

Kilo CLI is the closest replacement for OpenCode: it is a fork that reads the same opencode.json config. Pi, Goose, Aider and Cline are other open-source agents that work with many providers and local models, Claude Code, Codex CLI and Antigravity CLI are built by Anthropic, OpenAI and Google around their own models, and Cursor puts the agent in an editor. If you want to keep OpenCode but stop running it on your laptop, Replicas runs it in cloud VMs.

Tested November 6, 2026

OpenCode alternatives compared

We installed the latest version of each command-line tool on Linux, saved a fake API key with the tool's own login command, and searched the disk for it. The last column shows what we found. Where a tool behaves differently on macOS or Windows, the notes below say so, based on its own documentation.

Most of the tools that save a key keep it in a plain-text file that only your user can read (mode 600). Three results stood out: Kilo CLI also copies the key into a database file that is not limited to your user, Goose kept a key it had just rejected, and Aider writes a key passed with --api-key into its chat history. Claude Code, Cursor and Antigravity CLI never wrote a full key to disk.

ToolLicenseCost to startModelsWhere your API key ends up
OpenCode 2, for comparisonMITFree with your own key; OpenCode Go from $10/month75+ providers and local models~/.local/share/opencode/opencode.db, plain text in SQLite, mode 600
Kilo CLIMITFree with your own key; Kilo Pass from $19/monthAbout 40 providers, Kilo Gateway, local models~/.local/share/kilo/auth.json (mode 600), copied on first run into kilo.db (mode 644)
PiMITFree with your own key or subscriptionAnthropic, OpenAI, Google, OpenRouter, Ollama and more~/.pi/agent/auth.json, plain text, mode 600
GooseApache-2.0Free with your own keyAbout 47 providers and local modelsSystem keychain; without one, ~/.config/goose/secrets.yaml (mode 600)
AiderApache-2.0Free with your own keyMost providers and local modelsNot saved; read from environment variables or .env. A key passed with --api-key ends up in .aider.chat.history.md
Claude CodeProprietaryA paid Claude plan or an Anthropic API keyClaude onlyRead from ANTHROPIC_API_KEY; ~/.claude.json keeps only its last 20 characters
Codex CLIApache-2.0A ChatGPT plan or an OpenAI API keyOpenAI, plus Ollama, LM Studio and custom providers~/.codex/auth.json, plain text, mode 600; system keychain optional
Antigravity CLIProprietaryFree tier with weekly limitsGemini, plus Claude and GPT-OSSNo API-key login; reads GEMINI_API_KEY without saving it. Google sign-in uses the system keychain
ClineApache-2.0Free with your own key; ClinePass $9.99/monthMost providers and local models~/.cline/data/settings/providers.json, plain text, mode 600
CursorProprietaryCursor account; the free plan has limited agent requestsCursor's models plus OpenAI, Anthropic, Google and othersTakes a Cursor key from CURSOR_API_KEY or --api-key without saving it
ReplicasProprietary$100 of free usage, then $50/monthRuns OpenCode, Claude Code, Codex, Cursor and PiEncrypted in Supabase Vault; given to each workspace when it runs

Kilo CLI

Kilo's documentation describes its CLI as a fork of OpenCode that supports the same configuration options. It reads opencode.json in your home config folder and your project, but not .opencode folders, so those need moving into ~/.config/kilo/ and .kilo/. Kilo also ships VS Code and JetBrains extensions and a cloud agent.

kilo auth login saved our key in plain text to ~/.local/share/kilo/auth.json with mode 600. The first kilo run then copied it into kilo.db in the same folder, which was created with mode 644, so other users on a shared machine may be able to read it. Running chmod 600 on that file closes the gap.

Pi

Pi is a minimal terminal agent with a small core that you extend with TypeScript. It signs in with API keys or a subscription, and it is one of the agents Replicas runs.

The /login command saved our key in plain text to ~/.pi/agent/auth.json with mode 600. Pi can instead run a command to fetch each key, such as the macOS security tool, so the key never sits in that file.

Goose

Goose is an open-source agent with a desktop app and a CLI. It connects to about 47 providers and to local models through Ollama or LM Studio, and it can also drive Claude Code, Codex or Cursor through their own CLIs.

goose configure saves keys to the system keychain. Our Linux machine had none, so Goose wrote the key in plain text to ~/.config/goose/secrets.yaml with mode 600 and noted this only in its log. When the provider rejected our fake key, Goose said it had not saved the configuration, but the key stayed in secrets.yaml.

Aider

Aider is a terminal pair programmer that commits each change to git with a generated message. It works with almost any model and can watch your editor for instructions you leave in code comments.

Aider has no command that saves a key; it reads environment variables, a .env file or .aider.conf.yml. Passing a key on the command line is the case to avoid: Aider wrote the full command, key included, to .aider.chat.history.md in the project (mode 644). It adds .aider* to .gitignore, so the file is not committed by default.

Claude Code

Claude Code is Anthropic's agent for the terminal, IDEs, desktop and web. It needs a paid Claude plan or an Anthropic API key, and it runs Claude models only, directly or through Amazon Bedrock, Google Cloud or Microsoft Foundry.

With an API key, Claude Code reads ANTHROPIC_API_KEY and asks you to approve the key once. It recorded only the key's last 20 characters in ~/.claude.json. According to Anthropic's documentation, a subscription login is stored in ~/.claude/.credentials.json on Linux and in the Keychain on macOS.

Codex CLI

Codex CLI is OpenAI's open-source terminal agent. It signs in with a ChatGPT plan or takes an OpenAI API key, and it can also point at Ollama, LM Studio or another provider you configure.

codex login --with-api-key saved our key in plain text to ~/.codex/auth.json with mode 600. Setting cli_auth_credentials_store to keyring in its config moves the key to the system keychain instead.

Antigravity CLI

Google replaced Gemini CLI with Antigravity CLI (agy) for free, Google AI Pro and Ultra users on June 18, 2026. It is not open source, has a free tier with weekly limits, and runs Gemini models plus some partner models.

Its login offers Google sign-in, whose tokens Google says go to the system keychain, or a Google Cloud project. An API key only works through the GEMINI_API_KEY environment variable, and agy never wrote it to disk. Gemini CLI still works with a paid Gemini API key: it tries the system keychain, and without one it wrote our key to ~/.gemini/gemini-credentials.json, encrypted with a key derived from the machine's hostname and username.

Cline

Cline is an open-source agent for VS Code, JetBrains and the terminal that asks for approval at each step. It runs on your own key, Cline credits, or a ClinePass subscription.

cline auth saved our key in plain text to ~/.cline/data/settings/providers.json with mode 600, inside folders only your user can open. The CLI takes the key as an argument, so it also lands in your shell history.

Cursor

Cursor is an AI editor with a terminal agent and Cloud Agents. The CLI uses your Cursor account, with a free plan that has limited agent requests and paid plans from $8 a month. Using your own model keys depends on the plan.

The CLI takes a Cursor API key, not a model provider's key, from CURSOR_API_KEY or --api-key, and it did not save it. We did not test the browser sign-in.

Replicas: keep OpenCode, run it in cloud VMs

Replicas is not a replacement agent. It runs OpenCode itself, along with Claude Code, Codex, Cursor and Pi, in an isolated Linux VM per task, and returns a pull request for review.

OpenCode Go alternatives

Every plan in this table works in OpenCode. We checked prices on November 10, 2026.

PlanMonthly pricePublished limitsModelsSource
Models from several labs
OpenCode GoGo $10, Go Plus $40, Go Teams $20 per memberA dollar allowance per model. At most 20% of it in 5 hours and 50% in a week.32 models, including GLM-5.3, Kimi K3.1 Pro, DeepSeek V4 Pro and Qwen3.8 MaxOpenCode Go docs
SyntheticGo $9, Standard $30, Big $90Weekly limits. Sizes not published.GLM-5.3, Kimi-K3, DeepSeek-V4.1-Flash, Qwen3.8-27B and morePricing, OpenCode guide
Ollama CloudPro $20, Max $100$60 or $300 of credits a month. 3 or 10 requests at once.deepseek-v4-pro, glm-5.3, kimi-k3, minimax-m3 and morePricing, OpenCode guide
Alibaba Cloud Model Studio Coding PlanPro $506,000 requests per 5 hours, 45,000 per week and 90,000 per month.qwen3.7-plus, kimi-k2.5, glm-5, MiniMax-M2.5 and moreCoding Plan docs
GitHub CopilotPro $10, Pro+ $39, Max $1001,500, 7,000 or 20,000 AI credits a month. One credit is $0.01.Mostly Claude, GPT, Gemini and Grok modelsPlans, OpenCode support
Models from one lab
Z.ai GLM Coding PlanLite from $182,000, 12,000 or 28,000 credits per 5 hours on Lite, Pro and Max. Off-peak use counts at 50%.GLM-5.3, GLM-5.3-FlashZ.ai docs
Kimi CodePlus $19, Pro $39, Max $99, Ultra $199A rolling 5-hour limit. Size not published.K3.1 Pro, K3 and morePricing, OpenCode guide
MiniMax M PlanGo $22, Explore $55, Build $1321×, 3× or 7.5× the Go usage, in 5-hour and weekly windows.MiniMax-M3.1-FlashM Plan docs

Free models and free agent plans

We checked these limits on November 10, 2026.

OptionWhat is freePublished limitSource
Free models in OpenCode
OpenCode free models14 models for a limited time, including Big Pickle and DeepSeek V4.1 Flash Free. Some may train on your prompts.Not published for most modelsZen docs
OpenRouter free modelsModels whose ID ends in :free20 requests a minute. 50 a day, or 1,000 a day after you buy $10 of credits.Limits
Ollama local modelsAny model you run on your own machineYour hardware. OpenCode needs a context length of 64K or more.OpenCode guide
Free plans of other agents
Google Antigravity FreeAntigravity and its CLI, with Gemini 3.8 FlashWeekly limits. Size not published.Pricing, Plans
GitHub Copilot FreeCompletions, chat and agent mode2,000 completions a month. Chat and agent use are limited.Plans
Kilo CodeFree models through the Kilo Gateway200 requests an hour per IP addressUsage docs

OpenCode vs Cline, OpenHands and Devin

ToolInterfaceLicenseModelsSource
Local agents
OpenCodeTerminal, desktop app and IDE extensionsMIT75+ providers and local modelsOpenCode docs
ClineVS Code, JetBrains and a CLIApache-2.0Most providers and local modelsCline docs
Cloud agents
OpenHandsOpenHands Cloud, or self-hostedMITAny modelOpenHands docs
DevinDevin's cloud, plus a CLIProprietaryAnthropic, OpenAI, Google and Cognition models, plus open modelsDevin models

Before you switch

What changed in OpenCode in October

OpenCode 2 is now the current version, and both versions use the same opencode command. If something broke after an update, check these changes before moving to another agent. OpenCode still ships 1.x releases, most recently 1.19.5 on October 28, so you can stay on OpenCode 1 while you decide.

Upgrading is a separate step

Since version 1.19.3 on October 16, OpenCode 1 only updates within 1.x. The opencode-ai npm package and the install script stay on 1.x, Homebrew Core installs follow OpenCode 2, and you move with /update or opencode upgrade --major.

Three breaking changes

Plugins written for OpenCode 1 do not run on OpenCode 2 and have to be ported. Code that calls the OpenCode server API needs updating, and terminal settings move into a single cli.json file, which happens automatically. Existing opencode.json config, agents, commands and skills are meant to keep working.

One default changed too: OpenCode 2 no longer asks before working with files outside the project. The migration guide shows the permission rule that brings the question back.

Saved keys move into a database

OpenCode 2 imports the keys in OpenCode 1's auth.json into its SQLite database at ~/.local/share/opencode/opencode.db, and new keys are saved only there.

Decision guide

How to pick an OpenCode alternative

Start from what you want to change about OpenCode.

As little as possible
Kilo CLI. It is a fork of OpenCode and reads your opencode.json.
A smaller open-source agent
Pi, which you extend with TypeScript, or Aider if you want every change committed to git.
A desktop app or an editor extension
Goose for a desktop app, or Cline inside VS Code or JetBrains.
One model provider is fine
Claude Code for Claude, Codex CLI for OpenAI, or Antigravity CLI for Gemini.
An AI editor
Cursor, with its terminal agent and Cloud Agents.
Where OpenCode runs
Replicas runs OpenCode in a cloud VM per task, next to Claude Code, Codex, Cursor and Pi.

Replicas fit

When to keep OpenCode and run it on Replicas

Replicas fits when OpenCode itself is fine but running it on one machine is not. Teams usually look at it when several of these are true.

  • You want to hand tasks to OpenCode from Slack, Linear, GitHub or GitLab and get a pull request back.
  • You want several tasks running at once, each in its own Linux VM, instead of terminals or worktrees on one machine.
  • You want to switch between OpenCode, Claude Code, Codex, Cursor and Pi for each task.
  • You want an OpenCode Go, OpenRouter or Aster key stored once for the team, encrypted in Supabase Vault, and given to each workspace when it runs.

FAQ

OpenCode alternative questions