Skip to content

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

CommandSubcommands / ArgumentsDescription
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.

bash
microfly deploy [--dir <path>] [--branch <name>] [--ttl <duration>] <app>
  • --dir <path>: Path to directory containing app.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.

bash
microfly restart <app>

microfly rollback

Rolls back to the previous immutable release instantly, or to an explicit release ID.

bash
microfly rollback <app> [release-id]

microfly releases

Lists immutable deployment release history and the currently active release.

bash
microfly releases <app>

Example output:

text
Releases for my-app (current: 20260903T101530-000001):
  * 20260903T101530-000001 (active)
    20260903T090000-000000

microfly apps

Manage application lifecycles.

bash
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 releases

microfly logs

Stream or read application logs.

bash
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.

bash
microfly env set <app> KEY=value [KEY2=value2...]
microfly env list <app>
microfly env unset <app> KEY [KEY2...]

microfly secrets

Manage encrypted secrets.

bash
# 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-key

microfly domains

Dynamically manage domains assigned to an application without editing app.toml or redeploying code.

bash
# 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.

bash
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 previews

microfly init-git

Initialize a bare Git repository with automated deployment hooks.

bash
microfly init-git <app>

microfly init-proxy

Output production reverse-proxy configuration snippets.

bash
microfly init-proxy caddy
microfly init-proxy nginx
microfly init-proxy apache2

Released under the MIT License.