Build Grok CLI from source

getting started

// what it does

Clone the repository, install dependencies with bun install, compile with bun run build, then bun link to put your local grok on PATH. This is the workflow for modifying the CLI itself or testing an unreleased change.

// shell

$ git clone https://github.com/superagent-ai/grok-cli && cd grok-cli
$ bun install
$ bun run build
$ bun link

// gotcha

The build assumes Bun, and bun link makes the dev build the global grok, shadowing any npm-installed copy. Run bun unlink or reinstall from npm to restore the published version.

// resources