Skip to content

Grok CLI

If your machine does not have the grok command yet, install Grok Build CLI for your system first. If Grok CLI is already installed, go straight to manual setup.

powershell
irm https://x.ai/cli/install.ps1 | iex

Open a new terminal:

powershell
grok --version

If you are not using CC Switch, update Grok’s config.toml manually. Use the OpenAI-compatible Base URL with /v1, and use a token from the Grok CLI group.

  1. Create and enter the configuration directory.

    cmd
    mkdir %USERPROFILE%\.grok
    cd %USERPROFILE%\.grok
  2. Create or update config.toml.

    Choose an available Grok model from the dynamic model marketplace, then replace <model-id> with the exact model name.

    toml
    [model.custom]
    model = "<model-id>"
    base_url = "https://api.qiuqiutoken.net/v1"
    name = "Qiuqiu"
    api_key = "sk-your-token"
    
    [models]
    default = "custom"
  3. Close all Grok CLI terminal windows, open a new terminal, then start Grok CLI from your project.

    cmd
    cd your-project-folder
    grok inspect
    grok