AI

Install OpenCode with Oh-My-OpenAgent on Linux (Ubuntu / Rocky Linux)

Terminal-based AI coding agents have exploded in popularity, but most of them lock you into a single model or a single workflow. OpenCode takes a different approach: it gives you a fast, open-source coding agent that runs in your terminal, and Oh-My-OpenAgent (OmO) extends it with a multi-agent system where each agent has a specific role and its own model assignment. The result is a setup where Claude, GPT, and other models collaborate on the same codebase, each doing what it does best.

Original content from computingforgeeks.com - post 165423

This guide walks through installing OpenCode and Oh-My-OpenAgent on Rocky Linux and Ubuntu, configuring API providers, and getting the multi-agent system running. Everything here was tested on real VMs, and all output is captured from actual installations. If you’ve been looking for a Claude Code alternative that supports multiple models and agent specialization, this is worth trying.

Tested April 2026 on Rocky Linux 9.5 with OpenCode 1.4.0, oh-my-opencode 3.16.0, Node.js 20.19.2

What You’ll Learn

  • Install OpenCode on Rocky Linux / RHEL and Ubuntu / Debian
  • Set up Oh-My-OpenAgent with npm and the built-in installer
  • Configure Anthropic and OpenAI API keys for multi-model access
  • Run the doctor command to verify your installation and fix warnings
  • Understand the 10-agent system, their roles, and default model assignments
  • Use the ultrawork command to start an autonomous coding session

Prerequisites

  • A Linux server or workstation running Rocky Linux 9.x / RHEL 9.x or Ubuntu 22.04+ / Debian 12+
  • Root or sudo access
  • Node.js 18+ and npm installed (required for Oh-My-OpenAgent)
  • At least one API key from Anthropic (Claude) or OpenAI (GPT)
  • Tested on: Rocky Linux 9.5 (kernel 5.14), Ubuntu 24.04.2 LTS

What is OpenCode and Oh-My-OpenAgent?

OpenCode is an open-source AI coding agent that runs entirely in your terminal. Think of it as a local, self-hosted alternative to cloud-based coding assistants. It connects to LLM providers through their APIs, reads your project files, and can edit code, run commands, and reason about your codebase.

On its own, OpenCode works with a single model at a time. Oh-My-OpenAgent changes that. It is a plugin that transforms OpenCode into a multi-agent system with 10 specialized agents, each assigned to a specific model. One agent handles deep architectural reasoning (Claude Opus), another does quick file exploration (Claude Haiku), and others focus on code generation, testing, or multimodal analysis. The agents coordinate through a shared context, so they can hand off tasks to whichever model is best suited for the job.

Install OpenCode on Rocky Linux / RHEL

OpenCode provides a one-line installer script that downloads the latest binary and adds it to your PATH. On RHEL-based systems, make sure curl is available first.

sudo dnf install -y curl

Now grab and run the installer:

curl -fsSL https://opencode.ai/install | bash

The installer detects your architecture, downloads the correct binary, and configures your shell:

Installing opencode version: 1.4.0

Successfully added opencode to $PATH in /root/.bashrc

Source your shell profile to pick up the new PATH entry, then confirm the version:

source ~/.bashrc

opencode --version

You should see the version number printed:

1.4.0

Install OpenCode on Ubuntu / Debian

The same installer script works on Debian-based distributions. Ubuntu and Debian typically have curl installed, but install it if needed:

sudo apt update && sudo apt install -y curl

Run the installer:

curl -fsSL https://opencode.ai/install | bash

On Ubuntu, the installer writes to ~/.bashrc by default. If you use zsh, source ~/.zshrc instead:

source ~/.bashrc

opencode --version

The output confirms the installed version:

1.4.0

If you prefer using a package manager, OpenCode can also be installed via npm as an alternative method:

npm install -g opencode-ai

Both methods produce the same binary. The curl installer is recommended because it handles PATH configuration automatically.

Install Oh-My-OpenAgent

Oh-My-OpenAgent (OmO) is distributed as an npm package. You need Node.js 18 or later. If you don’t have Node.js installed, set it up first.

On Rocky Linux / RHEL:

curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -

sudo dnf install -y nodejs

On Ubuntu / Debian:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -

sudo apt install -y nodejs

Verify Node.js and npm are working:

node --version && npm --version

With Node.js in place, install the OmO package globally:

npm install -g oh-my-opencode

Now run the installer. The --no-tui flag runs the non-interactive mode, which is useful for scripting and CI environments. Specify which providers you want enabled:

oh-my-opencode install --no-tui --claude=yes --openai=yes --gemini=no --copilot=no

The installer validates your OpenCode installation, injects the plugin, and generates the agent configuration:

[1/4] Checking OpenCode installation...

[OK] OpenCode 1.4.0 detected
[2/4] Adding oh-my-openagent plugin...
[OK] Plugin added -> /root/.config/opencode/opencode.json
[3/4] Writing oh-my-openagent configuration...
[OK] Config written -> /root/.config/opencode/oh-my-openagent.json

Two configuration files are generated in ~/.config/opencode/. The main OpenCode config now includes the OmO plugin reference, and a separate file holds all agent definitions.

Configure API Providers

The multi-agent system needs API keys to talk to the model providers. OmO supports several providers, but the core experience requires at least Anthropic (for Claude models) and optionally OpenAI (for GPT models).

Set your Anthropic API key:

opencode auth set anthropic your-api-key-here

Set your OpenAI API key:

opencode auth set openai your-api-key-here

These keys are stored locally in ~/.config/opencode/auth.json with file permissions restricted to your user. They never leave your machine except when making API calls to the respective providers.

You can also export the keys as environment variables if you prefer that approach:

export ANTHROPIC_API_KEY="your-api-key-here"

export OPENAI_API_KEY="your-api-key-here"

To persist these across sessions, add the export lines to your ~/.bashrc or ~/.zshrc. The opencode auth set method is cleaner because it keeps credentials out of your shell history.

Verify Installation

OmO includes a diagnostic command that checks your entire setup. Run it to catch any missing dependencies:

oh-my-opencode doctor

On a fresh installation, you’ll typically see a few warnings. These are informational, not blockers:

1. Comment checker unavailable

2. No LSP servers detected
3. GitHub CLI missing
4. Model cache not found

None of these prevent OmO from working. The warnings point to optional features that enhance the experience but aren’t required for core functionality. The troubleshooting section at the end of this guide covers each one in detail.

If you see errors (red text) instead of warnings (yellow), something fundamental is wrong. Common causes are a missing API key or an OpenCode binary that isn’t in your PATH.

Understanding the Agent System

Oh-My-OpenAgent ships with 10 pre-configured agents. Each agent has a specific role and is assigned to a model that matches its purpose. Heavy reasoning tasks go to larger models, while quick lookups use smaller, faster ones. This is where the real value of OmO becomes clear: instead of one model doing everything, specialized agents handle what they’re best at.

Here’s the full agent roster as configured in ~/.config/opencode/oh-my-openagent.json:

Agent NameRoleDefault Model
SisyphusPrimary coding agent, handles complex refactoring and architecture decisionsClaude Opus 4.6
HephaestusCode generation and implementation, builds features from specificationsGPT-5.4
OracleCode review and quality analysis, spots bugs and anti-patternsClaude Opus 4.6
ExploreFast file exploration and codebase navigationClaude Haiku 4.5
PrometheusTest generation and validation, writes unit and integration testsGPT-5.4
MetisDocumentation generation and technical writingClaude Sonnet 4.6
MomusDebugging and error analysis, traces issues through stack tracesClaude Opus 4.6
AtlasProject planning and task decompositionClaude Sonnet 4.6
Sisyphus-JuniorQuick fixes and small changes, handles routine editsClaude Haiku 4.5
Multimodal-LookerScreenshot and image analysis, interprets UI mockups and diagramsGPT-5.4

You can customize any agent’s model assignment by editing ~/.config/opencode/oh-my-openagent.json directly. For example, if you want Hephaestus to use Claude instead of GPT, change the model field for that agent. The agent’s role stays the same regardless of which model powers it.

First Usage: The ultrawork Command

Navigate to a project directory and launch OpenCode:

cd ~/my-project

opencode

Inside the OpenCode TUI, the ultrawork command kicks off an autonomous multi-agent session. Type it at the prompt or use the slash command:

/ultrawork "Refactor the authentication module to use JWT tokens"

OmO will decompose your request into subtasks and dispatch them to the appropriate agents. Sisyphus handles the architectural planning, Hephaestus generates the implementation, Prometheus writes tests, and Oracle reviews everything before the changes are applied. You’ll see each agent’s activity in the TUI with color-coded output.

For simpler tasks that don’t need the full agent orchestration, you can just chat with OpenCode normally. OmO only activates its multi-agent pipeline when you explicitly invoke one of its commands.

Key Commands

These are the main OmO commands you’ll use inside the OpenCode TUI:

CommandDescription
/ultrawork "task"Autonomous multi-agent session. Decomposes the task, dispatches agents, and applies changes
/start-work "task"Interactive multi-agent session. Same decomposition but pauses for approval before each step
/init-deep "question"Deep codebase analysis. Explore agent maps the codebase, Oracle analyzes patterns, Atlas summarizes findings
/ulw-loopContinuous work loop. Picks up tasks from a queue file and processes them sequentially with full agent orchestration

The difference between /ultrawork and /start-work is autonomy. Use ultrawork when you trust the agents to make decisions. Use start-work when you want to review each step, which is the safer choice for production codebases.

Troubleshooting

The oh-my-opencode doctor command flags four common warnings on fresh installs. Here’s what each one means and how to resolve it.

1. Comment checker unavailable

The comment checker is an optional linter that validates inline code comments for consistency. It requires tree-sitter to be installed. On Rocky Linux:

sudo dnf install -y tree-sitter-cli

On Ubuntu:

sudo apt install -y tree-sitter-cli

If the package isn’t available in your distribution’s repos, install it via npm:

npm install -g tree-sitter-cli

2. No LSP servers detected

OmO can integrate with Language Server Protocol servers for richer code understanding. This warning appears when no LSP servers are running. Install one for your primary language. For example, for TypeScript projects:

npm install -g typescript-language-server typescript

For Python projects, pyright or pylsp work well:

pip install python-lsp-server

OmO auto-detects running LSP servers. You don’t need to configure them manually.

3. GitHub CLI missing

Some agents (particularly Atlas and Oracle) can interact with GitHub issues and pull requests if the GitHub CLI is available. Install it on Rocky Linux:

sudo dnf install -y gh

On Ubuntu:

sudo apt install -y gh

After installing, authenticate with your GitHub account:

gh auth login

4. Model cache not found

The model cache speeds up repeated interactions by storing tokenized prompts locally. It creates itself automatically on your first OmO session, so this warning disappears after your first /ultrawork or /start-work run. No manual action is required.

For a detailed comparison of OpenCode with Claude Code and Cursor, see our OpenCode vs Claude Code vs Cursor comparison. If you are interested in using these tools for infrastructure automation, check out AI Coding Agents for DevOps: Terraform, Ansible, and Kubernetes.

FAQ

How much does it cost to use OpenCode with Oh-My-OpenAgent?

OpenCode itself is free and open source. The cost comes from API usage with the model providers. A typical /ultrawork session that touches 10 to 15 files will use multiple agents and can consume $0.50 to $3.00 in API credits depending on the models involved. Claude Opus calls are the most expensive, while Haiku calls are very cheap. You can reduce costs by reassigning expensive agents to smaller models in the config file.

Do I need all model providers, or can I use just one?

You can run OmO with a single provider. During installation, set --openai=no to skip OpenAI, and OmO will reassign GPT-based agents to your available Claude models. The agents still function in their specialized roles, just powered by a different model. The experience is best with multiple providers because each model family has different strengths, but a single-provider setup works fine.

Can I use OpenCode alongside Claude Code?

Yes. OpenCode and Claude Code don’t conflict with each other. They use separate configuration directories (~/.config/opencode/ vs ~/.claude/) and separate authentication. You can use both on the same machine and even in the same project. Some developers use Claude Code for quick single-model tasks and switch to OpenCode with OmO when they need multi-agent orchestration for larger refactoring sessions.

Related Articles

Git Install and Configure GitLab CE on Debian 11/10 AI Pippit Launches “Agent Mode,” a Smart  Engine to Turn any Idea into a Ready-to-Share Video DevOps How to create Regional Persistent Disks in Google Kubernetes Ansible How To Manage PostgreSQL Database with Ansible

Leave a Comment

Press ESC to close