How to Use OpenCode with Antigravity & GitHub Copilot in VS Code
Learn how to combine OpenCode, Antigravity, and GitHub Copilot for an ultimate AI-assisted coding workflow in VS Code.
Prerequisites
- VS Code installed
- Node.js (v18+) installed
- Git installed
- GitHub account (for Copilot)
- OpenAI/local model access (if required)
1. Introduction to AI-Assisted Coding in VS Code
Are you looking to build the best AI-assisted coding workflow in VS Code? This comprehensive guide will walk you through setting up a powerful tool stack.
What you’ll learn
- How to set up the OpenCode VS Code extension
- How to use Antigravity to automate coding tasks and enhance workflows
- How to integrate GitHub Copilot for seamless inline completions
- How to combine these AI developer tools for maximum productivity
Who this guide is for
- Software engineers and developers using VS Code
- AI-assisted coding beginners & pros looking for an optimized setup
- Developers seeking faster workflows and reduced boilerplate coding
2. What Are These AI Developer Tools?
OpenCode
- Powerful AI-powered coding assistant environment
- Supports both local LLMs and remote AI models for privacy and flexibility
- Significantly enhances developer productivity and code generation
Antigravity
- Advanced AI workflow enhancer and automation layer
- Improves context handling, multi-file awareness, and prompt workflows
- Helps orchestrate complex AI coding tasks efficiently
GitHub Copilot
- Industry-standard real-time AI code completion tool
- Provides context-aware suggestions directly in the editor
- Offers seamless and deep VS Code integration
3. Prerequisites for Your AI Setup
Before proceeding with your VS Code AI extension setup, ensure you have the following ready:
- VS Code installed: The latest version of Visual Studio Code.
- Node.js (v18+) installed: Required for running local environments and dependencies.
- Git installed: For version control and GitHub Copilot synchronization.
- GitHub account: Necessary for activating your GitHub Copilot subscription.
- OpenAI or local model access: Required for OpenCode to function properly if you are running a local LLM setup.
4. Install VS Code Extensions
Let's install the critical components for our AI coding assistant environment.
Step 1: Install OpenCode
- Open VS Code on your machine.
- Go to the Extensions marketplace (Ctrl+Shift+X).
- Search for the OpenCode extension.
- Click Install to add it to your environment.
Step 2: Install Antigravity Extension
- Search for the Antigravity extension in the marketplace.
- Click Install to enable AI workflow automation.
- Reload VS Code to ensure proper initialization.
Step 3: Install GitHub Copilot
- Search for GitHub Copilot.
- Install the official extension provided by GitHub.
- Sign in with your GitHub account to authenticate and activate the tool.
5. Configure OpenCode Settings
Setup API or Local Model
To get the best performance from OpenCode, configure your model settings. Open Settings → OpenCode Config:
{
"model": "local-llm",
"temperature": 0.2,
"maxTokens": 2000
}Connect Local Model (Optional)
If you prefer a local LLM for VS Code to ensure code privacy, you can connect OpenCode to:
- Ollama (ideal for running local models efficiently)
- LM Studio
- Any other compatible Local LLM server
6. Setting Up Antigravity Workflows
Enable Antigravity
- Open the Command Palette in VS Code (Ctrl+Shift+P).
- Search for:
Antigravity: Enable Workspace Intelligenceand execute it.
Create Workflow Template
Automate coding tasks with Antigravity using a custom template. Example:
Task: Generate optimized React component
Context: current file
Rules: performance + clean codeWhat Antigravity Improves
- Enhanced prompt context handling
- Deep multi-file awareness across your project
- Intelligent workflow automation
7. Setting Up GitHub Copilot
Sign In and Authorize
- Click the Copilot icon in your status bar.
- Authorize GitHub to link your subscription.
Enable Smart Suggestions
To maximize your AI-assisted coding workflow, adjust these settings. Go to Settings → Search: Copilot
Enable the following options:
- Inline Suggestions
- Auto Completions
- Context Awareness
8. Using OpenCode + Antigravity + Copilot Together
Recommended Integrated Workflow
Step 1: Use Copilot for:
- Real-time inline suggestions as you type
- Generating boilerplate code quickly
- Fast completion of standard algorithms
Step 2: Use OpenCode for:
- Explaining complex code snippets
- Refactoring logic for better performance
- Generating complete functions from natural language prompts
Step 3: Use Antigravity for:
- Project-wide codebase understanding
- Executing complex prompt workflows and multi-step tasks
- Multi-file AI tasks and large-scale refactoring
9. Practical Example: Building a UI Component
Example: Create an Optimized React Component
GitHub Copilot Action
Start typing your component definition in the editor:
function UserCard({ user }) {Copilot suggests the internal structure and JSX markup automatically.
OpenCode Prompt
Highlight the code and use OpenCode to refine it:
"Optimize this component and add accessibility improvements (ARIA roles)."
Antigravity Workflow
Execute an Antigravity task to ensure project consistency:
Analyze project UI patterns in the /components directory and ensure this new UserCard design matches our global styling consistency.
10. Pro Tips to Improve Developer Productivity
Maximize your efficiency with these best practices:
- Speed: Rely on Copilot for immediate keystroke predictions.
- Depth: Leverage OpenCode for deep AI assistance and architectural planning.
- Automation: Use Antigravity for intelligent workflow automation across multiple files.
- Precision: Keep your AI prompts highly specific and context-aware.
- Privacy: Integrate local LLMs with OpenCode for handling sensitive, proprietary codebases.
11. Troubleshooting Your AI Setup
Copilot is not suggesting code
- Check your GitHub login status in the VS Code accounts menu.
- Ensure that inline suggestions are enabled in the Copilot extension settings.
OpenCode not responding to prompts
- Verify your AI API key or ensure your local model connection (like Ollama) is actively running on the correct port.
Antigravity automation failing
- Reload the VS Code workspace window.
- Verify that the Antigravity workspace intelligence mode is fully enabled.
12. When Should You Use This AI Tool Stack?
This combined ecosystem is perfect for:
- Navigating and managing large-scale projects
- Enhancing team collaboration through consistent AI usage
- Rapid prototyping of MVPs and new features
- Comprehensive AI-assisted software development
- Automating clean code refactoring and technical debt reduction
13. Conclusion
Using OpenCode alongside Antigravity and GitHub Copilot establishes the ultimate AI coding assistant environment. This setup allows you to leverage the strengths of each individual tool.
By integrating these extensions, you benefit from:
- Unmatched typing speed and pattern recognition from GitHub Copilot
- Contextual intelligence and refactoring capabilities from OpenCode
- Orchestration and task automation from Antigravity
Ultimately, investing time into this VS Code AI extension setup will dramatically improve developer productivity and code quality across all your software projects.
Frequently Asked Questions
Can I use OpenCode without GitHub Copilot?
Yes, OpenCode works completely independently. You can use it as a standalone AI coding assistant with local LLMs or remote models.
Is the Antigravity extension necessary for this setup?
While not strictly required, Antigravity significantly improves workflow automation and multi-file context handling, making it highly recommended for power users.
Does this AI coding workflow work offline?
Yes! If you configure OpenCode to use a local LLM for VS Code (like Llama 3 via Ollama), you can generate code and run prompts entirely offline. However, GitHub Copilot requires an internet connection.
