Optibot CLI — Getting Started and Installation

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 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. Login here or sign up here.

Install

npm install -g @optimalai/optibot

Authentication

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

2. API Key (For Agents & CI/CD)

See the CLI for CI/CD Pipelines guide for headless authentication.

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.
  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 Reference

CommandDescription
optibot loginAuthenticate via browser (OAuth)
optibot logoutLog out and remove saved credentials
optibot reviewReview local uncommitted changes
optibot review -bReview 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 listList all API keys
optibot apikey delete <id>Delete an API key