CLI Command Reference

Complete command-line interface documentation for scandrix review, rules, dryrun, and authentication.

The scandrix command-line interface provides developers and CI/CD pipelines with local access to the AST parsing engine and rule evaluation pipeline.

Global flags

All commands accept the following global options:

FlagShorthandDescription
--api-url <url>-uOverride backend API gateway URL (default: https://api.scandrix.dev or http://localhost:8080).
--token <key>-tProvide Team API Key (kodus_* or team key) or Bearer JWT token.
--json-jFormat stdout as machine-readable JSON for pipeline consumption.
--quiet-qSuppress non-error output and spinners.
--help-hDisplay contextual help and flag descriptions.

scandrix auth login

Authenticate the local developer terminal with your ScanDrix account:

bash
scandrix auth login
  • Opens the browser to authorize the local CLI session.
  • Stores encrypted credentials in ~/.scandrix/credentials.json.

Alternatively, authenticate in headless environments or CI using an environment variable:

bash
export SCANDRIX_API_KEY="kodus_live_abc123456789"

scandrix review

Run a code review on local changes, staged files, or git branch comparisons:

bash
# Review staged git changes before committing
scandrix review --staged

# Review the entire working tree (uncommitted + untracked)
scandrix review --all

# Compare the current branch against main
scandrix review --base main

# Set minimum exit-code failure threshold
scandrix review --staged --fail-on critical

Exit codes

  • 0: Clean review, or only warnings/informational suggestions.
  • 1: Critical rule violation found when --fail-on critical is set.
  • 2: Network, authentication, or syntax parsing failure.

scandrix rules

Manage and inspect custom Drixy rules:

bash
# List all active rules for the current repository
scandrix rules list

# Validate the YAML syntax of a local rule definition
scandrix rules validate ./rules/no-raw-sql.yaml

# Download organization rule catalog to local cache
scandrix rules sync

scandrix dryrun

Simulate a rule without applying review comments:

bash
scandrix dryrun --rule ./rules/my-rule.yaml --base main