CLI Reference

The Rekor CLI (rekor-cli) is the primary interface for human operators and AI agents using tools like Claude Code or Cursor. Install it, authenticate, and start managing data from your terminal.

Installation and Setup

npm install -g rekor-cli
rekor login

After login, the CLI stores your API token in your OS secure credential store. Non-secret settings live in ~/.config/rekor/config.json. When no credential store is available, the token falls back to that same file (mode 0600). You can override credentials with environment variables:

Environment VariablePurpose
REKOR_TOKENOverride the stored API token
REKOR_API_URLOverride the API base URL

Global Flags

These flags work with every command:

FlagDescription
--base <id>Target base ID (required for most commands)
--output <format>Output format: table (default) or json

Use --output json when piping output to other tools or when agents parse results programmatically. Table format is human-readable with formatted columns.

Common Workflows

Setup: base + preview + record_type

rekor bases create my-app --name "My App"
rekor bases create-preview my-app --name "initial-setup"
rekor record-types upsert tasks --base my-app--initial-setup \
  --name "Tasks" \
  --schema '{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"done":{"type":"boolean"}}}'
rekor bases promote my-app --from my-app--initial-setup

Write and query records

rekor records upsert tasks --base my-app \
  --data '{"title":"Ship v1","done":false}'

rekor sql "SELECT * FROM records WHERE org_id = {org_id:String} AND base_id = {base_id:String} AND record_type = 'tasks' AND data.done = false AND deleted = false" \
  --base my-app --output json

Create a scoped API key for an agent

rekor tokens create --name "agent-readonly" \
  --grants '[{"scope":{"bases":["my-app"],"environments":["production"]},"permissions":["read:records","read:record_types"]}]'

Commands

CommandDescription
rekor actionsManage Actions — reusable, named definitions: one record_type + one operation, or a composite of atomic write steps (--config with `steps`)
rekor attachmentsManage record attachments
rekor basesManage bases
rekor batchExecute atomic batch operations (up to 1,000 operations)
rekor file-typesManage file types (Buckets) — storage policy + optional metadata schema for files
rekor filesManage files (path-addressed, versioned content) within a file type
rekor inbound-webhooksManage inbound webhook endpoints
rekor loginAuthenticate with Rekor
rekor logoutRemove stored authentication credentials
rekor providersImport/export tool definitions between LLM providers and Record record_types
rekor pullPull a database config into rekor-ws/ as YAML files (a preview, plus a read-only mirror of linked production)
rekor pushPush local config files to a preview database (creating it if new)
rekor query-relationshipsQuery related records
rekor record-typesManage record_types
rekor recordsManage records
rekor relationshipsManage relationships between records
rekor reportFile a report to the Rekor triage queue and verify the outcome
rekor secretsManage organization vault secrets
rekor seedApply, reset, or clear a seed fixture on a preview base (hermetic eval data)
rekor sqlExecute a read-only SQL query against database data
rekor statusShow auth, connectivity, and CLI version diagnostics
rekor templateBrowse and pull ready-made data-layer templates
rekor tokensManage API tokens
rekor toolsetsManage MCP Factory toolsets
rekor triggersManage triggers (outbound webhooks, internal writes, external writes)
rekor unbindClear the database binding for this worktree
rekor updateUpdate the Rekor CLI to the latest published version
rekor useBind this worktree to a database so push/pull refuse to run against a different one
rekor whoamiShow the authenticated identity
CLI Reference — Rekor