← OpenCode overview Santhi Prakash

How-to guide

OpenCode: step-by-step

OpenCode is an open-source AI coding agent that operates within the terminal, IDE, or desktop to assist developers using various language models.

Download as PDF ↓
OpenCode screenshot

Step by step

Follow along

  1. 1

    Install OpenCode

    Run 'curl -fsSL https://opencode.ai/install | bash' in your terminal. You can also install via npm ('npm install -g opencode-ai'), Homebrew ('brew install anomalyco/tap/opencode'), or grab a binary from the GitHub releases page.

  2. 2

    Configure a model provider

    Launch OpenCode by running 'opencode' in any project directory. Inside the TUI, type '/connect', select 'opencode' (the OpenCode Zen service), and follow the link to opencode.ai/auth to sign in and get an API key. Alternatively, select any other provider (Anthropic, OpenAI, Google, etc.) and paste your own key.

  3. 3

    Initialize OpenCode for your project

    With OpenCode open in your project directory, run the '/init' command. OpenCode analyzes the codebase and creates an 'AGENTS.md' file at the project root that captures structure and conventions, improving the quality of future suggestions.

  4. 4

    Ask questions about your codebase

    Type a question in plain English — for example, 'How is authentication handled in this project?' — and OpenCode searches the relevant files and explains the code. It has LSP support enabled automatically, so it understands symbols and types.

  5. 5

    Ask OpenCode to make code changes

    Describe the change you want — for example, 'Add a rate-limit middleware to the Express router in src/server.ts' — and OpenCode proposes an edit. Review the diff shown in the TUI and approve or reject it.

  6. 6

    Run multiple sessions in parallel

    OpenCode supports multi-session mode so you can work on separate tasks simultaneously. Open a new session from within the TUI to start a second agent working on a different part of the codebase without losing context from the first.

Best practices

Do it like a pro

Free download

Get the OpenCode guide as a PDF

Keep the full guide — steps, shortcuts and best practices — with you. Drop your email and download it; we'll only send useful AI-building tips.

The PDF is watermarked and carries our links — please share it with the footer intact.

No spam — the PDF downloads instantly.

Ready to try OpenCode?

See OpenCode details & get started →

Latest from our channels

All channels →
Git Basics - Learn Git and Github - Coding Essentials Series

Git Basics - Learn Git and Github - Coding Essentials Series

@ezcademy

How to Optimize Storage in Windows Operating System

How to Optimize Storage in Windows Operating System

@ezcademy

Claim Fast - Bolt, Hostinger and other tools as Bundle offer for 1 year

Claim Fast - Bolt, Hostinger and other tools as Bundle offer for 1 year

@ezcademy

Get Bolt, Hostinger for 1 year as Appsumo Bundle Offer #boltnew #hostinger

Get Bolt, Hostinger for 1 year as Appsumo Bundle Offer #boltnew #hostinger

@ezcademytelugu

BoltNew to Github Repository Sync

BoltNew to Github Repository Sync

@ezcademytelugu

bolt is free for 48 hours in Telugu #hackathon #bolt.new

bolt is free for 48 hours in Telugu #hackathon #bolt.new

@ezcademytelugu

Get Bolt, Pica, Emergent and Hostinger for 1 year as Appsumo Bundle Offer #hostingerpromocode

Get Bolt, Pica, Emergent and Hostinger for 1 year as Appsumo Bundle Offer #hostingerpromocode

@ezcademyhindi

Bolt is free for 48 hours #boltnew #bolthackathon

Bolt is free for 48 hours #boltnew #bolthackathon

@ezcademyhindi

Lovable extended the time for Participation in #lovableshipped

Lovable extended the time for Participation in #lovableshipped

@ezcademyhindi

Claude fable 5 available now in Cursor

Claude fable 5 available now in Cursor

@santhiprakashb

AI Deepfakes - How can you Spot?

AI Deepfakes - How can you Spot?

@santhiprakashb

Mulerun by Alibaba Cloud for your AI Workforce #alibabacloud #openclaw

Mulerun by Alibaba Cloud for your AI Workforce #alibabacloud #openclaw

@santhiprakashb

Git Basics - Learn Git and Github - Coding Essentials Series

Git Basics - Learn Git and Github - Coding Essentials Series

@ezcademy

How to Optimize Storage in Windows Operating System

How to Optimize Storage in Windows Operating System

@ezcademy

Claim Fast - Bolt, Hostinger and other tools as Bundle offer for 1 year

Claim Fast - Bolt, Hostinger and other tools as Bundle offer for 1 year

@ezcademy

Get Bolt, Hostinger for 1 year as Appsumo Bundle Offer #boltnew #hostinger

Get Bolt, Hostinger for 1 year as Appsumo Bundle Offer #boltnew #hostinger

@ezcademytelugu

BoltNew to Github Repository Sync

BoltNew to Github Repository Sync

@ezcademytelugu

bolt is free for 48 hours in Telugu #hackathon #bolt.new

bolt is free for 48 hours in Telugu #hackathon #bolt.new

@ezcademytelugu

Get Bolt, Pica, Emergent and Hostinger for 1 year as Appsumo Bundle Offer #hostingerpromocode

Get Bolt, Pica, Emergent and Hostinger for 1 year as Appsumo Bundle Offer #hostingerpromocode

@ezcademyhindi

Bolt is free for 48 hours #boltnew #bolthackathon

Bolt is free for 48 hours #boltnew #bolthackathon

@ezcademyhindi

Lovable extended the time for Participation in #lovableshipped

Lovable extended the time for Participation in #lovableshipped

@ezcademyhindi

Claude fable 5 available now in Cursor

Claude fable 5 available now in Cursor

@santhiprakashb

AI Deepfakes - How can you Spot?

AI Deepfakes - How can you Spot?

@santhiprakashb

Mulerun by Alibaba Cloud for your AI Workforce #alibabacloud #openclaw

Mulerun by Alibaba Cloud for your AI Workforce #alibabacloud #openclaw

@santhiprakashb