Install and configure the chunk CLI
The chunk CLI is a developer tool that brings AI-powered code review and remote validation to your local workflow. It works with AI coding agents such as Claude Code, Cursor, and VS Code Copilot.
Some of the things you can do with the chunk CLI include:
-
Mine your team’s GitHub pull request history to generate a team-specific review prompt for AI agents using
chunk build-prompt. -
Validate commands locally or in CircleCI Cloud environments using
chunk validate. -
Install AI agent skills for code review, mutation testing, and CI failure debugging using
chunk skill install. -
Set up pre-commit and session-end hooks that automatically validate in Claude Code using
chunk init.
chunk CLI vs Chunk by CircleCI. The chunk CLI is a local developer tool. It is separate from Chunk by CircleCI, the AI-powered CI/CD assistant in the CircleCI web app.
|
Supported platforms
The chunk CLI supports macOS and Linux on both arm64 and x86_64 architectures. Windows is not supported.
Authentication
After installing the chunk CLI, set credentials for each service you plan to use.
CircleCI
Required for chunk sidecar and chunk task commands.
$ chunk auth set circleci
Enter your CircleCI personal API token when prompted. Generate a personal API token from your User Settings in the CircleCI web app.
Anthropic
Required for chunk build-prompt.
$ chunk auth set anthropic
Enter your Anthropic API key when prompted. Generate an API key from the Anthropic console.
Initialize a project
Run chunk init in your project directory to configure chunk for that project:
$ chunk init
chunk init performs these actions:
-
Detects your build, test, lint, and format commands.
-
Creates a
.chunk/config.jsonfile with the detected commands. -
Generates hook configuration in
.claude/settings.jsonfor Claude Code.
After initialization, chunk validate runs the detected commands and chunk build-prompt mines your GitHub PR history.
The following flags are available:
| Flag | Description |
|---|---|
|
Overwrite an existing |
|
Skip generating hook configuration in |
|
Skip command detection. Creates the config file without running command auto-detection. |
|
Set the project directory. Defaults to the current directory. |