Skip to main content
The Hyrex CLI provides commands for initializing projects, running workers, and managing your Hyrex deployment.

Installation

The CLI is included when you install the Hyrex Python SDK:

Commands

hyrex init

Initialize a new Hyrex project with interactive setup.
This command guides you through setting up a new Hyrex project, creating necessary configuration files and project structure.

hyrex init-db

Initialize the Hyrex database tables in your PostgreSQL database.
Note: This command is run automatically when you start a worker, so you typically don’t need to run it manually. It’s only needed if you want to initialize the database tables before running any workers. Options:
  • --database-string TEXT - PostgreSQL connection string. If not provided, uses the HYREX_DATABASE_URL environment variable.
Example:

hyrex run-worker

Run a Hyrex worker to process tasks from queues.
Arguments:
  • APP_MODULE_PATH - Python module path to your Hyrex app (e.g., hyrex_app:app)
Options:
  • --queue-pattern TEXT - Queue pattern for task filtering (default: *, accepts wildcards)
  • --num-processes INTEGER - Number of parallel executor processes (default: 8)
  • --log-level TEXT - Logging level (default: INFO, options: DEBUG, INFO, WARNING, ERROR)
Examples:

hyrex studio

Launch Hyrex Studio, a web-based UI for monitoring and managing your Hyrex deployment.
Options:
  • --port INTEGER - Port to run the studio server (default: 1337)
  • --verbose - Enable verbose logging
Examples:

Environment Variables

The Hyrex CLI respects the following environment variables:

For Hyrex FOSS (Self-hosted)

  • HYREX_DATABASE_URL - PostgreSQL connection string for your Hyrex database

For Hyrex Cloud (Managed)

  • HYREX_API_KEY - API key for Hyrex Cloud service

Configuration Priority

The CLI follows this priority order for configuration:
  1. Command-line options (highest priority)
  2. Environment variables
  3. Configuration files (if present)
  4. Default values (lowest priority)

Common Workflows

Setting up a new project

Running workers for different task types