CLI Reference
Complete reference for all FaraCore command-line interface commands.
Server Commands
faracore serve
Start the FaraCore server.
faracore serveOptions:
- Server starts on
http://127.0.0.1:8000by default - Configure host/port via
FARA_API_HOSTandFARA_API_PORT
faracore migrate
Initialize or migrate the database schema.
faracore migrateCreates tables and applies migrations. Works for both SQLite and PostgreSQL.
Action Commands
faracore list
List all actions.
faracore listDisplays actions in a table format with ID, agent, tool, operation, and status.
faracore get <action-id>
Get details of a specific action.
faracore get abc123Shows full action details including parameters, decision, reason, and status.
faracore allow <action-id>
Approve an action.
faracore allow abc123Approves a pending action. Requires the approval token if authentication is enabled.
faracore deny <action-id>
Deny an action.
faracore deny abc123Denies a pending action. Requires the approval token if authentication is enabled.
Policy Commands
faracore policy-validate <file>
Validate a policy YAML file.
faracore policy-validate policies/default.yamlChecks policy syntax and reports any errors. Exit code 0 if valid, 1 if invalid.
faracore policy-test <file>
Test how a policy evaluates a sample action.
# Create test-action.json
{
"tool": "shell",
"operation": "run",
"params": {"cmd": "ls -la"},
"context": {"agent_id": "test"}
}
# Test it
faracore policy-test test-action.jsonEvaluates the action against the current policy and shows the decision, reason, and risk level.
faracore policy-refresh
Reload the policy file without restarting the server.
faracore policy-refreshReloads the policy from the configured file path (FARA_POLICY_FILE or default location).
Environment Variables
CLI commands respect these environment variables:
FARA_API_BASE- API base URL (default:http://127.0.0.1:8000)FARA_AUTH_TOKEN- Bearer token for authenticationFARA_DB_BACKEND- Database backend: "sqlite" or "postgres"FARA_POSTGRES_DSN- PostgreSQL connection stringFARA_SQLITE_PATH- SQLite database file pathFARA_POLICY_FILE- Policy file path
Examples
Start server and submit action
# Terminal 1: Start server
faracore serve
# Terminal 2: Submit action via API
curl -X POST http://127.0.0.1:8000/v1/actions \
-H "Content-Type: application/json" \
-d '{"agent_id":"test","tool":"shell","operation":"run","params":{"cmd":"ls"}}'
# Terminal 2: List actions
faracore list
# Terminal 2: Approve action
faracore allow <action-id>Validate and test policy
# Validate policy
faracore policy-validate policies/default.yaml
# Test policy with sample action
echo '{"tool":"shell","operation":"run","params":{"cmd":"ls"}}' > test.json
faracore policy-test test.json