CLI Reference
Complete reference for faramesh command-line interface including policy, audit, delegation, and daemon management.
The Faramesh CLI provides tools for policy management, daemon control, audit inspection, identity verification, and pack/runtime lifecycle management.
Verified Command Tree
Section titled “Verified Command Tree”This command tree is sourced from the Cobra Use: declarations in faramesh-core/cmd/faramesh/*.go.
Top-level commands
Section titled “Top-level commands”discoverattachcoveragegapssuggestrunservestopsetuppolicyauditapprovalsexplaindelegateidentitycredentialauthsessionpackfleetscheduleopsprovenanceonboardverifydetectsbommodelcompliancewizardoffboardpolicy-replaystatuscompensate
Selected subcommands
Section titled “Selected subcommands”setup flow,setup uninstall,setup update,setup upgradepolicy validate,policy inspect,policy test,policy diff,policy reloadaudit tail,audit verify,audit compact,audit wal-inspectapprovals list,approvals pending,approvals show,approvals watch,approvals history,approvals approve,approvals deny,approvals uidelegate grant,delegate list,delegate revoke,delegate inspect,delegate verify,delegate chainidentity status,identity verify,identity trust,identity whoami,identity attest,identity federation,identity trust-levelcredential status,credential audit,credential vault up,credential vault status,credential vault down,credential vault putsession open,session close,session list,session budget,session reset,session inspect,session purpose,session declarepack upgrade,pack statusfleet push,fleet kill,fleet listschedule create,schedule list,schedule inspect,schedule cancel,schedule approve,schedule pending,schedule historyops policy-change,ops audit,ops login,ops logout,ops whoamiprovenance sign,provenance verify,provenance inspect,provenance diff,provenance listverify digest,verify manifest,verify manifest-generate,verify buildinfo,verify signaturemodel register,model verify,model consistency,model list,model alertcompliance export,compliance resign,compliance verify-report
All commands support JSON output where implemented, but individual subcommands have their own flag sets and exit codes.
Policy Commands
Section titled “Policy Commands”Policy Validate
Section titled “Policy Validate”Validate a policy file (FPL or YAML):
faramesh policy validate policies/payment.fpl
# Output:# ✓ policies/payment.fpl [v1.0] 12 rules agent=payment-processorWith JSON diagnostics:
faramesh policy validate policies/payment.fpl --json
# Output:# {# "path": "policies/payment.fpl",# "format": "fpl",# "agent_id": "payment-processor",# "rule_count": 12,# "warnings": [],# "errors": [],# "ok": true# }Exit codes:
0— Valid policy1— Validation failed
Policy Inspect
Section titled “Policy Inspect”Show compiled policy summary:
faramesh policy inspect policies/payment.fpl
# Output:# version : v1.0# agent-id : payment-processor# fpl : 1.0# rules : 12# tools : 3 declared# default : deny
# Rules:# permit rule-stripe-charge-500 tool=stripe/charge when="args.amount <= 500"# permit rule-stripe-refund-100 tool=stripe/refund when="args.amount <= 100"# defer rule-large-refund tool=stripe/refund when="args.amount > 100"Policy Test
Section titled “Policy Test”Dry-run a tool call against a policy:
faramesh policy test policies/payment.fpl \ --tool stripe/refund \ --args '{"amount":500}'
# Output:# Tool: stripe/refund# Effect: permit# Reason: rule-stripe-refund-100With full JSON decision:
faramesh policy test policies/payment.fpl \ --tool stripe/refund \ --args '{"amount":500}' \ --json
# Output:# {# "call_id": "policy-test",# "effect": "permit",# "reason": "rule-stripe-refund-100",# "tool_id": "stripe/refund",# "args": {"amount": 500},# "timestamp": "2026-05-11T14:23:00Z"# }Policy Diff
Section titled “Policy Diff”Compare two policy versions:
faramesh policy diff policies/v1.fpl policies/v2.fpl
# Output:# Rules added:# + rule-new-payment-method permit payment/card## Rules removed:# - rule-old-deprecated deny shell/*## Rules modified:# ~ rule-stripe-charge (ceiling changed: approval -> none)Policy Reload
Section titled “Policy Reload”Hot-reload the running daemon’s policy:
faramesh policy reload
# Output:# Sent SIGHUP to daemon (PID 12345)# Policy reloaded successfullyCustom data directory:
faramesh policy reload --data-dir /var/lib/farameshBehavior:
- In-flight evaluations complete with old policy
- New evaluations use reloaded policy
- No daemon restart required
- Changes are atomic
Daemon Commands
Section titled “Daemon Commands”Start the Faramesh daemon:
faramesh serve \ --policy policies/production.fpl \ --data-dir /var/lib/faramesh \ --listen-addr 0.0.0.0:5432 \ --log-level infoCommon flags:
| Flag | Description | Default |
|---|---|---|
--policy | Policy file path | required |
--data-dir | Data directory for audit/WAL/DB | $TMPDIR/faramesh |
--listen-addr | Listen address for SDK | 127.0.0.1:5432 |
--log-level | Log verbosity: debug, info, warn, error | info |
--dpr-hmac-key | HMAC key for approvals (or env var) | auto-generate |
Advanced flags:
faramesh serve \ --policy policy.fpl \ --spiffe-socket unix:///run/spire/sockets/agent.sock \ --trust-domain example.org \ --delegate-max-depth 5 \ --delegate-store sqlite \ --mcp-proxy-port 19092 \ --mcp-target http://127.0.0.1:8080 \ --mcp-edge-auth-mode bearer \ --mcp-edge-auth-bearer-token "$AUTH_TOKEN"Audit Commands
Section titled “Audit Commands”Audit Tail
Section titled “Audit Tail”Stream audit log entries:
faramesh audit tail
# Output:# 2026-05-11T14:23:00Z decision stripe/charge permit args.amount=500# 2026-05-11T14:23:15Z approval stripe/refund deferred finance@example.com# 2026-05-11T14:23:30Z decision shell/run deny unauthorizedWith filtering:
# Filter by effectfaramesh audit tail --filter "effect:deny"
# Filter by toolfaramesh audit tail --filter "tool:stripe/*"
# Filter by timestampfaramesh audit tail --since 2026-05-11T12:00:00Z --until 2026-05-11T14:00:00ZAudit Show
Section titled “Audit Show”Display a single audit record:
faramesh audit show act_abc123
# Output:# Action ID: act_abc123# Tool: stripe/refund# Args: { amount: 3000 }# Effect: denied# Reason: exceeds daily budget# Principal: agent-payment-processor# Timestamp: 2026-05-11T14:23:00Z## Cryptographic Status:# record_hash_valid: ✓# signature_valid: ✓Audit Verify
Section titled “Audit Verify”Verify audit log integrity:
faramesh audit verify
# Output:# WAL frames: 1247# Chain integrity: ✓# All signatures valid: ✓# Tamper detection: NONEIncremental verification:
# Last 100 records onlyfaramesh audit verify --recent 100
# Records from timestampfaramesh audit verify --since 2026-05-11T10:00:00Z
# Specific action rangefaramesh audit verify --from act_1000 --to act_2000Audit Export
Section titled “Audit Export”Export audit log:
# JSON formatfaramesh audit export --format json > audit-trail.json
# CSV formatfaramesh audit export --format csv > audit-trail.csv
# With public keyfaramesh audit export --with-public-key > audit-package.tar.gzAudit WAL Inspect
Section titled “Audit WAL Inspect”Inspect Write-Ahead Log details:
faramesh audit wal-inspect
# Output:# Total frames: 1247# Frame size distribution:# 64 bytes: 10 (headers)# 256 bytes: 500 (small records)# 512 bytes: 400 (medium records)# 1024 bytes: 337 (large records)## Version distribution:# WAL v1: 1200 frames# WAL v2: 47 framesDelegation Commands
Section titled “Delegation Commands”Delegate Grant
Section titled “Delegate Grant”Issue a delegation grant:
faramesh delegate grant supervisor worker \ --scope "stripe/*" \ --ttl 2h
# Output:# Token: del_eyJmcm9tX2FnZW50Ijoi...# From: supervisor# To: worker# Scope: stripe/*# Expires: 2026-05-11T16:23:45ZDelegate Verify
Section titled “Delegate Verify”Verify a delegation token:
faramesh delegate verify del_eyJmcm9t...
# Output:# Token Valid: ✓# Scope: stripe/*# Chain Depth: 2# Expires: 2026-05-11T16:23:45ZDelegate Inspect
Section titled “Delegate Inspect”Show token details:
faramesh delegate inspect del_eyJmcm9t...
# Output:# Token: del_eyJmcm9t...# From: supervisor# To: worker# Scope: stripe/*# Issued: 2026-05-11T14:23:45Z# Expires: 2026-05-11T16:23:45Z# Active: trueDelegate List
Section titled “Delegate List”List delegations:
faramesh delegate list worker
# Output:# Delegations involving worker:# [0] supervisor → worker stripe/* (active, expires 2h)# [1] worker → processor stripe/refund (active, expires 1h)Delegate Chain
Section titled “Delegate Chain”Show delegation chain:
faramesh delegate chain processor
# Output (root-to-leaf):# [0] supervisor (issued 2026-05-11 12:00:00, depth=1)# [1] → worker (issued 2026-05-11 13:00:00, depth=2)# [2] → processor (issued 2026-05-11 14:00:00, depth=3)Delegate Revoke
Section titled “Delegate Revoke”Revoke delegations:
faramesh delegate revoke supervisor worker
# Output:# Revoked 3 active delegations from supervisor to workerKey Commands
Section titled “Key Commands”Key Export
Section titled “Key Export”Export cryptographic keys:
# Export DPR public keyfaramesh key export dpr
# With metadatafaramesh key export dpr --verbose
# Output:# Key ID: dpr_key_v1_2026_may# Algorithm: ed25519# Created: 2026-05-11T12:00:00Z# Public: MCowBQYDK2VwAyEA...Key Rotate
Section titled “Key Rotate”Rotate keys:
# Planned rotationfaramesh key rotate dpr --new-schedule monthly
# Emergency rotationfaramesh key rotate dpr --force --emergencyKey List
Section titled “Key List”List key material:
faramesh key list --all
# Output:# Active keys:# dpr_key_v2_2026_june (ed25519)## Deprecated keys:# dpr_key_v1_2026_may (active until 2026-06-11T00:00:00Z)Identity Commands
Section titled “Identity Commands”Identity Status
Section titled “Identity Status”Check current workload identity:
faramesh identity status
# Output:# SPIFFE ID: spiffe://example.org/agent/payment-processor# Verified: true# Trust Domain: example.org# SVID Expires: 2026-05-11T15:23:45ZIdentity Trust
Section titled “Identity Trust”Manage trust bundles:
# Show all trust bundlesfaramesh identity trust --show-bundles
# Add external org trust bundlefaramesh identity trust \ --domain partner-org.internal \ --bundle /path/to/bundle.pem
# Verify cross-org identityfaramesh identity verify \ --spiffe spiffe://partner-org.internal/agent/partner-agent \ --bundle /path/to/bundle.pemCompliance Commands
Section titled “Compliance Commands”Compliance Resign
Section titled “Compliance Resign”Backfill Ed25519 signatures:
# Dry-runfaramesh compliance resign --data-dir ~/.faramesh/runtime/data
# Applyfaramesh compliance resign --data-dir ~/.faramesh/runtime/data --apply
# Batch with limitfaramesh compliance resign \ --data-dir ~/.faramesh/runtime/data \ --limit 5000 \ --only-missing \ --applyCompliance Check
Section titled “Compliance Check”Verify compliance status:
faramesh compliance check
# Output:# ✓ Ed25519 key exists and protected (0600)# ✓ All records have valid signatures (1247/1247)# ✓ No deprecated key usage in last 30 days# ✓ WAL backup completed: 2h ago# ✓ Public key exported for audit: 2026-05-11# ✓ Key rotation schedule active (annual)# ✓ HMAC key rotation due in: 45 daysMetrics Commands
Section titled “Metrics Commands”Metrics Export
Section titled “Metrics Export”Export metrics:
# Prometheus formatfaramesh metrics export --format prometheus
# JSON formatfaramesh metrics export --format json
# CloudWatch (send to AWS)faramesh metrics export --format json | \ aws cloudwatch put-metric-data --namespace Faramesh --metric-data file:///dev/stdinGlobal Flags
Section titled “Global Flags”All commands support:
faramesh [command] \ --help # Show help --version # Show version --verbose # Verbose output --config /path/config # Config file (YAML)Environment Variables
Section titled “Environment Variables”Key environment variables:
# Policy and dataFARAMESH_POLICY=/etc/faramesh/policy.fplFARAMESH_DATA_DIR=/var/lib/faramesh
# Identity and credentialsFARAMESH_SPIFFE_ID=spiffe://example.org/agent/my-agentSPIRE_SOCKET=unix:///run/spire/sockets/agent.sockFARAMESH_TRUST_DOMAIN=example.org
# SecurityFARAMESH_DPR_HMAC_KEY=secret123FARAMESH_MCP_EDGE_AUTH_BEARER_TOKEN=sk_test_abc123xyz
# LoggingFARAMESH_LOG_LEVEL=info
# DelegationFARAMESH_DELEGATE_MAX_DEPTH=5FARAMESH_STANDING_ADMIN_TOKEN=admin_secretCommon Workflows
Section titled “Common Workflows”Policy Development
Section titled “Policy Development”# 1. Edit policyvim policies/payment.fpl
# 2. Validatefaramesh policy validate policies/payment.fpl
# 3. Test against scenariosfaramesh policy test policies/payment.fpl --tool stripe/charge --args '{"amount":500}'faramesh policy test policies/payment.fpl --tool stripe/charge --args '{"amount":5001}'
# 4. Compare with existingfaramesh policy diff policies/current.fpl policies/payment.fpl
# 5. Reload running daemonfaramesh policy reloadTroubleshooting
Section titled “Troubleshooting”# Check daemon is runningps aux | grep "faramesh serve"
# View recent decisionsfaramesh audit tail --recent 20
# Find all denialsfaramesh audit tail --filter "effect:deny"
# Inspect specific decisionfaramesh audit show act_abc123
# Verify audit integrityfaramesh audit verify
# Check identityfaramesh identity status
# Export full audit trailfaramesh audit export --format json > full-audit.jsonExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Command failed / policy invalid |
| 2 | Usage error |
| 124 | Command timeout |
| 126 | Command not executable |
| 127 | Command not found |
| 255 | Unknown error |
See Also
Section titled “See Also”See Installation and Policy Engine.