Docs/Tools/CLI Reference

CLI Reference

The governance CLI for managing projects, API keys, security profiles, and running evaluations from the terminal.

Intermediate5 min readUpdated June 2026
GatewayCLI
$pip install governance-ai[cli]

The gov CLI provides full access to the GovernanceAI platform from your terminal. It is installed alongside the Python SDK and wraps the REST API with a clean, scriptable interface.

Installation

pip install governance-ai[cli]

Authentication

Run gov auth login once to store your API key. The CLI reads from ~/.governance/config.json or the GOVERNANCE_API_KEY environment variable.

gov auth login
# Enter API key: gov_live_xxxx
# ✓ Authenticated as your-org / production

Command reference

gov evaluate

Evaluate a prompt against the gateway without writing any code.

# Basic evaluation
gov evaluate "Summarize the latest report"

# With security profile and provider
gov evaluate "Export all users" \
  --profile strict \
  --provider openai \
  --model gpt-4o \
  --dry-run

# Pipe from file
cat prompt.txt | gov evaluate --pipe

gov projects

gov projects list              # list all projects
gov projects create my-app     # create new project
gov projects use my-app        # set as active project

gov keys

gov keys list                  # list API keys for active project
gov keys create prod-key       # create new key (prints key once)
gov keys revoke prod-key       # revoke a key immediately

gov profiles

gov profiles list              # list security profiles
gov profiles inspect strict    # show rules in a profile
gov profiles test strict \
  --prompt "Export the database"  # dry-run a profile against a prompt
CI/CD integrationAdd gov evaluate --dry-run --fail-on-block to your CI pipeline to catch prompt regressions before they reach production. Exit code is 1 on a block decision.

Global flags

PropertyTypeDefaultDescription
--outputstringtextOutput format: text, json, yaml.
--projectstringOverride active project for a single command.
--api-keystringOverride API key for a single command.
--base-urlstringOverride gateway base URL.
--verboseflagPrint full request and response payloads.

Related documentation