在OpenCode中使用Grok
阅读原文· x.ai把 Grok 搬进 OpenCode 不是啥大新闻,但如果你正好有 SuperGrok 或 X Premium,直接就能在终端里用,算是个挺干净的集成。
xAI宣布,其SuperGrok或X Premium订阅用户现可在开源编程工具OpenCode中使用Grok模型。OpenCode提供终端或独立桌面应用两种形式,用户连接Grok账户后,即可调用驱动xAI终端编程代理的Grok Build模型进行开发。该集成通过xAI Grok OAuth实现认证接入,官方表示未来将推出更多开源代理及集成方案。
Use Grok in OpenCode | xAI
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 | bash
bash
Launch OpenCode:
Copy
opencode
bash
Inside OpenCode, run /connect and pick xAI:
Copy
/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.
Copy dark SVG
Copy light SVG