Connect Grok

In short

Use Grok in Granular through xAI's official Grok CLI. Install it in one click, sign in with your Grok account (sign-ins last 7 days) or use an xAI key, then pick a model.

Updated 2026-10-20

Granular can run Grok, xAI's AI model, through xAI's official Grok CLI (a command-line agent). You sign in with your Grok account or use an xAI API key, then pick from Grok's models in the model button under the message box.

Before you start

  • A Grok account, or an xAI API key. A free X account works with limited use; X's paid plans raise it. An xAI API key is pay as you go.
  • A Mac with Apple silicon (M1 or newer), or a Windows PC. xAI doesn't make the Grok CLI for Intel Macs. On an Intel Mac, use Grok through OpenCode or Pi with an xAI or OpenRouter key instead.

Set it up

  1. In the row of controls under the message box, click the button that shows your current connection's name.
  2. Click Add your AI agent.
  3. Under Coding agents, click Grok. Its tag says Install, Sign in or Ready.
  4. If the Grok CLI isn't installed yet, a panel says "Grok CLI needs a one-time install". Click Install for me. The install runs in the chat's Terminal tool, and Granular carries on by itself once it's found.
  5. The panel Sign in to Grok appears and Grok's sign-in starts in the Terminal tool. When it's ready, a Finish signing in panel opens your browser. Sign in with your Grok account. If the panel shows a one-time code, enter it on the page (there's a Copy button). If the page didn't open, click Open sign-in page again.
  6. A Grok row appears in your Accounts list and the chat switches to it.

Once you have a Grok account in Granular, the Grok row no longer shows under Add your AI agent.

What you'll see

  • The model button under the message box lists Grok's models. You can search it and pin favourites. See Pick and pin models.
  • When Grok runs a command or changes a file, it uses Granular's terminal and file tools, so you see every command in the Terminal tool and every change in the chat.

Change or undo it

  • Stop using it in a chat: pick another account from the connection button.
  • Hide it: open Settings → AI accounts and click Hide from picker on Grok's card. The Grok CLI stays signed in; Granular just stops showing and using it.
  • Sign out for good: sign out inside the Grok app.

Limits

  • Sign-ins last 7 days. Granular tells you when your Grok sign-in has expired. An xAI API key doesn't expire this way.
  • No Intel Macs. The Grok CLI only runs on Apple-silicon Macs and 64-bit Windows (and Linux, which Granular doesn't run on).
  • Grok's own command and edit tools are refused. Granular keeps every command and change in view, for every engine.
  • New. Grok support is new in 0.6.0. Full replies from a signed-in Grok account haven't been through Granular's complete testing yet. If something looks wrong, switch the chat to another account.

Troubleshooting

If you see "Your Grok sign-in has expired (they last 7 days)"
Grok can't answer until you sign in to it again. Switch the chat to another account from the connection button in the meantime.

If the panel says "Grok CLI isn't available on this computer"
This is an Intel Mac. Use Grok models through OpenCode or Pi with an xAI or OpenRouter key.

If you see "This version of the Grok CLI doesn't understand how Granular starts it"
Run grok update in the terminal, then try again.

If the install finished but Granular can't see the Grok CLI
Click I've installed it - check again in the install panel. If that doesn't find it, quit Granular completely and open it again.

Questions

Can I use Grok as a coding agent in Granular?
Yes. Open Add your AI agent, click Grok under Coding agents, install the Grok CLI if needed, and sign in.
Does a free X account work?
Yes, with limited use. X's paid plans give you more.
Does the Grok CLI work on an Intel Mac?
No. Use Grok through OpenCode or Pi with an xAI or OpenRouter key instead.
Are there other ways to use Grok in Granular?
Yes: through OpenCode or Pi with an xAI or OpenRouter key, as a provider with an xAI key (see Connect other AI providers), or as Grok 4.6 in the AI Add-on.

Related