Skip to main content

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

Installs to /usr/local/bin by default. Override with the FLASHDUTY_INSTALL_DIR environment variable.

Installer options

Authentication

Log in

When prompted, paste your APP Key. To obtain one, sign in to the Flashduty console and copy your APP Key from Profile > Personal Info.

Credential resolution order

The CLI resolves credentials in the following order (highest priority first):
  1. --app-key command-line flag (hidden, for scripting)
  2. FLASHDUTY_APP_KEY environment variable
  3. Config file ~/.flashduty/config.yaml (written by flashduty 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

Common filter flags for incident list: Time format examples: 5m, 1h, 24h, 168h, 2026-04-01, 2026-04-01 10:00:00, 1712000000.

Work items and follow-ups (work-item-*)

incident work-item-* manages work items anchored to an incident or a post-mortem. --item-type distinguishes two kinds: action (an action item anchored to an active incident) and follow_up (a post-mortem follow-up, which must be bound to a post-mortem ID).
Key flags for work-item-create: --item-type (required, action or follow_up), --title (required, up to 512 characters), --idempotency-key (required idempotency key, up to 128 characters), --post-mortem-id (required for follow_up, forbidden for action), --assignee-ids (initial assignees). Mutating verbs (update/complete/convert/delete/assignees-reset) require --version (optimistic locking — it must match the stored version).

Post-mortem reports (post-mortem-*)

Post-mortem verbs live under the incident command group (there is no standalone post-mortem group):
Template verbs: post-mortem-template-list, post-mortem-template-info <template-id>, post-mortem-template-upsert (creates when --template-id is omitted; --team-id is required when creating), post-mortem-template-delete <template-id> (irreversible).

Comment types (comment-type-*)

change — Change records

Supports --channel, --since, --until, --type, --limit, --page.

member — Member queries

member list supports --query (free-text search by name or email), --role-id, --page, --limit, --orderby, --asc. member info-reset identifies the member by exactly one of --member-id, --member-name, --email, --phone, or --ref-id; the fields to change go into the required body via --data '{"updates":{...}}'. With --from api, an updated email or phone is marked verified directly when the account has member invites disabled. member invite takes the member list via --data '{"members":[...]}'. When the account has member invites disabled and --from api is set, members are created directly in the enabled state with email/phone marked verified — no invitation is sent.

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 --ref-id, --team-name, or --team-id to identify the team (exactly one required). When several are provided, the precedence is --ref-id > --team-name > --team-id. 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 — run team info first to see current members before updating)
  • --emails (add existing members by email; addresses that match no existing member are silently ignored — no invitation is sent)
  • --phones (add existing members by phone number; non-matching numbers are silently ignored, and non-E.164 numbers are parsed with --country-code)
  • --country-code (default country code applied to --phones entries that are not in E.164 format)
  • --ref-id (external reference ID for HR system integration)
team upsert’s --emails / --phones only match and attach existing members — no invitation is ever sent. To invite new members into the organization, use flashduty member invite.
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

Supports --name.

channel escalate-rule-list — Escalation rule queries

Escalation rule management has moved into the channel command group. Pass the channel ID as a positional argument:
Other escalation rule management commands under the channel group: escalate-rule-create, escalate-rule-update, escalate-rule-delete (all require --channel-id).

channel silence/inhibit/drop rules — Noise rule management

Channel-level noise rules are managed through the channel command group; see Noise Reduction for rule semantics and configuration. The three families — silence-rule-* (silence), inhibit-rule-* (inhibit), unsubscribe-rule-* (drop) — share the same shape, each with list/create/update/enable/disable/delete verbs:
inhibit-rule-* and unsubscribe-rule-* work the same way; inhibit-rule-create requires --equals (the label keys pairing source and target alerts). Silence and inhibit rules accept --is-directly-discard to drop suppressed alerts instead of merging them. Note that channel-id is positional on *-rule-create and *-rule-list but a flag (--channel-id) on *-rule-update/delete/enable/disable; --rule-id is a MongoDB ObjectID string.

field — Custom field queries

Supports --name.

status-page — Status page management

Migrate from Atlassian Statuspage

Migration jobs run asynchronously. Poll progress with migration-status after kicking off a job:
Other available subcommands: 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.
Common flags for 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

For 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:

Error ingestion rules (error-ingestion-rules-*)

Error ingestion rules filter or rewrite the error events an application reports:
--description is capped at 512 characters. create/list/history-list/history-revert take application-id as a positional argument; update/enable/disable/delete target rules via the --application-id and --rule-id flags.

Preset severity rules (issue-preset-severity-rules-*)

Preset severity rules assign a preset severity to errors matching a condition, used for issue grading:

Resource info (resource-info)

oncall — On-call licenses

This read-only command returns each person’s ID, name, and license type: fixed is explicitly assigned, while temporary is active for the current temporary-license window.

template — Notification templates

Supported channels: 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.
Common flags for 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.
Both subcommands require --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:
For SQL parameters containing quotes or commas, pass --data - and supply the body via a stdin heredoc to avoid shell-quoting issues:

monit-query — Monitoring datasource queries

Probe monitoring back-end datasources directly, bypassing the alert-rule layer. The data subcommand supports 9 datasource types (Prometheus, VictoriaLogs, Loki, MySQL, SLS, Elasticsearch, PostgreSQL, Oracle, ClickHouse); diagnose supports prometheus (metric trends), victorialogs, loki (log patterns); the deprecated rows supports prometheus, victorialogs, loki, mysql.
Common flags for diagnose: Common flags for data: data returns a stable query_result.v1 structured result: format is always query_result.v1, and result.kind is one of frames (typed table/time-series frames), records (schema-flexible records, may contain nested JSON or null), or samples (instant samples with complete label sets) — results are no longer flattened into the legacy rows shape. rows requires --ds-type, --ds-name, and --expr (query expression). Use --args KEY=VALUE (repeatable) for parameterized queries. rows is deprecated — use monit-query data instead. In raw mode (loki / victorialogs), rows accepts time-window arguments --args <ds-type>.start=<t> and --args <ds-type>.end=<t> in the same formats as diagnose’s --time-start/--time-end (relative duration, now, date/RFC3339, unix seconds or milliseconds); the CLI normalizes them to the unix-seconds form the datasource requires.

monit — Alert-expression preview

If you want to validate a datasource expression before saving a rule, use preview-sync to execute a synchronous preview request and inspect the raw result.
Common flags:

monit servicemap — Service topology (Beta)

The monit servicemap-* command family accesses the ServiceMap capability; see Service Map for the UI workflow.
summary and topology take the anchor host via --data '{"anchor":{...}}'. Common topology flags: --depth (traversal depth, 1–3, default 1), --max-nodes (default 100, cap 500), --max-edges (default 200, cap 1000).

alert — Alert and alert-event queries

Common filter flags for both list commands: --severity (Critical,Warning,Info), --channel (comma-separated channel IDs), --integration (comma-separated integration IDs), --since/--until, --limit (max 100), --page. alert-event list also takes --integration-type, which filters by comma-separated plugin keys (e.g. AliCloud,Prometheus) — note these are plugin keys, not integration IDs; use --integration to filter by integration ID.

automation — AI SRE automation rules

The automation command group manages AI SRE automation rules — create, query, update, delete, run history, and triggering. See Automations for the console workflow.
Common create flags: update accepts --name, --prompt/--prompt-file, --schedule/--at/--weekday/--cron-expr, --enable/--disable, --enable-schedule/--disable-schedule, --enable-http-post-trigger/--disable-http-post-trigger, --rotate-http-post-token, and --environment-kind/--environment-id. The personal/team scope is immutable after creation, so update exposes no scope flag. runs supports --status (queued/running/retrying/succeeded/partial/failed/skipped/abandoned), --trigger-kind (schedule/debug/http_post), --since/--until, --page, and --limit. fire authenticates with the trigger’s token (--token, or the FLASHDUTY_AUTOMATION_TRIGGER_TOKEN environment variable); --text passes context for the run, and --data passes a full JSON request body (inline JSON or - to read stdin).
Timezone semantics: --at and --cron-expr are interpreted as local wall-clock time in the rule’s timezone, which defaults at creation to the caller’s member timezone, falling back to the account timezone when the member has none. Pass the user’s local time directly — do not convert it to UTC. Neither create nor update has a --timezone flag: to pin a different timezone at creation, use the generated command flashduty safari automation-rule-create --timezone; a created rule’s timezone cannot be changed via update.

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 337 API operations, and the CLI generates corresponding resource-organized commands for 336 of them (session-read-export is provided by the hand-written session export / safari session-export commands). 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, knowledge, 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)
These generated leaf commands use a 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:
Time-window parameters on generated commands (--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.

knowledge — AI SRE knowledge base

The safari knowledge-* command family manages AI SRE Knowledge Packs — versioned, account/team-scoped file trees (DUTY.md plus runbooks, FAQs, service catalogs, and similar files) staged into every AI SRE sandbox at session start. See Manage Knowledge for the full feature model (DUTY.md structure, @references, account/team scope, file constraints).
Common flags: knowledge-file-put requires --content-b64 to be the Base64 encoding of valid UTF-8 text; --content-type is inferred from the file extension when omitted. knowledge-file-delete refuses to remove a file still referenced by other pack files unless --force is passed, in which case the referrers are returned as warnings.

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.
Enable shell completion (zsh example):

Output formats

Select the output shape with --output-format (--json is an alias for --output-format json) to fit different consumers:
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:
When a list projection (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 named flashduty 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:
The skill uses a router-plus-reference-card structure: 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

Then process the file with jq or load it into your warehouse.
Run this in CI to catch syntax or field errors as soon as a template is committed.
Full source and issue tracking live on the GitHub repository.