Overview
Flashduty CLI (flashduty) is a command-line tool for managing the incident lifecycle, querying on-call schedules, publishing status page updates, and debugging notification templates from your terminal. It fits naturally into operations scripts, local troubleshooting, and AI coding-agent workflows.
The tool is open source at flashcatcloud/flashduty-cli and supports macOS, Linux, and Windows.
Installation
- macOS / Linux
- Windows (PowerShell)
- Manual download
/usr/local/bin by default. Override with the FLASHDUTY_INSTALL_DIR environment variable.Installer options
Authentication
Log in
Credential resolution order
The CLI resolves credentials in the following order (highest priority first):--app-keycommand-line flag (hidden, for scripting)FLASHDUTY_APP_KEYenvironment variable- Config file
~/.flashduty/config.yaml(written byflashduty login)
Config file
Stored at~/.flashduty/config.yaml with 0600 permissions:
Config commands
Global flags
All subcommands accept these flags:Command catalog
incident — Incident lifecycle
incident list:
Time format examples:
5m, 1h, 24h, 168h, 2026-04-01, 2026-04-01 10:00:00, 1712000000.
change — Change records
--channel, --since, --until, --type, --limit, --page.
member — Member queries
--query (free-text search by name or email), --role-id, --page, --limit, --orderby, --asc.
team — Team management
team list supports --query (team name substring match), --page, --limit, --orderby (created_at/updated_at/team_name), --asc, --person-id (filter to teams the given member belongs to).
team info accepts --team-id, --team-name, or --ref-id to identify the team (exactly one required).
team upsert creates or updates a team:
--team-name(required, 1–39 characters)--team-id(set to update an existing team; omit to create)--description(up to 500 characters)--person-ids(member ID list; replaces the entire member list — runteam infofirst to see current members before updating)--emails(email addresses to invite as members)--ref-id(external reference ID for HR system integration)
team delete accepts --team-id, --team-name, or --ref-id to identify the team. This action is permanent and cannot be undone.
channel — Channel queries
--name.
channel escalate-rule-list — Escalation rule queries
Escalation rule management has moved into thechannel command group. Pass the channel ID as a positional argument:
channel group: escalate-rule-create, escalate-rule-update, escalate-rule-delete (all require --channel-id).
field — Custom field queries
--name.
status-page — Status page management
Migrate from Atlassian Statuspage
Migration jobs run asynchronously. Poll progress withmigration-status after kicking off a job:
change-delete, change-info, change-list, change-timeline-delete, change-timeline-update, change-update, component-upsert, component-delete, section-upsert, section-delete, info, subscriber-list, subscriber-import, subscriber-export, template-list, template-upsert, template-delete.
rum — RUM applications and session replay
Use these commands to manage RUM applications and export session replay data. The application commands cover detail, batch reads, listing, webhook testing, and create/update/delete operations.application-list:
Core fields for
application-create / application-update:
application-webhook-test returns ok, status_code, and message, which makes it suitable for verifying that a RUM alert webhook really accepts a sample delivery from Flashduty.Session replay
session-replay-metadata, use --ts to supply the session-start Unix timestamp in milliseconds when you need to disambiguate a reused session ID from different time windows.
Common session-replay-segments flags:
oncall — On-call licenses
fixed is explicitly assigned, while temporary is active for the current temporary-license window.
template — Notification templates
dingtalk, dingtalk_app, feishu, feishu_app, wecom, wecom_app, slack, slack_app, telegram, teams_app, email, sms, zoom.
session — AI SRE sessions
Inspect AI SRE (and other Flashduty agent) sessions:session list lists the sessions visible to the caller, and session export streams a single session’s full event log for offline analysis.
session list:
The server endpoint
/safari/session/list caps each page at 100 rows; when --limit exceeds that, the CLI paginates automatically — no manual paging required. The API has no time-window filter, so --since is applied client-side against each session’s updated_at after fetching.session export streams session events as newline-delimited JSON (NDJSON) to stdout: the first line is always a session_meta envelope, and each subsequent line is one event (user_message, llm_call, tool_call, subagent_dispatch, final_answer, agent_text, error). Exports can be large, so redirect to a file instead of printing to the terminal:
monit-agent — On-box host/database diagnostics
Run live diagnostics on a target host or data source through flashmonit agents, without needing a shell login on the target machine.--target-locator (internal IP, hostname, or data-source name). --target-kind is optional (host, mysql, redis, etc.) and is inferred automatically when omitted.
invoke accepts a --data JSON payload listing the tools to run, up to 8 concurrently:
--data - and supply the body via a stdin heredoc to avoid shell-quoting issues:
monit-query — Monitoring datasource queries
Probe monitoring back-end datasources (Prometheus, VictoriaLogs, Loki, MySQL) directly, bypassing the alert-rule layer.diagnose:
rows requires --ds-type, --ds-name, and --expr (query expression). Use --args KEY=VALUE (repeatable) for parameterized queries.
monit — Alert-expression preview
If you want to validate a datasource expression before saving a rule, usepreview-sync to execute a synchronous preview request and inspect the raw result.
Full command coverage
Beyond the curated commands above, the CLI now provides full coverage of the Flashduty OpenAPI through a spec-driven code generator. The current OpenAPI contains 327 API operations, and the CLI generates corresponding resource-organized commands for them. In addition to the On-call domain (incident, incident-trigger-subscription, change, channel, field, status-page, template, and more), it also covers:- AI SRE (
safari): a2a-agents, automations, mcp-servers, sessions, skills, and more - Alerting & noise reduction: alert, alert-event, enrichment (alert-rules, rule-sets), route
- On-call & scheduling: calendar, schedule
- Platform administration: account, member, person, team, role (roles-permissions), audit (audit-logs)
- Monitoring & RUM: monit, rum, sourcemap
- Integrations & webhooks: datasource (IM integrations), webhook (integrations)
resource-action naming form (e.g. flashduty safari a2a-agent-get, flashduty safari session-list); their inputs and response fields map directly to the corresponding API. Explore them level by level with flashduty <resource> --help:
--start-time / --end-time) accept the same human-friendly formats as the curated commands: relative durations (7d, 24h — interpreted as “now minus duration”), +7d (“now plus duration”, i.e. a future time), now, dates and datetimes (such as 2026-05-01 or 2026-05-01 10:00:00), and unix timestamps in seconds. In addition, --since and --until are aliases for --start-time and --end-time respectively and can be used interchangeably; passing both spellings with different values is an error.
Utility commands
flashduty update downloads and runs the platform installer, replacing the current binary with the latest release. --check only prints the available version without modifying any local files. After any non-update command runs in a terminal, if a newer version is available the CLI automatically emits an update notice banner to stderr.Output formats
Select the output shape with--output-format (--json is an alias for --output-format json) to fit different consumers:
- Table (default)
- JSON (--json / --output-format json)
- TOON (--output-format toon)
- Full table (--no-trunc)
Human-readable, aligned columns, long fields truncated.
Field projections for structured output
The following commands support--fields with json or toon output. Supply comma-separated top-level response fields; an unknown field fails immediately, and table output ignores this flag.
For example, export only an incident ID, title, and progress:
incident list, incident similar, alert-event list) exceeds its limit, the CLI keeps the selected field names, shortens long strings, and marks them with .... If non-string fields alone exceed the limit, the command asks you to reduce the fields or result count.
incident detail behaves differently when its projection overflows: the detail is a single object, and a truncated value is indistinguishable from a genuinely short one, so silently shortening it would hand you wrong data. A projection over 8 KiB therefore fails the command outright, and the error names the largest fields (up to 3, with their byte sizes). Reduce the fields in --fields, or omit --fields entirely to get the full detail, which is not subject to the projection limit.
When --fields is omitted and the default compact projection is used, the CLI prints a one-line note to stderr stating which fields the projection uses and that --fields can select others. The note goes only to stderr and never touches stdout, so piping into jq or similar tools is unaffected.
Agent skills
Flashduty CLI ships with a single agent skill namedflashduty that teaches AI coding agents — Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and 40+ others — how to operate Flashduty from your terminal.
Install it to every detected agent on your machine in one shot:
SKILL.md carries the shared conventions (authentication, global flags, safety rules) and indexes per-domain reference cards — incidents, alerts, changes, on-call and schedules, channels and escalations, status pages, insights, monitors, RUM and sourcemaps, automations, notification templates, members and teams, and more. Before running a task, the agent reads the card for that domain to get every command, flag, and workflow for it — no --help trial-and-error.
Common workflows
Attach a CLI link to notifications
Attach a CLI link to notifications
Use
flashduty incident get <id> to fetch incident details from the terminal. Embed the snippet into notification templates so responders can copy-paste it.Bulk acknowledge or close incidents
Bulk acknowledge or close incidents
Export incident data to BI tools
Export incident data to BI tools
jq or load it into your warehouse.Validate notification templates in CI/CD
Validate notification templates in CI/CD