# Grok Build

Operate the Grok Build CLI (`grok`), including interactive and headless runs...

- Repository: https://github.com/XiaomiMiMo/MiMo-Code (13741 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add XiaomiMiMo/MiMo-Code --skill grok-build -g -a claude-code -y`
Codex: `npx skills add XiaomiMiMo/MiMo-Code --skill grok-build -g -a codex -y`
Cursor: `npx skills add XiaomiMiMo/MiMo-Code --skill grok-build -g -a cursor -y`
Gemini CLI: `npx skills add XiaomiMiMo/MiMo-Code --skill grok-build -g -a gemini-cli -y`

## Description

Operate the Grok Build CLI (`grok`), including interactive and headless runs, authentication, sessions, worktrees, permissions, sandboxing, MCP servers, plugins, inspection, updates, and automation output. Load only when the user explicitly authorizes this skill or names Grok Build / grok-build. Before any command, confirm the `grok` binary is available; if missing, stop and give install or auth guidance.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Grok Build CLI

Operate Grok Build from a terminal while keeping execution mode, permissions, sandboxing, session state, and output handling explicit.

## Start with Local Evidence

1. Confirm that the CLI is available:

   ```bash
   command -v grok
   grok version
   ```

2. Inspect the installed command before giving version-sensitive advice:

   ```bash
   grok --help
   grok <subcommand> --help
   ```

3. Inspect the configuration discovered for the target workspace when behavior depends on rules, skills, plugins, hooks, or MCP servers:

   ```bash
   grok --cwd /path/to/repo inspect
   grok --cwd /path/to/repo inspect --json
   ```

4. Treat current official documentation and installed help as authoritative when they differ from this bundled reference.

## Choose an Execution Mode

- Run `grok` with no arguments for the interactive TUI.
- Run `grok "<initial prompt>"` to open the TUI with an initial task.
- Run `grok -p "<prompt>"` for one non-interactive turn that prints a result and exits.
- Run `grok agent stdio` for an ACP client that communicates over stdin/stdout.
- Run `grok dashboard` to open the Agent Dashboard.

Prefer headless mode for scripts, CI, bots, and agent orchestration. Prefer ACP only when the caller implements the ACP JSON-RPC lifecycle and consumes `session/update` chunks.

## Authenticate

Use an interactive login on a developer machine:

```bash
grok login
```

Use device-code authentication in headless or remote environments:

```bash
grok login --device-auth
```

Use a locally cached login or provide `XAI_API_KEY` only to the process that needs it. Never print, persist, or commit credentials. Use `grok logout` to clear cached credentials.

## Run Headlessly

Use an explicit working directory and output format:

```bash
grok --no-auto-update \
  --cwd /path/to/repo \
  --sandbox workspace \
  -p "Inspect the repository and explain the failing test." \
  --output-format json
```

Choose output according to the consumer:

The rest: https://github.com/XiaomiMiMo/MiMo-Code/blob/HEAD/packages/cli/src/skill/builtin/.bundle/grok-build/SKILL.md
