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
| Variable | Description | Default |
|---|---|---|
FLASHDUTY_VERSION | Install a specific version, e.g. v0.6.0 | latest |
FLASHDUTY_INSTALL_DIR | Custom install directory | /usr/local/bin (shell), ~\.flashduty\bin (PowerShell) |
MIRROR_URL | Override the release asset download mirror prefix used by the installer script; must use https:// | https://static.flashcat.cloud/flashduty-cli |
FLASHDUTY_UPDATE_BASE_URL | Override the base URL used by flashduty update and the automatic update check | https://static.flashcat.cloud/flashduty-cli |
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:| Flag | Description |
|---|---|
--output-format | Output format: table (default), json, or toon (compact, token-efficient) |
--json | Alias for --output-format json; emit JSON for parsing with jq or similar tools |
--no-trunc | Disable column truncation in table output |
--base-url | Override the API endpoint (for private deployments) |
Command catalog
incident — Incident lifecycle
incident list:
| Flag | Description | Default |
|---|---|---|
--progress | Progress filter: Triggered, Processing, Closed | all |
--severity | Severity filter: Critical, Warning, Info | all |
--channel | Filter by channel ID | - |
--query | Free-text search across title, labels, and content (also resolves a 24-char incident ID or 6-char incident num to a direct lookup) | - |
--since | Start time (duration, date, datetime, or unix timestamp) | 24h |
--until | End time | now |
--limit | Max results | 20 |
--page | Page number | 1 |
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, subscriber-export.
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:
| Flag | Description | Default |
|---|---|---|
--app | Which agent app’s sessions to list | ai-sre |
--scope | Visibility: all (your own + your teams, default), personal, team | all |
--status | Archive status: active (default), archived, all | active |
--team-id | Keep only sessions for the given team ID | - |
--since | Keep only sessions updated within the window (client-side filter), e.g. 30d, 24h, 2026-05-01 | - |
--limit | Max sessions to fetch | 200 |
--page | Start page (1-based) | 1 |
--output-format | Output format: jsonl (default, one session object per line, pipe straight to jq), json (full envelope), toon (compact) | jsonl |
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:
| Flag | Description |
|---|---|
--include-subagents | After each subagent_dispatch, recursively inline that subagent’s own full event stream |
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:
| Flag | Description |
|---|---|
--ds-type | Datasource type (required): prometheus, victorialogs, loki, mysql |
--ds-name | Datasource name as configured in the console (required) |
--input-query | Filter-only log query or matrix PromQL (required) |
--time-start | Window start — relative (15m, 1h), unix seconds, or now (default 15m) |
--time-end | Window end — relative, unix seconds, or now (default now; window capped at 6h) |
--operation | log_patterns or metric_trends (inferred from --ds-type when omitted) |
rows requires --ds-type, --ds-name, and --expr (query expression). Use --args KEY=VALUE (repeatable) for parameterized queries.
Full command coverage
Beyond the curated commands above, the CLI now provides full coverage of the Flashduty OpenAPI (~248 commands) via a spec-driven code generator, organized into top-level command groups by resource. In addition to the On-call domain (incident, change, channel, field, status-page, template, and more), it also covers:- AI SRE (
safari): a2a-agents, 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:
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.
Agent skills
Flashduty CLI ships with 10 agent skills that teach AI coding agents — Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and 40+ others — how to operate Flashduty from your terminal. Install skills to every detected agent on your machine in one shot:| Skill | Scope |
|---|---|
flashduty-shared | Foundation: authentication, three-layer noise model, global flags, safety rules |
flashduty-incident | Incident lifecycle: triage, investigate, resolve, merge, snooze, reassign |
flashduty-alert | Alert and alert event investigation: drill down, trace, merge |
flashduty-change | Change event tracking and deployment frequency trends |
flashduty-oncall | On-call schedule queries: who is on call, shift details |
flashduty-channel | Channel and escalation rule lookups |
flashduty-statuspage | Status page management and Atlassian → Flashduty migration |
flashduty-insight | Analytics: MTTA/MTTR, noise reduction, notification trends |
flashduty-admin | Team/member lookups and audit log search |
flashduty-template | Notification template validation and preview |
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