Use Grok in OpenCode
May 21, 2026
Use Grok in OpenCode
Use your SuperGrok or X Premium subscription inside OpenCode.
---
After connecting your Grok account, start coding with Grok Build, the same model that powers xAI's terminal-based coding agent.
Setup
Install OpenCode:
Copy
curl -fsSL https://opencode.ai/install | bashbash
Launch OpenCode:
Copy
opencodebash
Inside OpenCode, run `/connect` and pick xAI:
Copy
/connecttxt
Pick the sign-in method that fits your setup — both use your Grok subscription:
- xAI Grok OAuth (SuperGrok Subscription) — opens your browser to sign in.
- xAI Grok OAuth (Headless / Remote / VPS) — prints a code and URL for SSH or remote hosts.
More open-source agents and integrations are coming soon.
