Back to news
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:

curl -fsSL https://opencode.ai/install | bash
bash

Launch OpenCode:

opencode
bash

Inside OpenCode, run /connect and pick xAI:

/connect
txt

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.