Skip to content

OpenCode Desktop + GitHub Copilot


RequirementWhy
GitHub accountRequired for Copilot access — create one free at github.com
GitHub Copilot accessFree for verified students via GitHub Education
OpenCode DesktopThe AI coding application — download below
10 minutesFull setup from scratch

OpenCode Desktop needs Git to access your repositories. You have two options:

Section titled “Option A: GitHub CLI (Recommended for beginners)”

GitHub CLI (gh) includes Git functionality plus GitHub-specific commands. It is simpler to use and has fewer edge cases.

Windows:

Terminal window
winget install GitHub.cli

Or download from: cli.github.com

macOS:

Terminal window
brew install gh

Linux:

Terminal window
sudo apt install gh # Debian/Ubuntu
sudo dnf install gh # Fedora

Verify installation:

Terminal window
gh --version

Authenticate with GitHub:

Terminal window
gh auth login

Follow the prompts:

  1. Choose GitHub.com
  2. Choose HTTPS as protocol
  3. Choose Login with a web browser
  4. Copy the one-time code, press Enter to open browser
  5. Authorize GitHub CLI
  6. Return to terminal — it should confirm success

Install Git if you want the complete version control system — this is what professionals use.

Windows:

  • Download from: git-scm.com
  • Run installer, accept defaults
  • Git Bash will be available in your right-click menu

macOS:

Terminal window
xcode-select --install

Or: brew install git

Linux:

Terminal window
sudo apt install git # Debian/Ubuntu
sudo dnf install git # Fedora

Verify installation:

Terminal window
git --version

Configure your identity (required):

Terminal window
git config --global user.name "Your Name"
git config --global user.email "your.email@xjtlu.edu.cn"

Authenticate with GitHub:

Terminal window
gh auth login # GitHub CLI works for Git auth too

Download: Go to opencode.ai and download the desktop application for your OS.

Install:

  • Windows: Run the .exe installer
  • macOS: Drag to Applications folder
  • Linux: Use the .AppImage or package manager

First launch: Open OpenCode Desktop. You will see a clean interface with a chat panel and project browser.

[Screenshot placeholder — OpenCode Desktop initial screen]


This is where OpenCode Desktop becomes powerful — you get access to premium AI models through Copilot.

In OpenCode Desktop:

  1. Click the Settings icon (⚙️) in the bottom-left
  2. Go to AI Providers or Models tab
  3. Find GitHub Copilot in the list
  4. Click Connect or Authenticate
  5. A browser window opens — sign in to GitHub if prompted
  6. Authorize OpenCode to access Copilot
  7. Return to OpenCode — you should see “Connected”

[Screenshot placeholder — Settings → AI Providers with GitHub Copilot connected]

Select your model:

  • Claude 3.5 Sonnet — excellent for complex reasoning, architecture, and explanations
  • GPT-4o — strong all-rounder, good for code generation
  • Copilot default — uses GitHub’s optimized model

If your repository exists on GitHub:

  1. Click Clone Repository in OpenCode Desktop
  2. Paste your repository URL (e.g., https://github.com/yourteam/yourproject)
  3. Choose a local folder
  4. Click Clone

OpenCode will use your GitHub authentication automatically.

If starting fresh:

  1. Click New Project
  2. Choose a folder on your machine
  3. OpenCode will initialize a Git repository

OpenCode Desktop works through conversation. You describe what you want, it writes the code.

Good prompt patterns:

I am building a cat diary PWA for XJTLU volunteers.
User story: As a volunteer feeder, I want to record
that I fed Xiaobai at 7pm with 100g of dry food,
so that other volunteers can see she has been fed.
Stack: React + Vite + Supabase
Create a form component with:
- Cat selector dropdown (fetch from /api/cats)
- Time picker (default to now)
- Food type and amount fields
- Submit button
Include input validation and error handling.

What OpenCode will do:

  1. Analyze your request
  2. Show a plan (optional — you can ask it to think first)
  3. Write the code across multiple files if needed
  4. Explain what it wrote
  5. Wait for your approval before saving

[Screenshot placeholder — OpenCode Desktop showing code generation]


If you have GitHub Copilot Pro (free for students), OpenCode Desktop can access the Coding Agent — an autonomous AI that works on entire features.

How to use:

  1. Open your project in OpenCode Desktop
  2. In the chat, type: @agent or click the agent icon
  3. Describe the full task with acceptance criteria
  4. The agent will:
    • Create a plan
    • Edit multiple files
    • Run terminal commands
    • Test the output
    • Report back when done

Example agent prompt:

@agent Build a feeding log feature for our cat diary app.
Acceptance criteria:
- Volunteer can select a cat from dropdown
- Form records: cat name, time, food type, amount (grams)
- After submit, confirmation message appears
- Entry appears in the cat's feeding log immediately
Stack: React + Supabase
Database table 'feeding_logs' already exists.
Do not change: the cat profile page or existing styles.

Workflow comparison: OpenCode vs other tools

Section titled “Workflow comparison: OpenCode vs other tools”
TaskOpenCode DesktopGitHub Copilot in VS CodeBrowser-based (Claude, ChatGPT)
Inline completions✗ Chat-based✓ As you type✗ Paste/copy
Multi-file editing✓ Full agent mode✓ Agent mode✗ Manual
Model choice✓ Multiple providers✓ Copilot models only✓ Any model
Standalone app✓ No IDE needed✗ Requires VS Code✓ Browser only
Works in China✓ With Copilot✓ Via VS CodeVaries

ProblemSolution
Copilot not showing in providersMake sure you have Copilot Pro (free for students) — check at github.com/settings/copilot
”Not authenticated” errorRun gh auth login in terminal, then restart OpenCode
Model responses are slowTry switching to Copilot default model — Claude 3.5 Sonnet is powerful but can be slower during peak times
Code does not workRewrite your prompt with more specific acceptance criteria — vague tasks produce vague code
Cannot clone repositoryCheck that you are logged in to GitHub in OpenCode Settings → Accounts

Good fits:

  • You want a clean, focused AI coding interface without IDE complexity
  • You need access to multiple AI models (Claude, GPT-4) through one tool
  • You are working on well-defined features with clear acceptance criteria
  • You want autonomous agent mode for scaffolding new features

Consider alternatives if:

  • You already love VS Code and want inline completions → use GitHub Copilot extension
  • You need heavy refactoring across many files → try Cursor (excellent multi-file editing)
  • You are prototyping UI from images → try TRAE (image-to-code specialist)

See AI Coding Tools for the full comparison.


This site uses anonymous analytics (Microsoft Clarity) to improve course content. No personal data is collected.
Current page
🤖