OpenCode Desktop + GitHub Copilot
What you need before starting
Section titled “What you need before starting”| Requirement | Why |
|---|---|
| GitHub account | Required for Copilot access — create one free at github.com |
| GitHub Copilot access | Free for verified students via GitHub Education |
| OpenCode Desktop | The AI coding application — download below |
| 10 minutes | Full setup from scratch |
Step 1 — Install Git or GitHub CLI
Section titled “Step 1 — Install Git or GitHub CLI”OpenCode Desktop needs Git to access your repositories. You have two options:
Option A: GitHub CLI (Recommended for beginners)
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:
winget install GitHub.cliOr download from: cli.github.com
macOS:
brew install ghLinux:
sudo apt install gh # Debian/Ubuntusudo dnf install gh # FedoraVerify installation:
gh --versionAuthenticate with GitHub:
gh auth loginFollow the prompts:
- Choose GitHub.com
- Choose HTTPS as protocol
- Choose Login with a web browser
- Copy the one-time code, press Enter to open browser
- Authorize GitHub CLI
- Return to terminal — it should confirm success
Option B: Git (Full version control)
Section titled “Option B: Git (Full version control)”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:
xcode-select --installOr: brew install git
Linux:
sudo apt install git # Debian/Ubuntusudo dnf install git # FedoraVerify installation:
git --versionConfigure your identity (required):
git config --global user.name "Your Name"git config --global user.email "your.email@xjtlu.edu.cn"Authenticate with GitHub:
gh auth login # GitHub CLI works for Git auth tooStep 2 — Install OpenCode Desktop
Section titled “Step 2 — Install OpenCode Desktop”Download: Go to opencode.ai and download the desktop application for your OS.
Install:
- Windows: Run the
.exeinstaller - macOS: Drag to Applications folder
- Linux: Use the
.AppImageor 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]
Step 3 — Connect GitHub Copilot
Section titled “Step 3 — Connect GitHub Copilot”This is where OpenCode Desktop becomes powerful — you get access to premium AI models through Copilot.
In OpenCode Desktop:
- Click the Settings icon (⚙️) in the bottom-left
- Go to AI Providers or Models tab
- Find GitHub Copilot in the list
- Click Connect or Authenticate
- A browser window opens — sign in to GitHub if prompted
- Authorize OpenCode to access Copilot
- 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
Step 4 — Open or clone your project
Section titled “Step 4 — Open or clone your project”If your repository exists on GitHub:
- Click Clone Repository in OpenCode Desktop
- Paste your repository URL (e.g.,
https://github.com/yourteam/yourproject) - Choose a local folder
- Click Clone
OpenCode will use your GitHub authentication automatically.
If starting fresh:
- Click New Project
- Choose a folder on your machine
- OpenCode will initialize a Git repository
Step 5 — Start coding with AI
Section titled “Step 5 — Start coding with AI”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 recordthat 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:
- Analyze your request
- Show a plan (optional — you can ask it to think first)
- Write the code across multiple files if needed
- Explain what it wrote
- Wait for your approval before saving
[Screenshot placeholder — OpenCode Desktop showing code generation]
Using the Coding Agent
Section titled “Using the Coding Agent”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:
- Open your project in OpenCode Desktop
- In the chat, type:
@agentor click the agent icon - Describe the full task with acceptance criteria
- 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 + SupabaseDatabase 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”| Task | OpenCode Desktop | GitHub Copilot in VS Code | Browser-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 Code | Varies |
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Copilot not showing in providers | Make sure you have Copilot Pro (free for students) — check at github.com/settings/copilot |
| ”Not authenticated” error | Run gh auth login in terminal, then restart OpenCode |
| Model responses are slow | Try switching to Copilot default model — Claude 3.5 Sonnet is powerful but can be slower during peak times |
| Code does not work | Rewrite your prompt with more specific acceptance criteria — vague tasks produce vague code |
| Cannot clone repository | Check that you are logged in to GitHub in OpenCode Settings → Accounts |
When to use OpenCode Desktop
Section titled “When to use OpenCode Desktop”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.
Was this page helpful?