Skip to main content

CLI Reference

Complete guide to the FailZero CLI (fz).

Installation

Verify installation:

Authentication

fz auth login

Authenticate with FailZero. Opens browser for OAuth login.
After successful authentication, your token is stored securely in the system keychain.

fz auth logout

Remove stored credentials.

fz auth status

Check current authentication status.

DR Plan Management

fz init

Initialize a new DR plan configuration file.
Interactive prompts will guide you through:
  • Cloud provider selection (GCP, AWS)
  • Project/account configuration
  • Region selection
Creates a dr.yaml file in the current directory. Options: Example:

fz validate

Validate a DR plan configuration file.
Arguments: Example:
Validates:
  • YAML syntax
  • Required fields
  • Provider configuration
  • Monitor definitions
  • Failover step references

fz deploy

Deploy a DR plan to FailZero.
Arguments: Options: Example:

Monitoring & Status

fz status

Check the status of a deployed DR plan.
Arguments: Output includes:
  • Plan status (active, paused, error)
  • Monitor health
  • Last check time
  • Agent connection status
Example:

fz list

List all deployed DR plans.
Options:

Failover Operations

fz failover

Trigger a failover for a DR plan.
Arguments: Options: Examples:
Failover executes real infrastructure changes. Always test in non-production first.

fz approve

Approve a pending failover (when confirmation is required).
Arguments: Example:

fz cancel

Cancel a pending or in-progress failover.
Arguments:

History

fz history

View failover history for a DR plan.
Arguments: Options: Example:
Output includes:
  • Timestamp
  • Trigger type (manual/automatic)
  • Who triggered it
  • Duration
  • Success/failure status

Agent Management

fz agent deploy

Deploy a FailZero agent to your cloud provider. Interactive wizard guides you through the setup.
Options: Examples:
What it does:
  1. Creates an agent token via the FailZero API
  2. For GCP: Deploys to Cloud Run with proper environment variables
  3. For AWS: Creates ECS Fargate service with task definition
Requires gcloud CLI (GCP) or aws CLI (AWS) to be installed and authenticated.

fz agent list

List all agents and their connection status. Alias: fz agent status
Output includes:
  • Agent name and ID
  • Connection status (Connected/Inactive)
  • Token prefix
  • Last seen timestamp

fz agent revoke

Revoke an agent token.
Arguments:

Configuration File

fz config

View or modify CLI configuration.

Global Options

These options work with all commands:

Exit Codes

Environment Variables

Examples

Complete Workflow

Next Steps

Example Plans

Real-world DR configurations

Quickstart

End-to-end setup guide