CLI Overview

The Codity CLI brings AI-powered code review, security scanning, risk analysis, repository chat, test generation, and more directly to your terminal. Run reviews before you push, scan for vulnerabilities locally, plan changes with chat, and generate tests without leaving your workflow.

Installation

Install the Codity CLI with a single command:

curl -fsSL https://cli.codity.ai/install.sh | sh

This script detects your operating system and architecture, downloads the latest release, and places the codity binary in your PATH.

After installation, verify it works:

codity

Quick Start

  1. Authenticate — Link your Codity account:
codity login
  1. Initialize your repo — Generate AI context for better results:
codity init
  1. Index your repo for chat — Make repository context available to Codity:
codity index
  1. Run a review — Review your staged changes:
codity review --staged
  1. Scan for vulnerabilities — Check for security issues:
codity scan --staged
  1. Analyze risk — Check the rollout and regression risk of a change:
codity risk-analysis --staged
  1. Ask questions or plan work — Open interactive chat:
codity chat

Updating

To update the CLI to the latest version:

codity update

Available Commands

CommandDescription
loginAuthenticate with your Codity account
logoutClear stored credentials
initInitialize repository and generate AI context
indexIndex the current repository for workspace chat
chatAsk questions and plan features in an interactive terminal chat
reviewAI-powered code review, with optional full review mode
risk-analysisAnalyze regression, rollout, and blast-radius risk
scanSecurity vulnerability scanning
contextManage project context files
prPull request comment tools
debugGenerate structured debug prompts
clismithNatural language to shell commands
jiraJIRA integration
configView and manage configuration
doctorHealth check for Codity services
updateUpdate CLI to latest version

Global Options

OptionDescription
--jsonOutput machine-readable JSON for supported commands, useful for agents and CI workflows

For combined review, security, and code quality output, see Full Review and JSON Output.

Configuration

The CLI stores configuration in ~/.codity/config.yaml. You can override any setting with environment variables prefixed with CODITY_:

VariableDescription
CODITY_ENVEnvironment (local or production)
CODITY_API_URLOverride API endpoint
CODITY_ACCESS_TOKENJWT access token
CODITY_REFRESH_TOKENRefresh token
CODITY_USER_IDUser ID
CODITY_WORKSPACE_IDWorkspace to operate in
CODITY_AUTH_PROVIDERAuth provider (github, gitlab, etc.)

Getting Help

Every command supports the --help flag:

codity --help
codity review --help
codity chat --help
codity context generate --help