##General Questions
###What is OpenCode?
OpenCode is an AI-powered coding assistant that runs in your terminal. It helps you write, debug, refactor, and understand code using advanced language models like Claude, GPT, and Gemini.
###How is OpenCode different from other AI coding tools?
OpenCode is designed specifically for the terminal workflow:
- Native CLI: Built for developers who prefer command-line interfaces
- Multi-model support: Switch between different AI providers seamlessly
- Context-aware: Understands your entire codebase, not just open files
- Extensible: Plugin system for custom integrations
- Privacy-focused: Your code stays on your machine
###Is OpenCode free to use?
OpenCode itself is open source and free. However, you need API keys from AI providers (Anthropic, OpenAI, Google) which have their own pricing. Many providers offer free tiers for personal use.
###Which programming languages does OpenCode support?
OpenCode works with any programming language. It excels at:
- Strong support: JavaScript, TypeScript, Python, Go, Rust, Java, C++
- Good support: Ruby, PHP, Swift, Kotlin, C#, Scala
- Basic support: Any text-based programming language
##Installation & Setup
###What are the system requirements?
- Operating Systems: macOS 10.15+, Linux (most distributions), Windows (WSL2)
- Memory: 512MB RAM minimum
- Storage: 100MB for OpenCode + model cache
- Network: Internet connection for API calls (or local models)
###How do I install OpenCode?
The quickest method:
curl -fsSL https://opencode.ai/install.sh | sh
See our Installation Guide for all installation methods.
###How do I set up my API key?
Set your API key as an environment variable:
# For Claude
export ANTHROPIC_API_KEY="your-key-here"
# For GPT
export OPENAI_API_KEY="your-key-here"
# For Gemini
export GOOGLE_API_KEY="your-key-here"
Add to your shell profile (~/.zshrc or ~/.bashrc) to make it permanent.
###Can I use OpenCode offline?
Yes, with local models through Ollama:
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model
ollama pull codellama
# Use in OpenCode
opencode --model ollama:codellama
##Usage Questions
###How do I start using OpenCode?
- Open your terminal
- Navigate to your project directory
- Run
opencode - Start chatting!
cd my-project
opencode
###How do I reference specific files?
Use @ mentions to reference files:
@src/utils.ts add a function to format dates
@package.json update the version to 2.0.0
###How do I switch between AI models?
During a session:
/model claude-opus-4-20250514
Or start with a specific model:
opencode --model gpt-4o
###How do I undo changes made by OpenCode?
Use the undo command:
/undo
This reverts the last file modification. For multiple undos, use git:
git checkout -- <file>
###Can OpenCode run commands on my system?
Yes, with your approval. OpenCode will ask permission before executing any shell commands. You can configure auto-approval for safe commands in settings.
##Billing & Pricing
###How much does OpenCode cost?
OpenCode is free and open source. You pay only for AI API usage:
| Provider | Model | Approx. Cost | |----------|-------|--------------| | Anthropic | Claude Sonnet | ~$3/1M tokens | | Anthropic | Claude Opus | ~$15/1M tokens | | OpenAI | GPT-4o | ~$5/1M tokens | | OpenAI | GPT-4o-mini | ~$0.15/1M tokens | | Google | Gemini Flash | ~$0.075/1M tokens | | Local | Ollama | Free (your hardware) |
###How can I track my API costs?
Use the cost command during a session:
/cost
Or check your provider's dashboard for detailed billing.
###Are there any usage limits?
Limits depend on your API provider:
- Anthropic: Rate limits based on tier
- OpenAI: Rate limits based on tier and model
- Google: Generous free tier, then pay-as-you-go
##Security & Privacy
###Is my code sent to external servers?
When using cloud models, code context is sent to the AI provider's API. For maximum privacy:
- Use local models via Ollama
- Configure context exclusions
- Use
.opencodeignoreto exclude sensitive files
###How can I exclude sensitive files?
Create .opencodeignore in your project root:
# Exclude sensitive files
.env*
*.pem
*.key
secrets/
credentials/
###Is OpenCode SOC 2 compliant?
For enterprise deployments with compliance requirements, contact us for our enterprise offering with audit logging and compliance features.
###Are my conversations stored?
- Locally: Session history stored in
~/.opencode/history/ - API providers: Check each provider's data retention policy
- OpenCode servers: We don't store any of your code or conversations
##Troubleshooting
###"Command not found" after installation
- Restart your terminal
- Check if binary is in PATH:
bash
which opencode - Add to PATH manually if needed:
bash
export PATH=$PATH:/usr/local/bin
###"API key invalid" error
- Verify your API key is correct
- Check the environment variable:
bash
echo $ANTHROPIC_API_KEY - Ensure no extra whitespace or quotes
###"Context length exceeded" error
Your conversation or file context is too large. Solutions:
- Use
/compactto summarize conversation - Start a new session with
/clear - Switch to a model with larger context (Gemini 2M)
- Exclude unnecessary files from context
###OpenCode is slow
- Check your network: API calls require internet
- Try a faster model: Use Haiku or GPT-4o-mini
- Reduce context: Exclude unnecessary files
- Use local models: Eliminate network latency
###File changes not saved
- Check file permissions
- Verify disk space
- Ensure you're not in read-only mode
- Check if file is locked by another process
##Features
###Does OpenCode support voice input?
Voice input is on our roadmap for 2025. Currently, you can use your OS's voice-to-text feature with OpenCode.
###Can OpenCode generate images or diagrams?
OpenCode focuses on code generation. For diagrams, it can generate:
- Mermaid diagram code
- PlantUML specifications
- ASCII art diagrams
###Does OpenCode have IDE integration?
VS Code and JetBrains extensions are planned for Q1 2025. Currently, OpenCode works best as a standalone terminal tool.
###Can I use OpenCode for team projects?
Yes! OpenCode works with any git repository. Team features like shared configurations are planned for Q2 2025.
##Contributing
###How can I contribute to OpenCode?
We welcome contributions!
- Code: Submit PRs on GitHub
- Documentation: Help improve our docs
- Plugins: Create and share plugins
- Community: Help others on Discord
###Where do I report bugs?
Report issues on our GitHub Issues page. Include:
- OpenCode version (
opencode --version) - Operating system
- Steps to reproduce
- Error messages
###How do I request features?
- Check existing feature requests
- Create a new issue with the "enhancement" label
- Describe your use case and proposed solution
##Getting Help
###Where can I get support?
- Documentation: You're already here!
- Discord: Join our community
- GitHub: Issues and discussions
- Email: support@opencode.ai
###Is there a community?
Yes! Join our active community:
- Discord: Real-time chat and support
- GitHub Discussions: Long-form discussions
- Twitter/X: @OpenCodeAI for updates
- Reddit: r/opencode
##Still Have Questions?
Can't find what you're looking for?
- Search our documentation
- Ask on Discord
- Submit a GitHub issue
- Email us at support@opencode.ai
We're here to help!