Skip to main content

Ledger CLI Reference

All Ledger CLI commands are available under the shift-cli ledger namespace.

Global Flags

FlagDescription
--jsonOutput structured JSON (for agent consumption)
--quietSuppress stdout, exit codes only

Events

List audit events

shift-cli ledger events list

JSON output:

shift-cli ledger events list --json
[
{
"id": "l1m2n3o4",
"action": "service.deployed",
"actor": "ci-pipeline",
"resource": "payment-api",
"metadata": {"version": "1.2.3", "environment": "production"},
"timestamp": "2026-03-05T12:00:00.000Z"
}
]

Emit an audit event

shift-cli ledger events emit

Interactive prompts will guide you through providing the action, actor, resource, and optional metadata.

Policies

List retention policies

shift-cli ledger policies list

JSON output:

shift-cli ledger policies list --json
[
{
"id": "r1s2t3u4",
"name": "audit-events-90d",
"retentionDays": 90,
"scope": "ledger.events",
"createdAt": "2026-03-05T12:00:00.000Z"
}
]

Create a retention policy

shift-cli ledger policies create

Interactive prompts will ask for the policy name, retention period in days, and scope.

Classifications

List field classifications

shift-cli ledger classifications list

JSON output:

shift-cli ledger classifications list --json
[
{
"id": "c1d2e3f4",
"serviceId": "a1b2c3d4",
"field": "user.email",
"level": "pii",
"justification": "Contains personally identifiable information",
"createdAt": "2026-03-05T12:00:00.000Z"
}
]

Create a classification

shift-cli ledger classifications create

Interactive prompts will ask for the service ID, field path, classification level, and justification.