Skip to content

CLI commands

The bfx command (alias for bluefox) provides the primary workflow for Bluefox projects.

init

bfx init <project_name>
bfx init .

Scaffolds a new Bluefox project. Creates the project directory, writes all template files, and installs dependencies via uv.

Pass . to initialize in the current directory instead of creating a new one. The project name is derived from the directory name.

dev

bfx dev

Starts the full development stack via Docker Compose:

  1. Postgres 17 container starts and waits for health check
  2. Redis 7 container starts and waits for health check
  3. Migrate service runs alembic upgrade head
  4. App starts with uvicorn --reload

Must be run from inside a Bluefox project directory (one containing bluefox.yml).

db migrate

bfx db migrate <name>

Generates a new Alembic migration by comparing your models against the database schema:

  1. Starts a temporary Postgres container via Docker Compose
  2. Waits for it to become healthy
  3. Runs alembic revision --autogenerate -m <name>
  4. Stops the temporary container

The migration file is written to migrations/versions/. The next time you run bfx dev, it will be applied automatically.

Example

# After creating a new project
bfx db migrate initial

# After adding a new model
bfx db migrate add_orders_table

cloud bootstrap

bfx cloud bootstrap --ip <server_ip> --domain <domain>
bfx cloud bootstrap --local

Provisions a server with the full Bluefox Cloud infrastructure:

  • Server hardening — creates deploy user, configures SSH, enables UFW and fail2ban
  • Docker Swarm — initializes Swarm mode with an overlay network
  • Traefik — reverse proxy with automatic HTTPS via Let's Encrypt (if Cloudflare credentials are provided)
  • Docker Registry — local registry at localhost:5000
  • PostgreSQL — platform database
  • Redis — cache and queue services
  • Platform — deploys the Bluefox Cloud web and worker services

Options

Flag Description
--local Provision a local dev environment instead of a remote server
--ip Server public IP address
--domain Domain name (e.g. bluefox.software)
--ssh-port SSH port (default: 22)

Remote bootstrap

bfx cloud bootstrap --ip 37.27.83.150 --domain bluefox.software

Prompts for any missing values (Cloudflare credentials are optional). Provisions the server over SSH and deploys the platform. At the end, prints the platform URL and setup token.

Local bootstrap

bfx cloud bootstrap --local

Sets up Docker Swarm locally with all services. The platform is available at http://platform.localhost.

cloud deploy

bfx cloud deploy
bfx cloud deploy --local

Updates the platform to the latest version. Pulls the latest platform image, runs database migrations, and updates the Swarm services.

Flag Description
--local Deploy to local dev environment

cloud status

bfx cloud status
bfx cloud status --local

Shows the health of all infrastructure services:

Bluefox Cloud

  Server: deploy@37.27.83.150:6161
  Domain: bluefox.software

  ✓ SSH: connected
  ✓ Swarm: active

  ✓ Traefik: 1/1
  ✓ Registry: 1/1
  ✓ Database: 1/1
  ✓ Cache: 1/1
  ✓ Queue: 1/1
  ✓ Web: 1/1
  ✓ Worker: 1/1

  ✓ Health: ok

  Image: localhost:5000/bluefox-cloud-web:latest (sha256:abcdef123456)
  URL:   https://platform.bluefox.software
Flag Description
--local Check local dev environment

cloud login

bfx cloud login <platform_url>

Saves platform credentials for API access. Prompts for the API key and verifies the platform is reachable.

bfx cloud login https://platform.bluefox.software
# or just:
bfx cloud login platform.bluefox.software

The URL scheme (https://) is added automatically if omitted.