potions

The Potions command line tool: deploy Phoenix apps to your own servers with Potions, from your terminal, your CI or your coding agent.

potions login
potions deploy

potions deploy deploys the last commit you pushed on the current branch and waits for it. The first time, in a repository Potions doesn't know yet, it offers to create the app (potions deploy --server web-1 skips the question) and writes potions.toml so everyone uses the same app.

Full docs: potions.io/docs/cli.

Install

Homebrew (macOS 15 or newer, and Linux):

brew install potionsio/tap/potions

Install script (macOS 15 or newer, and Linux; no sudo; installs to ~/.potions/cli and ~/.local/bin/potions):

curl -fsSL https://potions.io/install.sh | sh

The script checks the download against the release's checksums.txt. To check where a release was built, run gh attestation verify potions-<version>-<target>.tar.gz --repo potionsio/potions_cli.

Hex (anywhere Elixir runs, including Alpine, older Linux and Windows):

mix escript.install hex potions_cli

This builds potions with your Elixir and Erlang and puts it in ~/.mix/escripts; add that to your PATH. An escript runs on the Erlang it was built with or a newer one, not an older one: if your projects pin different Erlang versions with asdf or mise, install it with the oldest one you use, or use Homebrew or the install script, which bring their own Erlang.

Commands

Command What it does
potions login Approve this computer in your browser. --scopes picks the abilities
potions logout Revoke this computer's token and forget it
potions whoami The account, abilities and expiry of the current login
potions link Write potions.toml for this directory's app
potions deploy Deploy the last pushed commit and wait. --no-wait, --logs, --branch, --sha, --server
potions logs [ID] A deployment's log; -f follows it
potions rollback Roll back to the previous successful deployment
potions env list Variable names and kinds, never values
potions env set NAME=VALUE Set a config value
potions env set NAME Set a secret from a hidden prompt (--stdin in CI)
potions env generate NAME Have Potions generate a random secret
potions apps, potions servers List them
potions open Open the app in the dashboard (--url for the live site)
potions setup agent Add the Potions skill to Claude Code and Codex; --mcp also connects the Potions MCP server
potions auth headers Print the Authorization header for Claude Code's MCP headersHelper (never run it in an agent session)

Every command takes --json (one JSON document on stdout), --yes, --app ID|NAME, --token and --api-url. Run potions help COMMAND for details.

Coding agents

Under Claude Code, Codex, Cursor and other agents, potions answers in JSON, never prompts and never opens a browser. When it needs a login it prints the approval link for the agent to show you and exits 3; potions login --resume finishes once you approve. Agents never set secrets: they send you to the app's environment page. potions setup agent installs the skill that teaches them all this.

CI

Create a token limited to one app in Potions (Account, API tokens, the CI deploy preset) and store it as a secret named POTIONS_TOKEN:

potions deploy --app shop --sha "$GITHUB_SHA" --branch "$GITHUB_REF_NAME"

To set a secret from CI, use a token with the env:secret ability (the CI secrets preset) and pipe the value in:

printf '%s' "$STRIPE_SECRET_KEY" | potions env set STRIPE_SECRET_KEY --stdin

Exit codes

Exit Meaning
0 Success (also an empty list, or already logged in)
1 The operation failed: a failed deploy or rollback, an API or network error
2 Usage: an unknown command or flag, a bad argument, or a confirmation needed (--yes)
3 Login needed, or the login can't do this
4 Something must change first: push, grant access, choose a server or app, add variables
124 Waiting timed out; the deployment is still running (potions logs ID -f)

In JSON mode errors look like {"ok": false, "error": {"code", "message", "next", "url", "details"}}; next is the command to run.

Files

Requirements

The Homebrew and install script builds include Erlang.

Anywhere else, including Alpine, older Linux, older macOS and Windows, install with Hex.

Development

mix deps.get
mix precommit          # compile with warnings as errors, format, test
MIX_ENV=prod mix release potions_cli
_build/prod/rel/potions_cli/bin/potions --version

Local release builds link your machine's OpenSSL and are never published; the release workflow builds the published tarballs on GitHub. scripts/sync_agent_skill.sh copies the deploy skill from the plugin repository into priv/agent_skill.

License

MIT. Copyright (c) 2026 HexMonster LLC.