Documentation
PolicyCortex CLI Reference: Complete Cloud Governance Commands
Complete command-line interface reference for PolicyCortex CLI tools
Cross-PlatformFull API AccessAutomation ReadyOpen Source
Installation
macOS
Homebrew
$ brew tap policycortex/tap
$ brew install policycortex
Direct Download
$ curl -L https://releases.policycortex.com/cli/latest/macos/policycortex -o policycortex
$ chmod +x policycortex
$ sudo mv policycortex /usr/local/bin/
Linux
Package Manager
$ curl -fsSL https://packages.policycortex.com/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/policycortex.gpg
$ echo "deb [signed-by=/usr/share/keyrings/policycortex.gpg] https://packages.policycortex.com/linux stable main" | sudo tee /etc/apt/sources.list.d/policycortex.list
$ sudo apt update
$ sudo apt install policycortex
Direct Download
$ curl -L https://releases.policycortex.com/cli/latest/linux/policycortex -o policycortex
$ chmod +x policycortex
$ sudo mv policycortex /usr/local/bin/
Windows
Chocolatey
$ choco install policycortex
PowerShell
$ Invoke-WebRequest -Uri https://releases.policycortex.com/cli/latest/windows/policycortex.exe -OutFile policycortex.exe
$ Move-Item policycortex.exe C:\Windows\System32\
Global Options
--help, -h
Show help information
--version, -v
Show CLI version
--verbose
Enable verbose output
--quiet, -q
Suppress output except errors
--config
Path to config file
Example: ~/.policycortex/config.yaml
--no-color
Disable colored output
--json
Output in JSON format
Commands
login
Authenticate with PolicyCortex platform
policycortex login [options]Options
--api-key
Use API key for authentication
Example:
pc_api_key_...
--region
Specify region endpoint
Example:
us-east-1, eu-west-1
--profile
Use named profile
Example:
production, staging
Examples
Login using API key
$ policycortex login --api-key pc_api_key_abcd1234
Login using saved profile
$ policycortex login --profile production
scan
Run policy scans against cloud resources
policycortex scan [target] [options]Options
--provider
Cloud provider (aws, azure, gcp)
Example:
aws
--region
Specific region to scan
Example:
us-east-1
--policy
Specific policy to run
Example:
security-baseline
--format
Output format
Example:
json, yaml, table
--output
Output file path
Example:
./scan-results.json
--severity
Minimum severity level
Example:
high, medium, low
--exclude
Resource types to exclude
Example:
ec2.instances
Examples
Scan all AWS resources in us-east-1
$ policycortex scan aws --region us-east-1
Run security baseline policy on Azure resources
$ policycortex scan azure --policy security-baseline --format json
Scan GCP for high severity issues only
$ policycortex scan gcp --severity high --output ./results.json
policy
Manage policies and policy sets
policycortex policy <subcommand> [options]Subcommands
list
List all policies
show
Show policy details
create
Create new policy
update
Update existing policy
delete
Delete policy
validate
Validate policy syntax
test
Test policy against sample data
Options
--id
Policy ID
Example:
pol_abc123
--name
Policy name
Example:
security-baseline
--file
Policy file path
Example:
./policy.yaml
--format
Output format
Example:
json, yaml, table
Examples
List all policies in table format
$ policycortex policy list --format table
Create policy from file
$ policycortex policy create --file ./new-policy.yaml
Validate policy syntax
$ policycortex policy validate --file ./policy.yaml
report
Generate and manage compliance reports
policycortex report <subcommand> [options]Subcommands
generate
Generate compliance report
list
List available reports
download
Download existing report
schedule
Schedule recurring reports
Options
--type
Report type
Example:
soc2, hipaa, pci-dss
--format
Report format
Example:
pdf, html, json
--period
Reporting period
Example:
30d, 90d, 1y
--output
Output file path
Example:
./compliance-report.pdf
Examples
Generate SOC 2 compliance report in PDF format
$ policycortex report generate --type soc2 --format pdf
List reports from last 30 days
$ policycortex report list --period 30d
config
Manage CLI configuration and profiles
policycortex config <subcommand> [options]Subcommands
list
List configuration settings
set
Set configuration value
get
Get configuration value
unset
Remove configuration value
profiles
Manage named profiles
Options
--profile
Profile name
Example:
production, staging
--global
Set global configuration
Examples
Set API endpoint URL
$ policycortex config set api-endpoint https://api.policycortex.com
Create new profile named production
$ policycortex config profiles create production
integration
Manage cloud provider integrations
policycortex integration <subcommand> [options]Subcommands
list
List configured integrations
add
Add new integration
remove
Remove integration
test
Test integration connectivity
sync
Synchronize integration data
Options
--provider
Cloud provider
Example:
aws, azure, gcp
--name
Integration name
Example:
production-aws
--credentials
Credentials file path
Example:
./aws-creds.json
Examples
Add AWS integration with credentials
$ policycortex integration add aws --name production-aws --credentials ./creds.json
Test AWS integration connectivity
$ policycortex integration test --name production-aws
Additional Resources
Explore more CLI features and integration guides.