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 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 |
|---|---|
--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
| Command | Description |
|---|---|
rekor attachments | Manage record attachments |
rekor batch | Execute atomic batch operations (up to 1,000 operations) |
rekor collections | Manage collections |
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 records |
rekor records | Manage records |
rekor relationships | Manage relationships between records |
rekor sql | Execute a read-only SQL query against workspace data |
rekor tokens | Manage API tokens |
rekor triggers | Manage outbound triggers |
rekor workspaces | Manage workspaces |