CLI commands¶
The bfx command (alias for bluefox) provides the primary workflow for Bluefox projects.
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¶
Starts the full development stack via Docker Compose:
- Postgres 17 container starts and waits for health check
- Redis 7 container starts and waits for health check
- Migrate service runs
alembic upgrade head - App starts with
uvicorn --reload
Must be run from inside a Bluefox project directory (one containing bluefox.yml).
db migrate¶
Generates a new Alembic migration by comparing your models against the database schema:
- Starts a temporary Postgres container via Docker Compose
- Waits for it to become healthy
- Runs
alembic revision --autogenerate -m <name> - 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¶
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¶
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¶
Sets up Docker Swarm locally with all services. The platform is available at http://platform.localhost.
cloud deploy¶
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¶
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¶
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.