CLI Reference

Pretense CLI

Every command, flag, and example. Grouped by category: Core scanning, Setup, Authentication, and Utility.

Installation

Recommended

curl -fsSL https://pretense.ai/install.sh | sh

See the full install guide for system requirements and uninstall instructions.

Command overview

CommandDescriptionGroup
pretense scanScan files or directories for secrets and high-risk identifiers.Core
pretense scan ciFull repository scan designed for CI pipelines.Core
pretense scan commit-rangeScan only files changed between two commits.Core
pretense scan pre-commitScan only git-staged files.Core
pretense scan pre-pushScan all commits in the push range.Core
pretense reviewAI-powered code review that checks for security issues, mutation coverage gaps, and best practices.Core
pretense initInitialize Pretense in the current repository.Setup
pretense installInstall Pretense git hooks into the current repository.Setup
pretense config listPrint the current resolved configuration as a table.Setup
pretense config getGet the value of a single config field.Setup
pretense config setUpdate a single config value in .Setup
pretense auth loginAuthenticate with Pretense Cloud.Auth
pretense auth logoutRemove stored credentials from ~/.Auth
pretense auth statusShow current authentication status: logged-in user, team, plan tier, and credential expiry.Auth
pretense startStart the Pretense proxy server.Utility
pretense statusCheck whether the proxy is running, which port it is on, mutation count for the current session, and uptime.Utility
pretense updateUpgrade the Pretense CLI to the latest version.Utility
pretense usageShow usage statistics: total mutations, scans, blocked secrets, and audit log size for the current project.Utility
pretense logsStream or view the proxy request log.Utility
pretense ignoreAdd a file, directory, or pattern to .Utility
Core

The primary scanning and review commands. These are the tools you use every day.

pretense scan

Scan files or directories for secrets and high-risk identifiers. Outputs a severity-sorted report. Does not mutate or modify any files.

Usage

pretense scan [path] [options]

Example

pretense scan ./src --severity high

Options

--format <fmt>Output format: text (default), json, csv, sarif
--severity <lvl>Minimum severity to report: low, medium, high, critical
--output <file>Write results to file instead of stdout
--no-colorDisable colored terminal output
pretense scan ci

Full repository scan designed for CI pipelines. Scans all tracked files and produces machine-readable output. Use --exit-code to fail the build on findings.

Usage

pretense scan ci [options]

Example

pretense scan ci --format sarif --output results.sarif --exit-code

Options

--format <fmt>Output format: text, json, sarif, csv (default: text)
--output <file>Write results to file
--severity <lvl>Minimum severity threshold
--exit-codeExit with code 2 if findings match threshold
--baseline <file>Ignore findings present in a baseline SARIF file
pretense scan commit-range

Scan only files changed between two commits. Useful for incremental CI on pull requests.

Usage

pretense scan commit-range <from>..<to> [options]

Example

pretense scan commit-range origin/main..HEAD --exit-code

Options

--format <fmt>Output format: text, json, sarif (default: text)
--exit-codeExit with code 2 if secrets found in changed files
pretense scan pre-commit

Scan only git-staged files. Called automatically by the pre-commit hook. Fast because it only checks files you are about to commit.

Usage

pretense scan pre-commit

Example

pretense scan pre-commit
pretense scan pre-push

Scan all commits in the push range. Called automatically by the pre-push hook.

Usage

pretense scan pre-push

Example

pretense scan pre-push
pretense review

AI-powered code review that checks for security issues, mutation coverage gaps, and best practices. Can output structured results for automation.

Usage

pretense review [path] [options]

Example

pretense review ./src/auth.ts --json

Options

--plainPlain text output (no colors or formatting)
--jsonStructured JSON output for automation
--agentRun in agent mode for interactive review sessions
--prompt-onlyPrint the review prompt without executing it
Setup

Commands for initializing projects, installing hooks, and managing configuration.

pretense init

Initialize Pretense in the current repository. Creates .pretense/ with config, scans the codebase, and builds an initial mutation profile.

Usage

pretense init [options]

Example

cd my-project && pretense init

Options

--forceOverwrite existing .pretense/ config if present
--skip-scanSkip the initial codebase scan
pretense install

Install Pretense git hooks into the current repository. Sets up automatic scanning on every commit or push.

Usage

pretense install --mode <pre-commit|pre-push>

Example

pretense install --mode pre-commit

Options

--mode <mode>Hook type: pre-commit (recommended) or pre-push
pretense config list

Print the current resolved configuration as a table. Shows the merged result of .pretense.yaml, environment variable overrides, and built-in defaults.

Usage

pretense config list

Example

pretense config list
pretense config get

Get the value of a single config field. Accepts dot-notation keys.

Usage

pretense config get <key>

Example

pretense config get proxy.port
pretense config set

Update a single config value in .pretense.yaml. The proxy picks up the change on the next request.

Usage

pretense config set <key> <value>

Example

pretense config set proxy.port 9340
Auth

Commands for authenticating with Pretense Cloud (team dashboard, audit sync, remote policies).

pretense auth login

Authenticate with Pretense Cloud. Opens a browser for OAuth or accepts an API key via --key. Stores credentials in ~/.pretense/credentials.json.

Usage

pretense auth login [options]

Example

pretense auth login

Options

--key <api-key>Authenticate with an API key instead of browser OAuth
pretense auth logout

Remove stored credentials from ~/.pretense/credentials.json. Does not revoke the API key on the server.

Usage

pretense auth logout

Example

pretense auth logout
pretense auth status

Show current authentication status: logged-in user, team, plan tier, and credential expiry.

Usage

pretense auth status

Example

pretense auth status
Utility

Maintenance and informational commands.

pretense start

Start the Pretense proxy server. Routes LLM API traffic through the mutation engine.

Usage

pretense start [options]

Example

pretense start --port 9339

Options

--port <n>Port to listen on (default: 9339)
--backgroundRun proxy as a background daemon
--watchReload config on .pretense.yaml changes
pretense status

Check whether the proxy is running, which port it is on, mutation count for the current session, and uptime.

Usage

pretense status

Example

pretense status
pretense update

Upgrade the Pretense CLI to the latest version. Preserves your configuration and audit database.

Usage

pretense update [options]

Example

pretense update

Options

--version <v>Install a specific version (e.g., --version 0.6.2)
pretense usage

Show usage statistics: total mutations, scans, blocked secrets, and audit log size for the current project.

Usage

pretense usage

Example

pretense usage
pretense logs

Stream or view the proxy request log. Shows every intercepted request with timestamp, provider, mutation count, and latency.

Usage

pretense logs [options]

Example

pretense logs --tail 50

Options

--tail <n>Show last N log entries (default: 100)
--followStream new log entries in real-time
--format <fmt>Output format: text (default), json, ndjson
pretense ignore

Add a file, directory, or pattern to .pretenseignore. Ignored paths are skipped during scans.

Usage

pretense ignore <pattern>

Example

pretense ignore "*.test.ts"

Global flags

These flags work with every command and must be placed before the subcommand name.

FlagShortDescription
--verbose-vEnable verbose logging. Shows every intercepted token, hash computation, and proxy decision.
--config <path>-cPath to a config file other than .pretense.yaml. Useful for testing alternate configurations.
--api-key <key>-kPretense API key for cloud features (audit sync, team dashboard). Can also be set via PRETENSE_API_KEY env var.
--json-jOutput all command results as machine-readable JSON. Useful for scripting and CI pipelines.
--no-color--Disable colored terminal output. Automatically detected when stdout is not a TTY.

Exit codes

All commands follow standard Unix exit code conventions. Use these in shell scripts and CI pipelines.

CodeMeaning
0Success -- command completed without errors
1General error -- see stderr for details
2Secrets detected -- scan found findings above threshold
3Config error -- .pretense.yaml is missing or invalid
4Proxy already running -- pretense start called while proxy is active
5Auth error -- invalid or missing API key for cloud features

Shell completion

Pretense ships tab completion for bash, zsh, and fish. Run the appropriate command once to enable it.

zsh

pretense completion zsh >> ~/.zshrc && source ~/.zshrc

bash

pretense completion bash >> ~/.bashrc && source ~/.bashrc

fish

pretense completion fish > ~/.config/fish/completions/pretense.fish
Was this page helpful?
CLI Reference -- Pretense Docs | Pretense