CLI Reference
MicroFly provides a unified, POSIX-compliant command-line interface (microfly).
Commands targeting the running daemon communicate with /run/microfly/admin.sock and require root or sudo privileges.
Command Summary
| Command | Subcommands / Arguments | Description |
|---|---|---|
microfly version | - | Print binary version, commit, architecture, and Go runtime. |
microfly daemon | [--config <path>] | Start the MicroFly supervisor daemon. |
microfly init | [--config <path>] | Initialize directories and generate master encryption key. |
microfly init-proxy | [caddy | nginx | apache2] | Generate boilerplate configuration for reverse proxies. |
microfly init-git | <app> | Create a bare Git repository with automated post-receive hooks. |
microfly deploy | [--dir <dir>] [--branch <b] [--ttl <t>] <app> | Deploy an application from a local directory or branch. |
microfly restart | <app> | Perform a zero-downtime rolling restart. |
microfly rollback | <app> | Instantly roll back to the previously active release. |
microfly status | <app> | Display application runtime details, PID, port, and memory. |
microfly ps | - | Display all active processes across all applications. |
microfly logs | [-f] [-n <lines>] <app> | View or stream real-time application logs. |
microfly apps | [list | stop | start | destroy] | Manage application lifecycles. |
microfly env | [set | list | unset] | Manage dynamic environment configuration. |
microfly secrets | [set | list | unset | rotate-key] | Manage encrypted application secrets and master keys. |
microfly domains | [list | add | rm | generate] | Manage custom domains and platform subdomains. |
microfly preview | [list | promote | sweep] | Manage ephemeral branch preview environments. |
Detailed Command Specifications
microfly deploy
Deploys a release from a local directory.
microfly deploy [--dir <path>] [--branch <name>] [--ttl <duration>] <app>--dir <path>: Path to directory containingapp.toml(default: current directory).--branch <name>: Branch name for creating an ephemeral preview environment.--ttl <duration>: Time-to-live for preview environments (e.g.24h,48h). Default:48h.
microfly restart
Performs a zero-downtime rolling restart of the application.
microfly restart <app>microfly rollback
Rolls back to the previous immutable release instantly, or to an explicit release ID.
microfly rollback <app> [release-id]microfly releases
Lists immutable deployment release history and the currently active release.
microfly releases <app>Example output:
Releases for my-app (current: 20260903T101530-000001):
* 20260903T101530-000001 (active)
20260903T090000-000000microfly apps
Manage application lifecycles.
microfly apps list # List all applications and active releases
microfly apps stop <app> # Stop running application without deleting data
microfly apps start <app> # Start a stopped application
microfly apps destroy <app> # Permanently delete application and releasesmicrofly logs
Stream or read application logs.
microfly logs [-f] [-n <count>] <app>-f: Follow log output in real time.-n <count>: Number of past log lines to show (default: 50).
microfly env
Manage dynamic environment variables.
microfly env set <app> KEY=value [KEY2=value2...]
microfly env list <app>
microfly env unset <app> KEY [KEY2...]microfly secrets
Manage encrypted secrets.
# Read secret value from stdin (recommended to protect shell history)
printf '%s' 'secret-val' | microfly secrets set <app> KEY
# List secret names (values masked)
microfly secrets list <app>
# Delete secret
microfly secrets unset <app> KEY
# Online atomic master key rotation
microfly secrets rotate-keymicrofly domains
Dynamically manage domains assigned to an application without editing app.toml or redeploying code.
# List all assigned domains (both manifest and dynamic)
microfly domains list <app>
microfly domains <app>
# Add one or more custom domains dynamically
microfly domains add <app> <domain> [<domain2>...]
# Remove a dynamically assigned domain
microfly domains rm <app> <domain>
# Auto-generate platform domain (<app>.<default_domain>)
microfly domains generate <app>microfly preview
Manage ephemeral preview environments.
microfly preview list # List all active previews and expiry times
microfly preview promote <preview-app> # Promote preview release to base application
microfly preview sweep # Sweep and destroy expired previewsmicrofly init-git
Initialize a bare Git repository with automated deployment hooks.
microfly init-git <app>microfly init-proxy
Output production reverse-proxy configuration snippets.
microfly init-proxy caddy
microfly init-proxy nginx
microfly init-proxy apache2