OpenCode Desktop Tutorial: Set Up the Free AI Coding Agent on Windows 11
2026.11.30
This OpenCode Desktop tutorial takes you from zero to a working AI coding agent on Windows 11 in about fifteen minutes: install the app, open a Git project, pick a free model, plan with the Plan agent, fix with the Build agent, approve each command, read the diff and undo what you don't like. Everything here is for OpenCode 2.3 (November 2026).
OpenCode is an open source AI coding agent. It is MIT licensed, built by a company called Anomaly, and it doesn't lock you into one AI company. You can plug in more than 75 providers, or use the free models it ships with.
Unlike a chatbot, an agent opens your files, edits them, runs commands like your tests, reads the results and keeps going until the job is done. OpenCode runs in the terminal, in a browser or as a desktop app, and all three share the same background service and sessions. This guide covers the desktop app.
A note on old tutorials: OpenCode 2.0 came out in September 2026 and changed a lot. Commands from older guides, such as npm i -g opencode-ai, pressing Tab to switch agents, or /share, no longer match.
Download it. Go to opencode.ai/download and click Download for Windows to get opencode-desktop-win-x64.exe (there is also an ARM64 version). It is a per-user installer, so it doesn't need admin rights, and the app starts on its own when it's done.
Or use winget from a terminal:
winget install --id Anomaly.OpenCode.Desktop -e
You don't need Node: the app ships with its own copy of the engine. You do want Git, because OpenCode uses it to undo changes:
git --version
If you get an error instead of a version number, install Git for Windows first.
On the Home screen, click Add project and choose a project folder, not your whole user folder or your desktop. The agent works inside that folder, and the smaller and cleaner it is, the better the answers.
Make sure the folder is a Git repository with your work committed. If it isn't, run this once:
The model is the AI brain behind the agent. Press Ctrl + ' (Control apostrophe), or click the model name under the prompt, to open Select model.
At the top you'll see Free models provided by OpenCode: Big Pickle, DeepSeek V4.1 Flash Free, Nemotron 3.5 Super VL Free and a few more. They work without an account or a credit card, which makes them perfect for learning. The list changes often, so yours may look different. Big Pickle is enough for everything in this guide.
Warning: free models can keep your prompts. Never paste passwords, API keys or private customer data into them.
For stronger models, type /connect to open Integrations: OpenCode Go (a low cost subscription, from 10 dollars a month), OpenCode Console (pay as you go), ChatGPT through OpenAI, GitHub Copilot, or an API key from Anthropic, Google and many others.
If a model has variants, such as a higher thinking level, Ctrl + Shift + D cycles through them.
The prompt box: type / for commands and @ to point the agent at a file. Under it are a plus button for attachments, the current agent (Build) and the model.
The side pane has three tabs. Review shows every file the agent changed as a diff. Context shows the tokens you've used and what they cost. Terminal is a real shell inside the app.
Ctrl + K (or Ctrl + Shift + P) opens the command palette. Type what you want and it finds it.
Explain this project to me. What does it do, and how is it organized?
The agent shows Explored with the files it read (click it to see every step), then answers. On our demo project, a small Vite + TypeScript habit tracker, it explained the app in about twenty seconds.
To ask about one file, type @ and pick it from the list. The agent reads exactly that file, which is faster and cheaper.
Next, type /init. OpenCode writes AGENTS.md, a short guide for the agent: how to build, how to test and the code style. Every new session reads it first. Fix anything wrong, commit it, and add your own rules at the bottom:
## Rules
- Always run npm test after changing code
- Never touch the dist folder
The demo app had a bug: the streak counter should go up every day you complete a habit, but it was stuck at 1.
For anything bigger than a one-line fix, start with the Plan agent. Press Ctrl + . (Control period). The agent switches from Build to Plan and turns pink.
Build and Plan are the two main agents. Build has full access: it reads, edits and runs commands. Plan can read your code and think, but it can't edit files. That makes it the safe way to explore.
The streak counter in @src/streak.ts never goes above 1. Find out why and propose a fix. Don't change anything yet.
The agent read the file and its tests and found the cause: the function only counted days equal to today, so it could never return more than 1. The plan was to walk back from today one day at a time while the habit was done, and add tests for that.
If the plan is wrong, reply and correct it. Talking is cheap; editing is where mistakes get expensive.
Press Ctrl + . again to switch back to Build, and type:
Go ahead, and run the tests.
Now it edits: streak.ts first, then the test file. When it wants to run npm test, OpenCode stops and shows Permission required.
Allow once runs just this command. Allow always stops asking for this kind of command. Deny blocks it, so the agent has to find another way.
While you're learning, Allow once is the safe habit. In the demo, all 7 tests passed. If one had failed, the agent would read the error, fix its code and run the tests again.
Don't just trust the summary. Press Ctrl + Shift + R to open Review.
Red lines were removed, green lines were added. Read it like a colleague's pull request. The Context tab shows tokens, how full the context window is and the price, which is zero on a free model.
Don't like a change? Type /undo. OpenCode rolls the files back and puts your last prompt back in the box so you can rephrase it. /redo brings it all back. You can also click an earlier message and choose Revert to jump back to that point.
This only works because the project is in Git. Without Git, the agent can't restore your files. And undo is not a backup, so commit your good work. You can do that without leaving the app: start your message with ! and the prompt becomes a shell.
Press Ctrl + T for a fresh session so the old history doesn't get in the way. Then:
Add a dark mode toggle to the header in @src/header.ts. Save the choice in localStorage, and put the styles in the existing CSS file.
While the agent works, you can type a follow-up such as "also add a keyboard shortcut for it". It is queued and runs after the current step, or click Steer to send it right away. When it's done, run npm run dev in the Terminal tab and open localhost:5173 to try it.
The schema line gives you autocomplete in your editor. model sets the default model for new sessions. permissions is a list of rules, and the last rule that matches wins. Here, editing files is allowed but shell commands always ask first.
The external_directory rule matters: in version 2, the agent may read and write files outside your project folder by default. Setting it to ask stops that.
For settings you want in every project, put the same file at C:\Users\YOUR-NAME\.config\opencode\opencode.json. If you edit the config while the app is open, type /reload. Everything else is in Settings (Ctrl + ,): dark or light theme, tabs as a sidebar, and every keyboard shortcut.
Yes. OpenCode is free and open source under the MIT license, and it comes with free models such as Big Pickle that need no account or card. Paid providers like OpenCode Go or an API key are optional.
By default it asks before running shell commands, and you can review every diff. Work inside a Git repository so /undo can restore your files, and keep committing.