> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentbees.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok CLI

> xAI's coding CLI (Grok Build) — runs on an xAI API key.

**Grok CLI** (`grok`) is xAI's agentic coding CLI, **Grok Build**. It
authenticates with an **xAI API key** (`XAI_API_KEY`) and talks to the xAI API
by default — no login flow, no endpoint to configure.

## Set it up

<Steps>
  <Step title="Open Admin → Agent LLM">Scroll to the per-agent keys section.</Step>

  <Step title="Add the xAI key (Grok)">
    Paste your xAI API key (from [console.x.ai](https://console.x.ai)). It's **write-only and
    encrypted at rest**, and only needed if you enable the Grok agent.
  </Step>

  <Step title="(Optional) set a model">
    Set a **Grok model** (e.g. `grok-4.6`). It's passed to the CLI per task; leave it blank to use
    Grok's default.
  </Step>
</Steps>

## Using it in a task

Pick **Grok CLI** as the agent in the New Task form. Grok is a full interactive
agent, so a Grok task offers **both** the Chat view and the Terminal — switch
between them with the Developer-view toggle, the same as Claude Code.

<Note>
  An org's **Agent allowlist** controls which CLIs users may launch. If Grok isn't in the allowlist,
  it won't appear in the New Task dropdown.
</Note>

## How it runs

* **Interactive:** the pod launches `grok` inline in the task terminal (no
  fullscreen takeover), authenticated by the injected `XAI_API_KEY`.
* **Headless (pipelines):** Grok runs a single turn with structured JSON output
  (`grok -p … --output-format json`), so a pipeline stage captures a clean result.

<Note>
  Grok defaults to the xAI API, so there's no base URL to set. (An optional custom endpoint is
  supported for enterprise/proxy setups.)
</Note>
