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 credentials in ~/.config/rekor/config.json. You can override these 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
--workspace <id>Target workspace 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: workspace + preview + collection

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

Write and query records

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

rekor sql "SELECT * FROM records FINAL WHERE workspace_id = {workspace_id:String} AND collection = 'tasks' AND data.done = false AND deleted = false" \
  --workspace my-app --output json

Create a scoped API key for an agent

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

Commands

CommandDescription
rekor attachmentsManage record attachments
rekor batchExecute atomic batch operations (up to 1,000 operations)
rekor collectionsManage collections
rekor endpointsManage MCP Factory endpoints
rekor hooksManage inbound webhook endpoints
rekor loginAuthenticate with Rekor
rekor logoutRemove stored authentication credentials
rekor providersImport/export tool definitions between LLM providers and Record collections
rekor query-relationshipsQuery related records
rekor recordsManage records
rekor relationshipsManage relationships between records
rekor sqlExecute a read-only SQL query against workspace data
rekor tokensManage API tokens
rekor triggersManage outbound triggers
rekor workspacesManage workspaces
CLI Reference — Rekor