Install & Set Up OpenCode
What is OpenCode?
OpenCode is Cloudflare's AI-powered coding and productivity assistant. It runs in your terminal and connects to the tools you use every day — Google Workspace (Gmail, Calendar, Drive, Docs), Cloudflare's internal wiki, Lighthouse, Radar, and more.
With OpenCode you can research topics, draft documents, search internal data, build and deploy Cloudflare Workers, create presentations, and automate repetitive tasks — all without writing code. It's the primary AI tool used across the strategy team.
Installation
Follow the step-by-step guide to install OpenCode on your Mac, authenticate with your Cloudflare account, set up the MCP portal, and verify everything is working.
Open installation guide ↗Get Started
Opening OpenCode
Each time you want to use OpenCode, follow these steps:
Open Terminal
Open the Terminal app on your Mac.
Authenticate with the MCP Portal
Run these two commands to connect OpenCode to your Cloudflare tools. You don't need to do this every time — access to the MCP portal lasts for approximately a day before you'll need to reauthenticate.
opencode auth login https://opencode.cloudflare.dev opencode mcp auth cf-portal Launch OpenCode
Type this in your terminal to open OpenCode:
opencode Quick Tips
Press TAB to switch between Build and Plan mode
Build mode lets OpenCode read, write, and edit files and run commands. Plan mode is read-only — OpenCode can research and analyze but won't make any changes. Use Plan mode when you want to think through a problem before committing to changes.
Press Ctrl+P to switch models and sessions
Opens the command palette where you can switch between AI models (Claude, GPT, etc.), start new sessions, or resume previous ones.
Type /skills to browse your installed skills
Lists all the skills you have installed and lets you see what each one does.
Type /compact to summarize the conversation
Condenses the conversation history into a summary, freeing up space in the context window. Especially useful when your session is approaching ~75% capacity — instead of starting a new session and losing context, compacting lets you keep going.
Drag and drop files or images into the terminal
You can share files, screenshots, or images directly with OpenCode by dragging them into the terminal window.
Experiment with different models
OpenCode gives you access to dozens of LLMs from Anthropic, OpenAI, Google, and Cloudflare's Workers AI. The default model is Kimi K2.6, which works well for straightforward requests. As your tasks get more complex, switch to a more capable model — Claude Opus 4.6 is one of the most sophisticated and handles nuanced research, multi-step workflows, and detailed analysis significantly better. Try the same prompt on different models to see the difference. Switch anytime with Ctrl+P.
Learn More
Use OpenCode School as an additional resource to learn more about how to use OpenCode — from basic prompting to advanced skills, MCP integrations, and building workflows.
Go to OpenCode School ↗Install Skills
What is a Skill?
Skills are pre-built instruction sets that give OpenCode specialized knowledge and capabilities for specific tasks. When you install a skill, OpenCode gains expertise in that domain — it knows the right tools to use, the right format to follow, and the right context to apply. Without skills, OpenCode is a general-purpose assistant. With the right skills installed, it becomes a domain expert.
For example, the Strategic Proposal Generator skill knows how to research a company, structure a proposal, and generate a polished deck. The Lighthouse skill knows how to query Cloudflare's internal analytics platform. Each skill turns a complex multi-step workflow into a single prompt.
How to Install a Skill
Before installing skills, make sure OpenCode is in Build mode (press TAB to switch) and the model is set to Claude Opus 4.6 (press Ctrl+P to change). Then run this command for each skill, replacing the name and URL:
Install the __name_of_skill__ globally from __repo_URL__