# Available commands

This page provides a complete reference for all commands and options available in [**AI Code Reviews in CLI**](https://docs.bito.ai/ai-code-reviews-in-cli/overview). Use it to understand what each command does, when to use it, and how to combine options for common workflows.

### Command structure

```bash
bitoreview <command> [options]
```

For convenience, you can also use the short alias `br` instead of `bitoreview`:

```shellscript
br <command> [options]
```

### Commands overview

|   Command   |                      Description                      |
| :---------: | :---------------------------------------------------: |
|   `review`  | Analyze code changes and generate AI-powered feedback |
|   `config`  |       Manage configuration settings and API keys      |
|   `--help`  |                Display help information               |
| `--version` |           Display the installed CLI version           |

### `review` command

The `review` command is the core of the CLI. It analyzes your code changes and highlights issues related to bugs, security, performance, and overall code quality.

#### Basic syntax

```bash
bitoreview review [files...] [options]
```

#### Examples

```bash
# Review all changes
bitoreview review

# Review specific files
bitoreview review src/app.js src/utils/helper.js

# Review files using glob patterns
bitoreview review "src/**/*.js"

# Review only uncommitted changes
bitoreview review --type uncommitted

# Run a fast, security-focused review
bitoreview review --focus security --mode essential
```

#### Review scope options

**`--type, -t <type>`**

Specify which changes to review.

**Supported values:**

* `all` (default) - Review both committed and uncommitted changes
* `uncommitted` - Review only working directory changes
* `committed --base <branch-name>` - Review only committed changes against the specified base branch.
  * `--base` option is mandatory with this type.

**Examples:**

```bash
bitoreview review --type uncommitted
bitoreview review --type committed --base main
```

**`--base <branch>`**

Compare changes against a specific branch.

**Example:**

```bash
bitoreview review --base main
bitoreview review --base develop
```

**`--base-commit <commit>`**

Compare changes against a specific commit hash.

**Example:**

```bash
bitoreview review --base-commit abc123
```

#### Review quality options

**`--mode <mode>`**

Control the depth and breadth of the review.

**Supported values:**

* `essential` - Shows only HIGH severity issues for rapid feedback
* `comprehensive` (default) - Shows all severity levels for thorough analysis

**Examples:**

```bash
# Quick review
bitoreview review --mode essential

# Thorough review
bitoreview review --mode comprehensive
```

**`--focus <area>`**

Concentrate the review on specific code quality aspects.

**Supported values:**

* `security` - SQL injection, XSS, authentication, data validation
* `performance` - Memory leaks, inefficient algorithms, bottlenecks
* `bugs` - Logic errors, edge cases, runtime issues
* `best-practices` - Code style, design patterns, maintainability
* `tests` - Test coverage, test quality, testability
* `documentation` - Comments, documentation quality, code clarity

**Examples:**

```bash
bitoreview review --focus security
bitoreview review --focus performance --mode essential
```

**`--severity <level>`**

Filter issues by minimum severity level.

**Supported values:**

* `high` - Critical issues that must be fixed
* `medium` - Important issues that should be addressed
* `low` - Minor suggestions and style improvements

**Examples:**

```bash
# Show only high severity issues
bitoreview review --severity high

# Show medium and high severity
bitoreview review --severity medium
```

#### Output options

**`--interactive, -i`**

Enable interactive mode to review and apply fixes one by one.

**Example:**

```bash
bitoreview review --interactive
# or
bitoreview review -i
```

**`--plain`**

Output plain text without colors or formatting, suitable for logs and CI/CD.

**Example:**

```bash
bitoreview review --plain
bitoreview review --plain > review-report.txt
```

**`--prompt-only`**

Minimal output optimized for AI agent integration.

**Example:**

```bash
bitoreview review --prompt-only
```

**`--no-color`**

Disable colored output (similar to `--plain` but retains structure).

**Example:**

```bash
bitoreview review --no-color
```

#### SCM options

**`--scm <type>`**

Override automatic SCM detection.

**Supported values:**

* `git` - Git repository
* `svn` - Subversion repository
* `hg` - Mercurial repository
* `p4` - Perforce repository
* `plain` - No version control (analyze files directly)

**Example:**

```bash
bitoreview review --scm git
bitoreview review --scm plain
```

#### Configuration options

**`--config, -c <path>`**

Use a custom configuration file path instead of `.bitoreview.yaml` in the project root.

**Example:**

```bash
bitoreview review --config .bitoreview-custom.yaml
bitoreview review -c config/bitoreview.yaml
```

**`--api-key <key>`**

Provide API key directly via command line (overrides environment and config file).

**Example:**

```bash
bitoreview review --api-key YOUR_API_KEY_HERE
```

**`--cwd <path>`**

Set the working directory for the review.

**Example:**

```bash
bitoreview review --cwd /path/to/project
```

#### Debugging options

**`--debug, -d`**

Enable debug output for troubleshooting.

**Example:**

```bash
bitoreview review --debug
bitoreview review -d
```

**`--verbose, -v`**

Enable verbose logging for detailed information.

**Example:**

```bash
bitoreview review --verbose
bitoreview review -v
```

**`--max-retries <number>`**

Set the number of retry attempts for API calls (default: 2).

**Example:**

```bash
bitoreview review --max-retries 5
```

### `config` command

Manage configuration and API keys.

#### Set API key

```bash
bitoreview config set-api-key [key]
```

**Interactive mode** (prompts for key):

```bash
bitoreview config set-api-key
```

**Direct mode** (provide key in command):

```bash
bitoreview config set-api-key YOUR_API_KEY_HERE
```

#### Show API key

Display your configured API key (masked for security).

```bash
bitoreview config show-api-key
```

### Global options

#### `--help, -h`

Display help for any command.

**Examples:**

```bash
bitoreview --help
bitoreview review --help
bitoreview config --help
```

#### `--version`

Show the installed CLI version.

**Example:**

```bash
bitoreview --version
```

### Option combinations

AI Code Reviews in CLI allows you to combine multiple options for precise control:

```bash
# Fast pre-commit security check
bitoreview review --type uncommitted --focus security --mode essential

# Comprehensive performance review against main
bitoreview review --base main --focus performance

# High-severity bugs only in specific files
bitoreview review src/critical/*.js --focus bugs --severity high

# Plain text output for CI/CD with retries
bitoreview review --plain --max-retries 3
```
