Home Optibot CLI Optibot CLI - Getting started and installation

Optibot CLI - Getting started and installation

Last updated on Mar 17, 2026

The Optibot CLI expands Optibot’s capabilities by letting Optibot be used by both humans and agents through a terminal or virtual environment of choice.

The CLI is available directly through npm js as a published package and is regularly updated and maintained by the Optimal AI Engineering Team.

Requirements for Installation

  • Node 20.0.0 or above

  • Git

  • Windows/Mac/Linux

  • A paid or trial subscription to Optibot (existing or new Optibot users with paid subscriptions can simply sign up and they'll be automatically enrolled into their existing organization). You can login here or sign up here for an account.

Install

npm install -g @optimalai/optibot

Authentication

In order to make use of Optibot's CLI we support two authentication methods:

1. Browser-Based OAuth (Recommended for Interactive Use)

Best for local development and interactive CLI usage:

optibot login

This will:

  • Open your browser for login

  • Automatically save your credentials

  • Token expires after 90 days

Use this when:

  • Setting up CLI on your local machine

  • You have browser access

  • Interactive development workflow

How to Use the CLI

# Review local uncommitted changes
optibot review

# Review against the auto-detected base branch (origin/main, origin/master, or origin/develop)
optibot review -b

# Review changes against a specific branch
optibot review --branch origin/main

# Review an arbitrary diff file
optibot review --diff changes.patch

Branch Review

When using -b / --branch, the CLI will:

  1. Auto-detect the base branch if no branch name is provided. It checks for origin/main, origin/master, and origin/develop in that order.

  2. Check for merge conflicts before submitting the review. If conflicts are detected with the target branch, a warning is displayed. The review still proceeds, but results may not reflect the final merged state.

  3. Generate a diff and collect file contents for the review.

Review Output

After each review, the CLI displays:

  • Review Summary — general comments about the changes

  • File Comments — per-file feedback with line numbers

  • Rate limit info — reviews used, remaining quota, and time until reset. The display is color-coded:

    • Dim when usage is normal

    • Yellow when less than 10% of reviews remain

    • Red when the quota is exhausted

Commands

Command | Description

optibot login | Authenticate via browser (OAuth)

optibot logout | Log out and remove saved credentials

optibot review | Review local uncommitted changes

optibot review -b | Review against auto-detected base branch

optibot review -b <branch> | Review against a specific target branch

optibot review -d <file> | Review a diff file

optibot apikey create <name> | Create a new API key

optibot apikey list | List all API keys

optibot apikey delete <id> | Delete an API key