DocsReference
CLI reference
npm install -g snapwakeEvery command except login and import talks to Snapwake's API with the token saved by snapwake login. Commands exit with a non-zero status when they fail and print the reason.
Configuration
| Where | What |
|---|---|
~/.flare/api.env |
FLARE_API=<API address> and FLARE_TOKEN=<token>, written by snapwake login, mode 0600 |
FLARE_API, FLARE_TOKEN |
environment variables that override the file (for CI) |
login
snapwake login [--no-browser] [--api URL]Opens the console in your browser to approve this computer, waits up to 10 minutes, and saves the token. --no-browser only prints the link. --api sets the API address (for testing; normally not needed). See Accounts and access.
deploy
snapwake deploy --image REF [NAME] [options]
snapwake deploy FOLDER [NAME] [options]Creates the app if needed, updates its settings, builds a new version on the app's home server, and waits until it is ready or has failed. Settings you don't pass keep their current values (port, command, memory, min/max); an app deployed once as a worker stays a worker until you pass --port. The name defaults to app in FOLDER/snapwake.toml, else the folder's or image's name. Pressing Ctrl-C stops the waiting, not the build.
| Option | Meaning |
|---|---|
--port N |
the port your app listens on |
--start "CMD" |
the start command; for images it replaces ENTRYPOINT and CMD |
--mem MB |
memory per VM, default 512 |
--env-file FILE |
add the file's KEY=VALUE lines to the app's secrets |
--dockerfile FILE |
build the folder with this Dockerfile (path inside the folder) |
--build-arg NAME=VALUE |
a value for a Dockerfile ARG; repeatable |
--volume NAME:/PATH:MB |
a volume; repeatable; the app then runs one VM |
--sqlite /DIR/FILE.db |
a volume for a SQLite database, plus SQLITE_PATH and DATABASE_URL |
--worker "CMD" |
make the app a worker that runs CMD |
--queue rq:NAME |
the worker sleeps on the RQ queue NAME |
--queue-list KEY |
the worker sleeps on this Redis key; repeatable |
--queue-busy KEY |
a Redis key of jobs in progress; repeatable |
--queue-url NAME |
the secret holding the Redis URL, default REDIS_URL |
A folder deploy uploads the folder without node_modules, .next, .medusa, .git, .vercel, .netlify, .DS_Store, .env and .env.*, and without what .dockerignore excludes. See Deploying an app.
If FOLDER/snapwake.toml names several apps, deploy deploys each in turn. Options on the command line apply to each of them.
Options the API doesn't support yet are refused rather than ignored.
apps
snapwake appsLists your apps: name, home server, current version, state, running VMs, health. snapwake list does the same.
status
snapwake status [APP]Without an app, the same as apps. With one: its row, its process (memory, VM range, health check), its last failure, and its last five versions with the current one marked *. See Logs and status.
logs
snapwake logs APP [-f]The last 100 lines of the app's log. -f keeps printing new lines (checks every second) until you press Ctrl-C.
secret
snapwake secret APP set KEY=VALUE [KEY=VALUE...]
snapwake secret APP unset KEY [KEY...]
snapwake secret APP listSets, removes or lists (names only) the app's secrets. Running apps keep their old environment until snapwake redeploy APP. See Secrets.
redeploy
snapwake redeploy APPA new version from the current version's source: the same image reference (pulled again) or the same uploaded folder, with the same Dockerfile and build arguments.
rollback
snapwake rollback APPMakes the previous version current again. Running it twice returns to where you started. See Versions and rollbacks.
scale
snapwake scale APP [--min N] [--max N] [--concurrency N]Sets how many VMs the app keeps awake (--min), may run (--max), and how many requests in flight per VM make it add one (--concurrency). Options you leave out keep their value. Web apps only. See Scaling.
health
snapwake health APP --path /PATH [--every SECONDS]
snapwake health APP --offSets or removes the app's health check. --every defaults to 10 seconds. Web apps only. See Health checks.
delete
snapwake delete APP --yesStops the app on every server and removes it. Without --yes it only tells you what it would do. It can't be undone.
import
snapwake import FOLDER [--force]Writes FOLDER/snapwake.toml from a fly.toml, docker-compose.yml or Procfile in that folder, and prints it. --force replaces an existing file. It doesn't contact Snapwake. See Importing.