OpenCode - Open Source Alternatives to Claude Code
Command lines based agentic code generation apps are the talk of the town. You might have already used Claude Code/OpenAI Code/Google Gemini, etc.
But if you want flexibility of using any model + open source then OpenCode is a good alternative.
How to get started?
You can install it using various means
Installation
Using Homebrew (macOS)
brew install sst/tap/opencode
Using npm
brew install sst/tap/opencode
Using Bash
curl -fsSL https://opencode.ai/install | bash
Login
Once it is installed, you can run the following command to login to your auth provider of choice
opencode auth login
The credentials are configured in
~/.local/share/opencode/auth.json
To know about the supported provider checkout Models.dev which they’re using under the hood.
How to use?
Here is a quick walkthrough by AICodeKing YouTube channel
You can check out source code here 👉 https://github.com/sst/opencode
Happy AI coding!