Skip to content
REFERENCE

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.

This command tree is sourced from the Cobra Use: declarations in faramesh-core/cmd/faramesh/*.go.

  • discover
  • attach
  • coverage
  • gaps
  • suggest
  • run
  • serve
  • stop
  • setup
  • policy
  • audit
  • approvals
  • explain
  • delegate
  • identity
  • credential
  • auth
  • session
  • pack
  • fleet
  • schedule
  • ops
  • provenance
  • onboard
  • verify
  • detect
  • sbom
  • model
  • compliance
  • wizard
  • offboard
  • policy-replay
  • status
  • compensate
  • setup flow, setup uninstall, setup update, setup upgrade
  • policy validate, policy inspect, policy test, policy diff, policy reload
  • audit tail, audit verify, audit compact, audit wal-inspect
  • approvals list, approvals pending, approvals show, approvals watch, approvals history, approvals approve, approvals deny, approvals ui
  • delegate grant, delegate list, delegate revoke, delegate inspect, delegate verify, delegate chain
  • identity status, identity verify, identity trust, identity whoami, identity attest, identity federation, identity trust-level
  • credential status, credential audit, credential vault up, credential vault status, credential vault down, credential vault put
  • session open, session close, session list, session budget, session reset, session inspect, session purpose, session declare
  • pack upgrade, pack status
  • fleet push, fleet kill, fleet list
  • schedule create, schedule list, schedule inspect, schedule cancel, schedule approve, schedule pending, schedule history
  • ops policy-change, ops audit, ops login, ops logout, ops whoami
  • provenance sign, provenance verify, provenance inspect, provenance diff, provenance list
  • verify digest, verify manifest, verify manifest-generate, verify buildinfo, verify signature
  • model register, model verify, model consistency, model list, model alert
  • compliance export, compliance resign, compliance verify-report

All commands support JSON output where implemented, but individual subcommands have their own flag sets and exit codes.

Validate a policy file (FPL or YAML):

Terminal window
faramesh policy validate policies/payment.fpl
# Output:
# ✓ policies/payment.fpl [v1.0] 12 rules agent=payment-processor

With JSON diagnostics:

Terminal window
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 policy
  • 1 — Validation failed

Show compiled policy summary:

policies/payment.fpl
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"

Dry-run a tool call against a policy:

Terminal window
faramesh policy test policies/payment.fpl \
--tool stripe/refund \
--args '{"amount":500}'
# Output:
# Tool: stripe/refund
# Effect: permit
# Reason: rule-stripe-refund-100

With full JSON decision:

Terminal window
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"
# }

Compare two policy versions:

Terminal window
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)

Hot-reload the running daemon’s policy:

Terminal window
faramesh policy reload
# Output:
# Sent SIGHUP to daemon (PID 12345)
# Policy reloaded successfully

Custom data directory:

Terminal window
faramesh policy reload --data-dir /var/lib/faramesh

Behavior:

  • In-flight evaluations complete with old policy
  • New evaluations use reloaded policy
  • No daemon restart required
  • Changes are atomic

Start the Faramesh daemon:

Terminal window
faramesh serve \
--policy policies/production.fpl \
--data-dir /var/lib/faramesh \
--listen-addr 0.0.0.0:5432 \
--log-level info

Common flags:

FlagDescriptionDefault
--policyPolicy file pathrequired
--data-dirData directory for audit/WAL/DB$TMPDIR/faramesh
--listen-addrListen address for SDK127.0.0.1:5432
--log-levelLog verbosity: debug, info, warn, errorinfo
--dpr-hmac-keyHMAC key for approvals (or env var)auto-generate

Advanced flags:

Terminal window
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"

Stream audit log entries:

Terminal window
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 unauthorized

With filtering:

Terminal window
# Filter by effect
faramesh audit tail --filter "effect:deny"
# Filter by tool
faramesh audit tail --filter "tool:stripe/*"
# Filter by timestamp
faramesh audit tail --since 2026-05-11T12:00:00Z --until 2026-05-11T14:00:00Z

Display a single audit record:

Terminal window
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: ✓

Verify audit log integrity:

Terminal window
faramesh audit verify
# Output:
# WAL frames: 1247
# Chain integrity: ✓
# All signatures valid: ✓
# Tamper detection: NONE

Incremental verification:

Terminal window
# Last 100 records only
faramesh audit verify --recent 100
# Records from timestamp
faramesh audit verify --since 2026-05-11T10:00:00Z
# Specific action range
faramesh audit verify --from act_1000 --to act_2000

Export audit log:

Terminal window
# JSON format
faramesh audit export --format json > audit-trail.json
# CSV format
faramesh audit export --format csv > audit-trail.csv
# With public key
faramesh audit export --with-public-key > audit-package.tar.gz

Inspect Write-Ahead Log details:

Terminal window
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 frames

Issue a delegation grant:

Terminal window
faramesh delegate grant supervisor worker \
--scope "stripe/*" \
--ttl 2h
# Output:
# Token: del_eyJmcm9tX2FnZW50Ijoi...
# From: supervisor
# To: worker
# Scope: stripe/*
# Expires: 2026-05-11T16:23:45Z

Verify a delegation token:

Terminal window
faramesh delegate verify del_eyJmcm9t...
# Output:
# Token Valid: ✓
# Scope: stripe/*
# Chain Depth: 2
# Expires: 2026-05-11T16:23:45Z

Show token details:

Terminal window
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: true

List delegations:

Terminal window
faramesh delegate list worker
# Output:
# Delegations involving worker:
# [0] supervisor → worker stripe/* (active, expires 2h)
# [1] worker → processor stripe/refund (active, expires 1h)

Show delegation chain:

Terminal window
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)

Revoke delegations:

Terminal window
faramesh delegate revoke supervisor worker
# Output:
# Revoked 3 active delegations from supervisor to worker

Export cryptographic keys:

Terminal window
# Export DPR public key
faramesh key export dpr
# With metadata
faramesh key export dpr --verbose
# Output:
# Key ID: dpr_key_v1_2026_may
# Algorithm: ed25519
# Created: 2026-05-11T12:00:00Z
# Public: MCowBQYDK2VwAyEA...

Rotate keys:

Terminal window
# Planned rotation
faramesh key rotate dpr --new-schedule monthly
# Emergency rotation
faramesh key rotate dpr --force --emergency

List key material:

Terminal window
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)

Check current workload identity:

Terminal window
faramesh identity status
# Output:
# SPIFFE ID: spiffe://example.org/agent/payment-processor
# Verified: true
# Trust Domain: example.org
# SVID Expires: 2026-05-11T15:23:45Z

Manage trust bundles:

Terminal window
# Show all trust bundles
faramesh identity trust --show-bundles
# Add external org trust bundle
faramesh identity trust \
--domain partner-org.internal \
--bundle /path/to/bundle.pem
# Verify cross-org identity
faramesh identity verify \
--spiffe spiffe://partner-org.internal/agent/partner-agent \
--bundle /path/to/bundle.pem

Backfill Ed25519 signatures:

Terminal window
# Dry-run
faramesh compliance resign --data-dir ~/.faramesh/runtime/data
# Apply
faramesh compliance resign --data-dir ~/.faramesh/runtime/data --apply
# Batch with limit
faramesh compliance resign \
--data-dir ~/.faramesh/runtime/data \
--limit 5000 \
--only-missing \
--apply

Verify compliance status:

Terminal window
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 days

Export metrics:

Terminal window
# Prometheus format
faramesh metrics export --format prometheus
# JSON format
faramesh metrics export --format json
# CloudWatch (send to AWS)
faramesh metrics export --format json | \
aws cloudwatch put-metric-data --namespace Faramesh --metric-data file:///dev/stdin

All commands support:

Terminal window
faramesh [command] \
--help # Show help
--version # Show version
--verbose # Verbose output
--config /path/config # Config file (YAML)

Key environment variables:

Terminal window
# Policy and data
FARAMESH_POLICY=/etc/faramesh/policy.fpl
FARAMESH_DATA_DIR=/var/lib/faramesh
# Identity and credentials
FARAMESH_SPIFFE_ID=spiffe://example.org/agent/my-agent
SPIRE_SOCKET=unix:///run/spire/sockets/agent.sock
FARAMESH_TRUST_DOMAIN=example.org
# Security
FARAMESH_DPR_HMAC_KEY=secret123
FARAMESH_MCP_EDGE_AUTH_BEARER_TOKEN=sk_test_abc123xyz
# Logging
FARAMESH_LOG_LEVEL=info
# Delegation
FARAMESH_DELEGATE_MAX_DEPTH=5
FARAMESH_STANDING_ADMIN_TOKEN=admin_secret
Terminal window
# 1. Edit policy
vim policies/payment.fpl
# 2. Validate
faramesh policy validate policies/payment.fpl
# 3. Test against scenarios
faramesh 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 existing
faramesh policy diff policies/current.fpl policies/payment.fpl
# 5. Reload running daemon
faramesh policy reload
Terminal window
# Check daemon is running
ps aux | grep "faramesh serve"
# View recent decisions
faramesh audit tail --recent 20
# Find all denials
faramesh audit tail --filter "effect:deny"
# Inspect specific decision
faramesh audit show act_abc123
# Verify audit integrity
faramesh audit verify
# Check identity
faramesh identity status
# Export full audit trail
faramesh audit export --format json > full-audit.json
CodeMeaning
0Success
1Command failed / policy invalid
2Usage error
124Command timeout
126Command not executable
127Command not found
255Unknown error

See Installation and Policy Engine.