Use Grok in OpenCode | xAI
Back to newsMay 21, 2026<br>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:
bash
curl -fsSL https://opencode.ai/install | bash
Launch OpenCode:
bash
opencode
Inside OpenCode, run /connect and pick xAI :
txt
/connect
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.