Skip to content

flashcatcloud/flashduty-cli

Flashduty CLI

English | 中文

License Release CI Go Report Card

A command-line interface for the Flashduty platform. Manage incidents, on-call schedules, status pages, and more from your terminal.

Installation

macOS / Linux

curl -sSL https://static.flashcat.cloud/flashduty-cli/install.sh | sh

Windows (PowerShell)

irm https://static.flashcat.cloud/flashduty-cli/install.ps1 | iex

Manual Download

Download the latest release for your platform from GitHub Releases.

Options

Variable Description Default
FLASHDUTY_VERSION Install a specific version (e.g. v0.1.2) latest
FLASHDUTY_INSTALL_DIR Custom install directory /usr/local/bin (shell), ~\.flashduty\bin (PowerShell)
MIRROR_URL Override installer release asset mirror https://static.flashcat.cloud/flashduty-cli
FLASHDUTY_UPDATE_BASE_URL Override flashduty update and auto update-check base URL https://static.flashcat.cloud/flashduty-cli

Quick Start

1. Authenticate

flashduty login

You will be prompted for your Flashduty APP key. To obtain one, log into the Flashduty console and navigate to Account Settings > APP Key.

Alternatively, set the key via environment variable:

export FLASHDUTY_APP_KEY=your_app_key

2. Use

# List recent incidents
flashduty incident list

# Get incident details
flashduty incident get <incident_id>

# List team members
flashduty member list

# View channels
flashduty channel list

Authentication

The CLI resolves credentials in this order (highest priority first):

  1. --app-key flag (hidden, for scripting)
  2. FLASHDUTY_APP_KEY environment variable
  3. ~/.flashduty/config.yaml (written by flashduty login)

Configuration File

Stored at ~/.flashduty/config.yaml with 0600 permissions:

app_key: your_app_key
base_url: https://api.flashcat.cloud

Configuration Commands

flashduty config show              # Print current config (key masked)
flashduty config set app_key KEY   # Set app key
flashduty config set base_url URL  # Override API endpoint

Global Flags

Flag Description
--output-format Output format: table (default), json, or toon (compact, fewer tokens)
--json Output as JSON (alias for --output-format json)
--no-trunc Do not truncate long fields in table output
--base-url Override the API base URL

Available Commands

incident - Incident Lifecycle Management (9 commands)

flashduty incident list [flags]        # List incidents (default: last 24h)
flashduty incident get <id> [<id2>]    # Get incident details (vertical view for single ID)
flashduty incident create [flags]      # Create a new incident (interactive if flags missing)
flashduty incident update <id> [flags] # Update incident fields
flashduty incident ack <id> [<id2>]    # Acknowledge incidents
flashduty incident close <id> [<id2>]  # Close (resolve) incidents
flashduty incident timeline <id>       # View incident timeline
flashduty incident alerts <id>         # View incident alerts
flashduty incident similar <id>        # Find similar historical incidents

List flags:

Flag Description Default
--progress Filter: Triggered, Processing, Closed all
--severity Filter: Critical, Warning, Info all
--channel Filter by channel ID -
--title Search by title keyword -
--since Start time (duration, date, datetime, or unix) 24h
--until End time now
--limit Max results 20
--page Page number 1

Time format examples: 5m, 1h, 24h, 168h, 2026-04-01, 2026-04-01 10:00:00, 1712000000

change - Change Record Query (1 command)

flashduty change list [flags]    # List changes (deployments, configs)

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

member - Member Query (1 command)

flashduty member list [flags]    # List members

Supports --name, --email, --page.

team - Team Query (1 command)

flashduty team list [flags]      # List teams with members

Supports --name, --page.

channel - Channel Query (1 command)

flashduty channel list [flags]   # List collaboration spaces

Supports --name.

escalation-rule - Escalation Rule Query (1 command)

flashduty escalation-rule list --channel <id>          # By channel ID
flashduty escalation-rule list --channel-name <name>   # By channel name (auto-resolved)

field - Custom Field Query (1 command)

flashduty field list [flags]     # List custom field definitions

Supports --name.

statuspage - Status Page Management (5 command groups)

flashduty statuspage list [--id <ids>]                                  # List status pages
flashduty statuspage changes --page-id <id> --type <incident|maintenance>  # List active changes
flashduty statuspage create-incident --page-id <id> --title <title>     # Create status incident
flashduty statuspage create-timeline --page-id <id> --change <id> --message <msg>  # Add timeline update
flashduty statuspage migrate structure --from atlassian --source-page-id <id> --api-key <key>   # Start structure/history migration
flashduty statuspage migrate email-subscribers --from atlassian --source-page-id <id> --target-page-id <id> --api-key <key>   # Start email subscriber migration
flashduty statuspage migrate status --job-id <id>                       # Check migration job status
flashduty statuspage migrate cancel --job-id <id>                       # Cancel a running migration job

Migration jobs are asynchronous. After starting structure or email-subscribers, use:

flashduty statuspage migrate status --job-id <job_id>

Typical flow:

flashduty statuspage migrate structure --from atlassian --source-page-id page_123 --api-key $ATLASSIAN_STATUSPAGE_API_KEY
flashduty statuspage migrate status --job-id <structure_job_id>
flashduty statuspage migrate email-subscribers --from atlassian --source-page-id page_123 --target-page-id <target_page_id> --api-key $ATLASSIAN_STATUSPAGE_API_KEY
flashduty statuspage migrate status --job-id <subscriber_job_id>

template - Notification Template Management (4 commands)

flashduty template get-preset --channel <channel>                    # Get preset template code
flashduty template validate --channel <channel> --file <path>        # Validate and preview template
flashduty template variables [--category <category>]                 # List template variables
flashduty template functions [--type custom|sprig|all]               # List template functions

Supported channels: dingtalk, dingtalk_app, feishu, feishu_app, wecom, wecom_app, slack, slack_app, telegram, teams_app, email, sms, zoom.

Utility Commands

flashduty login          # Authenticate interactively
flashduty config show    # Show current configuration
flashduty config set     # Set a configuration value
flashduty version        # Print version information
flashduty completion     # Generate shell completions (bash/zsh/fish/powershell)

Output Formats

Table (default): Human-readable, aligned columns, long fields truncated.

ID           TITLE                    SEVERITY   PROGRESS     CHANNEL       CREATED
inc_abc123   DB connection timeout    Critical   Triggered    Production    2026-04-10 10:23
inc_def456   High memory usage        Warning    Processing   Staging       2026-04-10 09:15
Showing 2 results (page 1, total 2).

JSON (--json / --output-format json): Machine-parseable, full data, no truncation.

flashduty incident list --json | jq '.[].title'

TOON (--output-format toon): Token-Oriented Object Notation — full data, no truncation, but drops the per-row repeated keys that JSON emits for uniform arrays, so list output costs materially fewer tokens. Preferred for LLM/agent consumption. Not directly jq-able; use --json when you need to pipe into jq.

flashduty incident list --output-format toon

No truncation (--no-trunc): Table with full field content.


Development

Prerequisites

  • Go 1.24+
  • golangci-lint (auto-installed by Makefile)

Build

make build       # Build binary to bin/flashduty
make test        # Run tests with race detection
make lint        # Run linter
make check       # Run all checks (fmt, lint, test, build)
make help        # Show all available targets

Dependencies

Package Purpose
flashduty-sdk Flashduty API client
cobra CLI framework
yaml.v3 Config file parsing
x/term Masked password input

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request, and note our Code of Conduct.


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Flashduty's official CLI

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages