Every week a client or a junior dev on our team asks the same version of the same question: "opencode, Cursor, VS Code + Copilot — which AI coding tool should I actually set up?" The answer is not a brand. It's a workflow decision, and once you understand the difference — which tool edits your files versus which one merely suggests text into a box — you'll stop switching tools and start getting work done.

This is the step-by-step setup guide we give every engineer who joins Info Byte IT Services (IBITS Web). It starts from zero on Windows, gets you a working opencode install in under two minutes, shows you the exact "agent mode" loop we rely on to build real features, and then compares opencode against Cursor and VS Code with the honesty of people who use all three daily. No fluff, no brand loyalty — just the terminal commands.

1. First, the Two-Minute Reality Check

Here's the mental model that stops the confusion before it starts:

  • VS Code does not "do AI." It is an excellent editor. The AI (Copilot, Continue, etc.) is a plugin that suggests code into the text cursor. It helps you write text faster inside files you're already looking at.
  • Cursor is a fork of VS Code that bakes the AI into the editor — chat pane, inline editing, and an agentic mode that can touch multiple files. It's the GUI comfort zone.
  • opencode is the wild child: a terminal-native agentic tool. You point it at a whole project, give it a goal, and it edits files, runs commands, and reports back — autonomously, without a GUI. This is the one that changes how fast a small team ships.

The single most useful sentence: VS Code helps you type; opencode does the work. For a small IT services shop (exactly what we are), the difference is a full feature deployed by lunch versus a stub pasted from a chat window.

2. Step-by-Step: Install opencode on Windows (Under 2 Minutes)

opencode on Windows needs Node.js 18+ because it's published as an npm package (with a standalone binary also available). Here's the exact path:

  1. Get Node.js LTS if you don't have it: winget install OpenJS.NodeJS.LTS — then open a fresh terminal so the PATH updates.
  2. Install opencode globally:npm install -g opencode
  3. Verify it works:opencode --versionIf this prints a version, you're done — step 2 took ~90 seconds.
  4. If it says 'opencode' is not recognized: your npm global bin isn't on PATH. Fix permanently by adding %APPDATA%\npm to your PATH environment variable, or quickly run the standalone binary opencode ships on its releases page.

The npm route is what we standardise on internally — it also keeps the CLI autocompletable in Windows Terminal/PowerShell.

3. Configure the API Key — and Never Paste a Secret into Code

opencode talks to an LLM provider through an API key. The modern, safe way (and the way we set up client machines) is an environment variable, not a config file that can leak into git:

# One-time, PowerShell (session only): $env:ANTHROPIC_API_KEY = "sk-ant-xxxx-your-key" # Permanent: start menu → "Edit environment variables" → New → ANTHROPIC_API_KEY

Then opencode picks up the key automatically. To confirm the whole chain works, run your first zero-cost prompt:

opencode run "list the files in this project"

If it lists real files from your project, your key, your network and your install are all healthy. (Worth noting: opencode run is the "one-shot" mode — great for scripts and CI; the interactive opencode command is what you'll use for real work, and it's covered next.)

Security rule we enforce for every client: keys via environment variables or a secrets manager only — never committed, never in a README, never in a chat screenshot.

4. Your First Real Task: the "Agent Loop" That Actually Ships Features

This is where opencode stops being a novelty. Launch interactive mode in your project root:

opencode

Now give it a real, narrow task. The pattern that reliably works — we call it the IBITS three-line prompt:

# 1. Give it context it can verify: #    "Look at the existing ShopController, then..." # 2. State the concrete change: #    "...create a points-redemption model, controller and view #     that follows the same style, and add the route." # 3. Ask for proof, not promises: #    "...then run php -l on every file you touched."

Why this works: opencode will open the actual files, read the real structure, write the new ones, and run the linter to prove they compile. In the same terminal. That's the whole game — edit, verify, report — and it's why real features get built instead of code snippets.

You can also give it a file path to focus on, approve changes file-by-file, and watch a diff before accepting. The run subcommand lets you script it: opencode run "add a healthcheck route, then run php -l" is a one-liner you can drop into a CI pipeline tomorrow.

5. opencode vs Cursor vs VS Code — the Honest Matrix

We use all three every single weekestr. Here is the decision table we hand to clients instead of a brand pitch:

Where you areWhat opencode wins atWhat Cursor wins atWhat VS Code still wins at
Terminal / remote server (SSH work)yes — it IS the terminalpartial (needs plug-in)no (headless)
Multi-file refactors ("move this to a service")yes — agent edits many filesyes — agent modemanual
Autocomplete while typingno (it's not an editor)yes — best-in-classyes (Copilot/Continue)
Exploring a huge unfamiliar codebasereads fast, asks to edityes — indexed searchyes (search + extensions)
Scriptable / automatable in CIyes — first-class via runlimitedlimited
Graphical debugging UInoyesyes — best debugging

Our practical rule: use opencode for anything that changes more than one file or runs commands; use Cursor/VS Code for reading, exploring and debugging inside one file you're looking at. A healthy setup is all three, not a holy war over one.

6. Troubleshooting the Three Things That Actually Go Wrong

  • "npm install -g opencode" succeeds but the command is missing. → PATH. Add %APPDATA%\npm to PATH, or use the standalone binary from the releases page. Reopen the terminal after.
  • opencode opens but every request errors. → Key not detected. Verify with echo $env:ANTHROPIC_API_KEY in the same terminal. Keys set via one PowerShell window don't exist in another — this trips up new users almost daily.
  • It edits files but doesn't run commands. → Out-of-date version or the project restricts tool access. Run opencode upgrade and check your project's opencode config (the tools/permissions block) — the tool permission settings are where a locked-down agent silently becomes read-only.

7. Wrap-Up: Start With One Concrete Feature

You now have opencode installed, keyed, and one proven task under your belt. The trap is stopping at "it installed" — the tool is only valuable the moment it completes its first real edit. So close this article, open a small experimental project, and give opencode one narrow, finishable task with the three-line prompt. When it makes its first verified file change, you'll understand instantly why agents, not editors, are where the productivity lives.

If your team is evaluating AI-assisted development for real client work — or you just want an experienced pair of hands to build your next IT services site the plugin-free, CodeIgniter 4 way — talk to the IBITS team. We build agent-first, and we'll happily show you how.