Using the CLI
The RunReveal CLI is a JSON-in/JSON-out interface to the RunReveal API. API commands accept a JSON request body and print the raw API response as JSON, which makes the CLI equally suited to interactive use, scripting, and AI agents. Human-readable status output goes to stderr, so stdout is always safe to pipe or parse.
Install the CLI
Install homebrew for macOS, then enable our homebrew tap and install the CLI:
Homebrew 6.0+: Third-party taps must be explicitly trusted before install. If you see
Refusing to load formula ... from untrusted tap, run the brew trust command above.
See Homebrew Tap Trust for details.
Alternatively, install with the fully-qualified formula name:
Upgrading from the previous CLI
CLI versions v2026.7 and later are a new implementation. If you are upgrading from an earlier version (pre-v2026.7), here is what changed:
- Re-authenticate once. Browser-based logins are not carried over. Run
runreveal auth loginafter upgrading. - API tokens continue to work as before.
RUNREVEAL_TOKENand the--tokenflag accept the same tokens they always have, including the legacy session token formats — CI/CD pipelines need no changes. - Auto-generated API commands moved under the
runreveal apiprefix. For example,runreveal sources listis nowrunreveal api sources list. - The interactive
logsshell was removed due to low usage. Query logs withrunreveal api logs query-v3instead. runreveal auth statusreplacesrunreveal config show.runreveal openapiwas removed. API documentation is available in the API reference.- The
RUNREVEAL_APPBASEURLandRUNREVEAL_HEADER_FILEenvironment variables are no longer used.
Login to RunReveal
Authenticate with your browser:
runreveal init and runreveal login are aliases for the same flow. This
opens your browser to authorize the CLI and stores the resulting token in
your OS keychain, falling back to ~/.config/runreveal/ when no keychain is
available.
To use a manually-created API token instead:
Validate that you're logged in:
Profiles
Profiles let you switch between workspaces or deployments (for example,
RunReveal Cloud and an on-prem instance). A profile is created by logging in
to it — runreveal auth login --profile staging --base-url URL — and
non-secret profile settings live in ~/.config/runreveal/profiles.toml.
Environment Variables
Settings are resolved in this order (highest priority first): CLI flags
(--token, --base-url, --workspace, --profile), environment variables,
then the active profile.
RUNREVEAL_TOKEN
Authenticates the CLI without runreveal auth login. When set, profiles and
the keychain are not consulted at all. This is the recommended approach for
CI/CD and other non-interactive environments because API tokens are
long-lived and do not require a browser flow.
RUNREVEAL_WORKSPACE
Sets the active workspace for the session. This ID must be a workspace ID, not the name of your workspace.
RUNREVEAL_PROFILE
Selects a named profile for the current invocation. This is equivalent to
passing --profile <name> on the command line and overrides the current
profile stored in profiles.toml. Useful in environments that manage
credentials for multiple workspaces:
RUNREVEAL_BASEURL
For customers who have deployed the RunReveal API on-prem or in a private
cloud, you can set the RUNREVEAL_BASEURL environment variable to point the
CLI to your RunReveal API instance.
RunReveal Cloud:
Custom/On-Prem Instances:
RUNREVEAL_DEBUG
Enables debug logging and prints the HTTP requests the CLI sends to the RunReveal API (as curl commands), which is helpful when troubleshooting.
API Commands
Every RunReveal API endpoint is available under the api group, organized by
resource:
The request body can be supplied with --json/-j or piped on stdin. If
neither is provided, an empty object is sent, which suits GET/LIST endpoints.
Available groups include account, agents, alerts, custom-views,
destinations, detections, enrichments, filters, investigations,
logs, managed-detections, notifications, pipelines, saved-queries,
sources, topics, transforms, user, and workspace. Discover the full
list and each group's commands with:
Detections as Code
Curated commands for managing detections in a git repository:
See Detections as Code for the full workflow.
MCP Server
Starts a local Model Context Protocol server over stdio, exposing RunReveal tools to Claude, Cursor, and other MCP clients. It uses the same credential resolution as the rest of the CLI. See Model Context Protocol for setup.
Interactive Agent Chat
Starts an interactive, terminal-based chat with RunReveal's AI assistant, streaming responses the same way the in-app Native AI Chat does—it talks to the same backend, so chats started in one place can be picked up in the other.
Flags:
--provider— LLM provider to use:anthropic(default),openai,googleai,bedrock,vertex, orollama. The provider must be configured for your workspace (see Native AI Chat setup).--model— model name to use (e.g.claude-sonnet-4-6). Defaults to the provider's configured default.--chat-id— resume an existing chat by ID instead of starting a new one.
Agent Skill
The CLI can describe itself to AI agents:
runreveal skill prints a ready-to-use agent skill in markdown covering
authentication, the JSON command pattern, and the detections workflow.
Shell Completion
Homebrew installs completions for bash, zsh, and fish automatically. To generate them manually: