Skip to content
mini PC AI.
← The path
Step 06 · Foundations Easy · 12 min

🤖Installing the agent (very early)

Claude Code or OpenCode, in five minutes. The trick: install it now, so it configures the rest of the machine for you.


Here’s the least intuitive secret of this whole journey: you install the code agent before everything else.

Most tutorials have you configure the machine for three hours, network, firewall, services, then install the AI at the end, like a reward. We do the opposite. You set up the agent now, while the system is still bare, and it’s the agent that will help you hook up Tailscale, Cloudflare, Ollama and the whole shebang. You go from “I’m typing commands I don’t understand” to “I describe what I want, I review, I approve.”

Claude Code or OpenCode: which one?

Both are excellent command-line code agents. They read your project, write files, run commands, and loop until it works. These are the two this guide follows at parity : but they’re not the only ones. The difference between them fits in one sentence:

  • Claude Code : Anthropic’s agent. You plug into the Claude models (the best on the market for code in 2026). Ultra-simple setup, top reliability on long tasks. Paid (subscription or API).
  • OpenCode : the open-source agent. Same spirit, but you choose your engine: Claude, GPT, or a local model via Ollama. Perfect if you want 100% local or to juggle providers.

And if you want to explore more widely, the landscape is rich in 2026, they all work on the same principle (read, write, run, loop):

  • Antigravity CLI (agy command) : Google’s new command-line agent, plugged into the Gemini models. It replaces Gemini CLI, whose consumer service Google shut down on June 18, 2026 (free, Pro and Ultra accounts were moved over automatically; only enterprise Gemini Code Assist licenses stay on the old tool). Written in Go, it orchestrates several subagents in the background. Installs via a script, no longer through npm : curl -fsSL https://antigravity.google/cli/install.sh | bash.
  • Codex CLI : OpenAI’s agent, backed by the GPT models.
  • Aider : a much-loved open-source agent, built around git (every change = a clean commit), compatible with just about any model, local ones included.
  • Pi : the minimalist alternative to OpenCode. Same open-source world, opposite philosophy: a bare-bones core you extend yourself. See the callout right below.
  • Cline / Roo Code : agents that live inside VS Code rather than in the terminal, if you’d rather stay in your editor.
  • Cursor, Windsurf : full code editors, built around AI, for anyone who wants an all-in-one experience.
  • Orca : not one more agent, but an environment to run them in (an “ADE”, Agent Development Environment). See the callout right below.

One key, every model: unified APIs

When an open agent like OpenCode asks you “which provider?”, you could create an account with each vendor (Anthropic, OpenAI, Google…), juggle five keys, five bills, five quotas. Or plug in a unified API: a single service sitting in front of dozens of models, exposing one key, one bill, one format. You switch models without switching accounts, and you pay for everything in one place.

  • OpenRouter : the best known. A single key gives access to hundreds of models (Claude, GPT, Gemini, Grok, Llama, Qwen, DeepSeek…), with automatic routing to the cheapest or fastest provider, fallback if one goes down, and a dashboard that tracks spend down to the token. Pay-as-you-go, a thin markup over wholesale price. Ideal for comparing ten models on the same task without ten sign-ups.
  • OpenCode Zen : the OpenCode team’s own gateway: a set of models curated and benchmarked for agentic coding (40+ options, from frontier to small-and-fast, including a few free ones). Fewer choices than OpenRouter, but each one is vetted to behave well inside an agent (not just in a chat). Pay-as-you-go (wholesale price + processing fees), with configurable auto-reload and monthly cap. To connect: /connect in OpenCode → “OpenCode Zen” → paste the key.
  • OpenCode Go : the same idea, but on a flat plan: roughly $5 for the first month then $10/month, for access to low-cost coding models without counting tokens. The smart pick if you code every day and prefer a fixed amount to a variable bill.

The common prerequisite: Node and a clean terminal

Both agents run on Node.js. We install it cleanly with nvm (version manager) rather than with the system package, to avoid permission headaches.

# Install nvm (Node version manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# Reload your shell (or close/reopen the terminal)
source ~/.bashrc
# Install the latest Node LTS
nvm install --lts
node -v   # should show v22.x or newer

Install and launch

The CLI installs with npm, globally:

npm install -g @anthropic-ai/claude-code

Launch it from any folder:

claude

On first launch, it opens your browser to log you in (Anthropic account, Pro/Max subscription, or API key). Once authenticated, you’re inside the agent. Type a request in plain language and watch it work.

Your first real move: have it configure the machine

This is where the magic happens. Rather than chaining system commands yourself, you ask. Here’s a first concrete mission, to copy almost verbatim once into the agent:

Describe the goal, not the commands

In the agent, write something like:

“We’re on a brand-new Ubuntu 24.04. I want you to help me finish the basic config: automatic security updates, a ufw firewall that lets only SSH through, and zram for swap. Explain each step before running it, and don’t run anything with sudo without showing me the command first.”

Review the plan before approving

The agent will propose a plan and commands. Read them. That’s the heart of the craft: you no longer type, you review. If a command looks fishy, ask “why that one?” before accepting.

Let it execute, keep your hand on the wheel

You approve step by step. On an error, the agent reads the message, understands, and fixes it. You’ve just configured your machine by chatting.

Lay the foundations of memory right away

Before you leave, create the file the agent will read at every session: a CLAUDE.md (Claude Code) or AGENTS.md (OpenCode) at the root of your project. Two lines are enough to start, we dig into the topic in Memory files.

cd ~/mon-projet
cat > CLAUDE.md <<'EOF'
# Machine context
- Mini-PC Ubuntu 24.04, use: personal dev workshop.
- Always show sudo commands before running them.
- No secret in plain text in the code.
EOF