# CLI

### Install Baz

{% columns %}
{% column %}

#### Native install

Connect with Baz to get the full experience: AI assistant, spec review, better context, and comprehensive code review.

```bash
npm install -g @baz-scm/cli
```

> 💡 **New to Baz?** [Sign up for a free 14-day trial](https://baz.co/login) - no credit card required!
> {% endcolumn %}

{% column %}

#### Bring your own keys (BYOK)

Use your own GitHub Personal Access Token (PAT) and Anthropic token to review any pull request directly.

```bash
npm install -g @baz-scm/cli
GH_TOKEN=your_github_pat ANTHROPIC_TOKEN=your_anthropic_api_key baz
```

{% endcolumn %}
{% endcolumns %}

### Setup and Running Baz

Baz CLI can be run in one of two modes. The mode is determined at runtime based on how you start the CLI.

{% embed url="<https://youtube.com/shorts/WvikvyIb6yY?feature=share>" fullWidth="false" %}

#### Baz Mode

Baz mode connects the CLI to your Baz account and repository context. This mode enables walkthroughs that are aware of linked tickets and specifications.

Run the CLI without tokens.

```bash
baz
```

If you are not authenticated, you will be prompted to sign in to Baz and grant repository access.

#### Token Mode

Token mode runs the CLI using your own credentials without connecting to Baz services.

Both tokens must be provided.

```bash
GH_TOKEN=your_github_pat ANTHROPIC_TOKEN=your_anthropic_key baz
```

This mode supports walkthrough reviews and commenting, but does not include requirement verification from Baz.

### Walkthrough Review

Baz can guide you through a pull request step by step. The walkthrough presents a structured view of the change, highlights what matters, and lets you skip low-impact parts. You can move forward and backward through the review at any time.

You can pause the walkthrough and ask questions about the intent of the change or specific code paths.

{% embed url="<https://youtube.com/shorts/D37tbejTzvw?feature=share>" %}

### Commenting and Review Actions

During the review, you can read existing comments and add new ones directly from the CLI. Comments are posted back to GitHub immediately.

If you have sufficient permissions, you can approve the pull request or merge it from the CLI.

{% embed url="<https://youtube.com/shorts/-6gQHzu6mWw?feature=share>" %}

### Verifying Requirements

In Baz mode, the CLI verifies the pull request against linked requirements. These typically come from tickets or specifications connected in Baz.

The review highlights where the implementation matches the requirements and where it does not, so gaps can be addressed during review.

{% embed url="<https://youtube.com/shorts/9YF8EzXJxKc?feature=share>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.baz.co/code-review/cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
