Live
Install OpenCode and connect it
Now, to the terminal. By the end of this part you'll have OpenCode installed, connected to a model, and answering you. We all move at the same pace: if something fails, we stop here.
1. Install OpenCode
Choose one option depending on your system.
Mac or Linux (the most direct):
curl -fsSL https://opencode.ai/install | bash
It downloads the official installer and runs it.
Mac with Homebrew:
brew install anomalyco/tap/opencode
Windows (or any system with Node.js 18 or later):
npm install -g opencode-ai
If you don't have Node.js, download it from nodejs.org (the LTS version), install it with the default options, and open a new terminal before running the command. On Windows you can also use scoop install opencode or choco install opencode if you already use one of those two.
If you see a
$at the start of a command in some guide, don't type it: it just indicates a terminal.
2. Check the installation
Close the terminal, open it again, and type:
opencode --version
If you see a version number, it worked.
If you see "command not found" (or "is not recognized as a command"), it's almost always because the open terminal hasn't found out yet that you installed something. Close it and open it again.
3. Open OpenCode inside your practice folder
OpenCode works on the folder where you open it. Go into agent-workshop and open it there:
cd agent-workshop
opencode
An interface opens inside the same terminal. At the bottom there's a box to type in. Everything that starts with / is an OpenCode command; everything else is a message for the agent.
4. Connect it to your provider
Type in the box:
/connect
- Find your provider: OpenRouter (or OpenCode Zen, or Groq).
- Paste your key when it asks for it and press Enter.
OpenCode saves the key on your computer, so you only do this once.
5. Choose a model
/models
If you use OpenRouter, type free to filter and choose one of the models that end in :free. Live, we'll tell you which one is working best for us that day: the free ones change often and sometimes one is overloaded.
6. Your first answer
Type a normal message, without /:
Hi. In one sentence: what can you do in this folder?
If it answers, you did it: you have an agent running on your machine.
Two things in the interface you'll use today
- The
Tabkey switches between two modes. Plan analyzes and proposes, but doesn't change files. Build makes the changes. At the bottom right you can see which one you're in. - The
@lets you mention a file in your message (@expenses.csv) so the agent reads it no matter what.
Common pitfalls
- Authentication error: it's almost always the key pasted wrong, with a space or incomplete. Go back to
/connectand paste it again. - "Rate limit" or the model doesn't answer: the free model is overloaded or you hit the daily cap. Switch models with
/models. - The agent says it can't see any files: you opened it in another folder. Exit with
/exit, go intoagent-workshop, and open it again.
Summary
- You installed OpenCode and checked it with
opencode --version. - You connected it with
/connectand chose a model with/models. Tabswitches between Plan (proposes) and Build (changes).@mentions a file.