flyctl

command module
v0.5.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

The Fly CLI

flyctl

Ship any app or agent to Fly.io in minutes.

Release CI Community


flyctl is the Fly.io CLI. Use the fly command to create and deploy apps, manage Machines and volumes, configure networking, and more.

Installation

# macOS, Linux, WSL (installs flyctl and a fly alias)
curl -L https://fly.io/install.sh | sh
curl -L https://fly.io/install.sh | sh -s pre        # latest pre-release
curl -L https://fly.io/install.sh | sh -s <version>  # specific version

# Homebrew
brew install flyctl

# Windows (PowerShell)
iwr https://fly.io/install.ps1 -useb | iex

Binaries for every platform are on the Releases page. They ship as flyctl, so use that name or alias it to fly. Upgrade a script install with fly version upgrade, or a Homebrew install with brew upgrade flyctl.

Launch an app

Sign up or log in, then run fly launch in your project's directory. It detects your framework, writes a fly.toml, and deploys:

fly auth signup    # or: fly auth login
fly launch

Already have a Docker image? Point a fly.toml at it, create the app, and run fly deploy:

app = "my-app"

[build]
  image = "ghcr.io/your-org/your-app:latest"

[http_service]
  internal_port = 8080  # the port your image listens on
fly apps create my-app
fly deploy

Run fly deploy again to ship changes. Without an image in [build], it builds your app as [build] configures, by default from your Dockerfile:

fly deploy
fly status
fly open

Commands use the app named in fly.toml in the current directory. Pass -a <app-name> to act on a different app.

Scale

Add Machines, add regions, or resize them:

fly scale count 3
fly scale count 2 --region ams,syd
fly scale vm shared-cpu-2x
fly platform regions

Secrets and storage

Secrets are set as environment variables on your Machines. Volumes give a Machine persistent disk once you mount them with a [mounts] section in fly.toml. Each volume belongs to one Machine in one region, so create one per Machine:

fly secrets set API_KEY=...
fly volumes create data --size 10

Databases

Create a Managed Postgres cluster and attach it to your app, which sets DATABASE_URL:

fly mpg create
fly mpg attach <cluster-id>

Create a Redis database, then set the URL it prints as a secret on your app:

fly redis create
fly secrets set REDIS_URL=redis://...
fly redis connect    # needs redis-cli

Debug

fly logs
fly ssh console
fly doctor

Run Machines directly

Start a Machine in an app from any image, outside of fly deploy:

fly machine run nginx -a my-app
fly machine list -a my-app

Use with coding agents

Set up your local coding agents with Fly's skills and the hosted MCP server:

fly setup agent

Reference

Every command has --help with flags and examples:

fly launch --help
fly scale count --help

Developing

flyctl is written in Go. Build a binary into bin/ and run the unit tests:

make build
./bin/flyctl version
make test
Path Purpose
internal/command One package per command (launch, deploy, ...)
scanner Framework detection for fly launch
gql GraphQL client for the Fly API
test/preflight Integration tests that run against production infra

See CONTRIBUTING.md for preflight tests, the Windows build, and the release schedule.

License

flyctl is released under the Apache 2.0 license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal/proto
Package proto implements the agent's protocol.
Package proto implements the agent's protocol.
api module
cmd
audit command
Borrowed from https://www.calhoun.io/creating-random-strings-in-go/
Borrowed from https://www.calhoun.io/creating-random-strings-in-go/
internal
appconfig
Package appconfig implements functionality related to reading and writing app configuration files.
Package appconfig implements functionality related to reading and writing app configuration files.
cache
Package cache implements accessing of the state.yml file.
Package cache implements accessing of the state.yml file.
cli
Package cli implements the command line interface.
Package cli implements the command line interface.
command
Package command implements helpers useful for when building cobra commands.
Package command implements helpers useful for when building cobra commands.
command/agent
Package agent implements the agent command chain.
Package agent implements the agent command chain.
command/apps
Package apps implements the apps command chain.
Package apps implements the apps command chain.
command/auth
Package auth implements the auth command chain.
Package auth implements the auth command chain.
command/curl
Package curl implements the curl command chain.
Package curl implements the curl command chain.
command/dig
Package dig implements the dig command chain.
Package dig implements the dig command chain.
command/docs
Package docs implements the docs command chain.
Package docs implements the docs command chain.
command/doctor
Package doctor implements the doctor command chain.
Package doctor implements the doctor command chain.
command/extensions
Package logs implements the logs command chain.
Package logs implements the logs command chain.
command/feedback
Package feedback implements the feedback command, which files a report with the Fly.io feedback API.
Package feedback implements the feedback command, which files a report with the Fly.io feedback API.
command/history
Package history implements the history command chain.
Package history implements the history command chain.
command/logs
Package logs implements the logs command chain.
Package logs implements the logs command chain.
command/platform
Package platform implements the platform command chain.
Package platform implements the platform command chain.
command/root
Package root implements the root command.
Package root implements the root command.
command/setup
Package setup implements `fly setup`, commands that prepare a machine for Fly.
Package setup implements `fly setup`, commands that prepare a machine for Fly.
command/skills
Package skills implements the skills command chain, which installs the Fly agent skills from github.com/superfly/skills into local coding agents.
Package skills implements the skills command chain, which installs the Fly agent skills from github.com/superfly/skills into local coding agents.
command/sprites
Package sprites implements the `fly sprites` commands, which manage Sprites: persistent, hardware-isolated Linux environments.
Package sprites implements the `fly sprites` commands, which manage Sprites: persistent, hardware-isolated Linux environments.
command/status
Package status implements the status command chain.
Package status implements the status command chain.
command/trace
Package trace runs a subprocess within a flyctl trace.
Package trace runs a subprocess within a flyctl trace.
command/version
Package version implements the version command chain.
Package version implements the version command chain.
dockerfileurl
Package dockerfileurl classifies Dockerfile URLs and makes them safe to display.
Package dockerfileurl classifies Dockerfile URLs and makes them safe to display.
env
Package env implements environment related functionality.
Package env implements environment related functionality.
filemu
Package filemu implements file-based mutexes.
Package filemu implements file-based mutexes.
flag
Package flag implements flag-related functionality.
Package flag implements flag-related functionality.
format
Package format implements various formatters.
Package format implements various formatters.
machinelimit
Package machinelimit tells customers when their organization is close to its Machines limit, and where to ask for more.
Package machinelimit tells customers when their organization is close to its Machines limit, and where to ask for more.
oci
prompt
Package prompt implements input-related functionality.
Package prompt implements input-related functionality.
requestauth
Package requestauth selects credentials for requests with a known organization.
Package requestauth selects credentials for requests with a known organization.
requestauth/authtest
Package authtest checks the wire credentials selected by command contexts.
Package authtest checks the wire credentials selected by command contexts.
sentry
Package sentry implements sentry-related functionality.
Package sentry implements sentry-related functionality.
set
sort
Package sort implements common sorting functions.
Package sort implements common sorting functions.
spritestate
Package spritestate stores what the sprites commands remember between runs: the default organization and the Sprites API token minted for each organization.
Package spritestate stores what the sprites commands remember between runs: the default organization and the Sprites API token minted for each organization.
state
Package state implements setters and getters for command contexts.
Package state implements setters and getters for command contexts.
task
Package task implements async task handling.
Package task implements async task handling.
scripts
tools
distribute command
version command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL