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 Variable | Purpose |
|---|---|
REKOR_TOKEN | Override the stored API token |
REKOR_API_URL | Override the API base URL |
Global Flags
These flags work with every command:
| Flag | Description |
|---|---|
--database <id> | Target database 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: database + preview + collection
rekor databases create my-app --name "My App"
rekor databases create-preview my-app --name "initial-setup"
rekor collections upsert tasks --database my-app--initial-setup \
--name "Tasks" \
--schema '{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"done":{"type":"boolean"}}}'
rekor databases promote my-app --from my-app--initial-setup
Write and query documents
rekor documents upsert tasks --database my-app \
--data '{"title":"Ship v1","done":false}'
rekor sql "SELECT * FROM documents WHERE database_id = {database_id:String} AND collection = 'tasks' AND data.done = false AND deleted = false" \
--database my-app --output json
Create a scoped API key for an agent
rekor tokens create --name "agent-readonly" \
--grants '[{"scope":{"databases":["my-app"],"environments":["production"]},"permissions":["read:documents","read:collections"]}]'
Commands
| Command | Description |
|---|---|
rekor attachments | Manage document attachments |
rekor batch | Execute atomic batch operations (up to 1,000 operations) |
rekor collections | Manage collections |
rekor databases | Manage databases |
rekor debug | Platform-admin debug commands (requires platform:admin grant) |
rekor documents | Manage documents |
rekor endpoints | Manage MCP Factory endpoints |
rekor hooks | Manage inbound webhook endpoints |
rekor login | Authenticate with Rekor |
rekor logout | Remove stored authentication credentials |
rekor providers | Import/export tool definitions between LLM providers and Record collections |
rekor query-relationships | Query related documents |
rekor relationships | Manage relationships between documents |
rekor report-bug | Submit a report to the Rekor triage queue (deduplicated) |
rekor sql | Execute a read-only SQL query against database data |
rekor status | Show auth, connectivity, and CLI version diagnostics |
rekor tokens | Manage API tokens |
rekor triggers | Manage outbound triggers |
rekor update | Update the Rekor CLI to the latest published version |
rekor whoami | Show the authenticated identity |