Command Line Interface
The Resilient Circuit CLI provides utility commands for managing your circuit breaker setup.
Installation
After installing Resilient Circuit, the CLI is available as resilient-circuit-cli.
PostgreSQL Setup
The main command is pg-setup which creates the necessary database table and indexes for PostgreSQL shared storage.
Basic Usage
resilient-circuit-cli pg-setup
This command will:
Load database configuration from environment variables (or .env file)
Connect to the specified PostgreSQL database
Create the
rc_circuit_breakerstable if it doesn’t existCreate optimized indexes for performance
Set up triggers for automatic timestamp updates
Options
The pg-setup command supports several options:
- --yes
Skip the confirmation prompt and proceed with the setup directly.
resilient-circuit-cli pg-setup --yes
- --dry-run
Show what would be done without making any actual changes to the database.
resilient-circuit-cli pg-setup --dry-run
Environment Variables
The CLI reads database configuration from environment variables:
RC_DB_HOST: PostgreSQL host (default: localhost)RC_DB_PORT: PostgreSQL port (default: 5432)RC_DB_NAME: Database name (default: resilient_circuit_db)RC_DB_USER: Database user (default: postgres)RC_DB_PASSWORD: Database password
Example Configuration
Create a .env file:
RC_DB_HOST=localhost
RC_DB_PORT=5432
RC_DB_NAME=my_circuit_breaker_db
RC_DB_USER=myuser
RC_DB_PASSWORD=mypassword
Then run the setup:
resilient-circuit-cli pg-setup