CLI
CLI commands
Every flockvm CLI command with its options and real output: login, the catalog, VMs, SSH keys, environments, variables, secret files and MCP setup.
Every command takes --json (the API's JSON on standard output), --api-url <url> and --help. VMs and environments are named by id or by name. Install and log in first: see Overview.
In the examples below, HOST stands for the host in your VM's SSH command, as in Connect over SSH.
Account
login
Saves an API key to the config file, after checking it with the API. Without options it offers to open Settings → API keys in your browser, then reads the key without echoing it. --with-token reads it from standard input; typed at a terminal rather than piped, it is hidden too.
logout
Removes the saved key from the config file. The key stays valid until you revoke it in Settings → API keys.
whoami
The user, organization and role the key acts as, the key's name and expiry, and where the key and the API URL come from. See Log in.
Catalog
What your organization can create VMs with.
SIZES AVAILABLE NOW is what the region's host has room for at this moment. See Sizes, Images and Regions.
VMs
vm list
Every VM of the organization, newest first. flockvm ls is the same.
GitHub Actions runner VMs are listed with (runner) after their name. flockvm drives them: start, stop, pause, resume and delete refuse them.
vm get
One VM, with its SSH command and its cost so far.
vm create
Creates a VM and starts it. Only the name is required:
| Option | Left out |
|---|---|
--size <size> |
The size the dashboard preselects: default, else small, large, xlarge, among those the region has room for. |
--region <id> |
The API's default region, France (gra), the one region today. --region par no longer exists. |
--image <id> |
The Agent image, ubuntu-26.04-agent. --image ubuntu-26.04 for Minimal. The Ubuntu 24.04 ids (ubuntu-24.04-agent, ubuntu-24.04) are refused with a 400 naming their replacement. |
--ssh-key <key> |
The first key saved in your account, else ~/.ssh/id_ed25519.pub. Give a saved key's id or name, or a .pub file. With a file, --save-key also saves it to your account. |
--env <environment> |
The organization's default environment. --env none for no environment. |
-e KEY=VALUE |
No per-VM variables. Repeat it for several; they go over the environment's. |
--wait |
Return at once, while the VM is starting. With --wait, return once it is out of starting, and exit 1 if it failed. --timeout caps the wait, 300 seconds by default. |
The create rules are the dashboard's: billing must be in order, a member can only use environments open to members, and environments and per-VM variables work in every region. When the region has no room for the size, the API answers 409 capacity: try a smaller size, or look at flockvm regions.
vm start, stop, pause, resume
Pause keeps memory and processes, stop keeps the disk only; neither is billed. See Lifecycle. Each one answers the VM's status right after the request; --wait waits until it is out of starting, pausing or stopping.
vm delete
Deletes the VM and its disk. On a terminal it asks first; in a script, add --yes, or it exits with code 2 and deletes nothing.
vm logs
The VM's console log, oldest first. --tail (or -n) keeps the last lines, 1 to 1000.
Use it when a VM is stuck starting or ended in error. For what happens inside a running VM, SSH in. See Logs and live usage.
vm ssh
Runs ssh -p <port> user@host with the VM's SSH address, the host, port and user the API gives. What follows -- goes to ssh: options before the host, a remote command after it. The exit code is ssh's.
Only your options reach ssh: the CLI builds the command from the host, port and user alone, and passes on no option of the API's ssh.command text. A paused VM must be resumed first, a stopped one started: the command says so instead of connecting. For ~/.ssh/config, scp and port forwarding without the CLI, see Connect over SSH.
SSH keys
The public keys saved in your account, the same list as Settings → Account → SSH keys. They belong to your user, not to the organization.
--name defaults to the key's comment. ssh-key add - reads the key from standard input. A private key is refused. When several of your keys share a name, rm and vm create --ssh-key refuse that name and list the ids to use instead. Removing a key leaves the VMs that have it alone. See SSH keys.
Environments
Environments hold the variables and secret files every new VM gets. Everyone can read them; only owners and admins change them. Values are never printed, except by env reveal. A command without an environment uses the organization's default one.
env list
MEMBERS says whether members can create VMs with it.
env get
Switches, variables with the last 4 characters of their value, and files with their size.
env create, rename, default, delete
Names are 1 to 40 characters among lowercase letters, digits and dashes. none is reserved: it means no environment. The default environment cannot be deleted: make another one the default first. env delete asks for confirmation on a terminal, and needs --yes elsewhere.
env update
Turns an environment's switches on or off, then shows it.
| Option | Switch in the dashboard |
|---|---|
--secrets on|off |
Secrets: the variables and files go into new VMs. |
--agent-credentials on|off |
Agent credentials: the organization's Anthropic key, as ANTHROPIC_API_KEY. |
--github-repos on|off |
GitHub repositories: the organization's repositories are cloned. |
--members-can-use on|off |
Members can use it. |
--safe-for-third-parties on|off |
Safe for third parties: nothing of the organization goes in. |
env set
Sets variables. KEY=- reads that value from standard input, so it never lands in your shell history: piped as is, or typed at a terminal without echo (STRIPE_KEY (hidden):), one line only: pipe multi-line values such as a PEM key. --from-dotenv reads every variable of a .env file.
A value under 8 characters shows no last characters (DEBUG (…)). --from-dotenv reads KEY=value lines, skips comments, and accepts export and quoted values.
Each variable is saved by its own request, so setting three variables makes three new versions. VMs keep the version they were created with: only new VMs get the change.
env unset
env file
Adds or removes a secret file, written into each new VM at that path under the login user's home.
- reads the file from standard input, which must be a pipe or a redirect, not a terminal. The CLI checks the limits before it uploads anything: 256 KiB a file, 20 files and 512 KiB in all per environment. More in Environments.
env reveal
Prints the values, for owners and admins only, and records the reveal in the audit log. Standard output is the variables as a valid .env, nothing else:
The header line (# staging v6: secret values below.) and the list of files (# Files, not printed: ~/app/.env (95 B). Print one with --file <path>.) go to standard error. --file prints one file's content instead, byte for byte, binary files included:
--json gives everything at once: the variables, and each file in content_base64.
MCP
mcp add
Connects an MCP client to the flockvm MCP server.
claude runs claude mcp add for Claude Code (--print shows the command instead, --scope is passed on). At the local and user scopes, the header holds the key you are logged in with, in Claude Code's own private config. With --key-from-env it is the literal text Bearer ${FLOCKVM_API_KEY}, which Claude Code expands from its environment when it starts.
--scope project writes .mcp.json at the root of the repository, which is usually committed, so it requires --key-from-env; without it the command refuses and changes nothing. If claude is not installed, the command to run is printed with <key> in place of the key.
cursor, codex and json print the snippet for that client's config file. It reads the key from FLOCKVM_API_KEY in the client's environment, so it can be committed; --embed-key writes your key into it instead, for a private file only. Neither --key-from-env nor printing a snippet needs you to be logged in. --name changes the server's name in the client, flockvm by default. What each one prints, and how to do it by hand, is in Connect a client.