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?