The floor CLI
Installing the floor command, signing in, and every command it has, grouped by what it's for.
floor is the command-line tool for Floor: it makes and runs backends, builds and ships
releases, and manages a project's data, devices and messages. floor <command> --help lists a
command's arguments.
Install
On Linux and macOS:
curl -fsSL https://usefloor.dev/install.sh | shOn Windows, irm https://usefloor.dev/install.ps1 | iex. Or build it from crates.io:
cargo install usefloor --features cliSign in
floor --endpoint https://usefloor.dev login --email you@example.comfloor login signs in and saves the endpoint and token in <config dir>/floor/credentials.toml
(~/.config/floor on Linux, %APPDATA%\floor on Windows). With --email it asks for your
password. Without it, it reads a token from stdin. Later commands use what it saved.
The saved token goes only to the endpoint it came from: a command with --endpoint pointing
elsewhere doesn't send it.
Global flags
| Flag | Environment variable | |
|---|---|---|
--endpoint <url> | FLOOR_ENDPOINT | Floor's URL. Default: the one floor login saved, else http://127.0.0.1:8080. |
--token <token> | FLOOR_TOKEN | A session or access token. Default: the one floor login saved. |
--json | Print JSON instead of tables. |
Account
| Command | |
|---|---|
floor login [--email <email>] | Sign in and save the endpoint and token for later commands. |
floor whoami | Who the saved token belongs to. |
floor status | Floor's health. |
floor tokens list [--mine] | Personal access tokens. |
floor tokens create <name> [--scope read|write] [--area <area>[:read|write]]… [--project <slug>]… [--days <n>] | Make a token for scripts, CI and AI tools. The secret is shown once. Areas: packages, deploys, data, devices, messages, maps, watch, platform. |
floor tokens revoke | Stop a token now. |
floor mcp config [--tool claude|codex|cursor|other] | Print how to connect an AI tool to Floor's MCP server. |
Developing
| Command | |
|---|---|
floor new <name> [--project <slug>] | Make a backend on the framework in ./<name>: Cargo.toml, floor.toml, build.rs, src/, api/health.rs, permissions.rs, channels.rs, a first migration and a test. |
floor new route <path> [--method get|post|put|patch|delete] [--public | --role <roles> | --can <resource:action>] | Add a route under api/: floor new route "visits/[id]" --can visits:read. Without --public, --role or --can, it is signed_in. |
floor new job <name> (--every <interval> | --cron <schedule> | --queue <queue> [--concurrency <n>]) | Add a tick, a cron schedule or a queue's jobs under jobs/. |
floor new mqtt <name> [--filter <filter>] | Add an MQTT handler under on/mqtt/; the filter defaults to +/events. |
floor dev [--project <slug>] [--port <port>] [--database-url <url>] [--ts <file>] [--web] | Run the backend in this folder against Floor. On every save it rebuilds, regenerates the dashboard's client and restarts. |
floor test [-- <cargo test args>] | Run the backend's tests (cargo test) against the local Postgres. Each TestApp makes a database of its own there. |
floor prepare [--database-url <url>] | Check the backend's query! SQL against its migrated dev database and keep what builds need in .sqlx/. Commit it: deploys and CI then check offline. |
floor dev runs against the project in floor.toml unless --project names another; use a
dev environment (--project sac-dev), not production, because Floor sends that project's
triggers to your backend. Its database defaults to <name>_dev on the local Postgres
(FLOOR_DEV_POSTGRES). --web also runs the dashboard's dev server in web/. See
The dev loop.
floor test sets FLOOR_TEST_DATABASE_URL from --postgres, FLOOR_DEV_POSTGRES, or the
local default. See Testing.
Shipping
| Command | |
|---|---|
floor build [<target>…] [--env <name>] [--out <dir>] [--skip-build] [-c <floor.toml>] | Build what floor.toml describes into one .floor release file, without deploying it. |
floor deploy [<target>… | <file>.floor] [--env <name>] [-m <message>] | Build the .floor release and ship it, or ship a .floor file as it is. Prints the deployment's log as it goes. |
floor build-env [--env <name>] | The environment's build variables, for a build step of your own: added to $GITHUB_ENV in GitHub Actions (secrets masked), else printed as export lines. |
floor deployments list [<project>] [--target <name>] | Recent deployments. |
floor deployments show <project> <id> | One deployment and its log. |
floor deployments rollback <project> <id> | Serve an earlier ready deployment again. |
floor deployments retire <project> <target> | Stop serving a target everywhere; its history stays. |
floor deployments repos [<project>] | GitHub repositories that deploy to a project. |
floor deployments link <project> <owner/repo> [--branch <branch>] | Let a repository's GitHub Actions deploy to a project from a branch (default main). |
floor deployments unlink <project> <owner/repo> | Stop it. |
floor deployments vars <project> | Variables apps get, per environment. |
floor deployments set-var <project> <name> <value> [--env production|preview|all] [--secret] | Set one. A secret is never shown again. |
floor deployments rm-var <project> <name> [--env …] | Remove one. |
--env staging deploys to the project's staging environment, <project>-staging. In GitHub
Actions, floor deploy signs in with the run's OIDC token (the job needs permissions: id-token: write), and the branch decides the environment. See Deploy and
floor.toml.
Projects and access
| Command | |
|---|---|
floor projects list | Every project. |
floor projects show <slug> | One project: its hostnames and prefixes. |
floor projects create <slug> --name <name> [--host <hostname>]… | Make a project. |
floor projects add-env <slug> <name> [--host <hostname>]… | Add an environment (staging): a project of its own, <slug>-<name>, with its own data. |
floor projects update <slug> [--name <name>] [--host <hostname>]… [--color <#rrggbb>] | Change one. --host replaces all its hostnames. |
floor projects delete <slug> --yes | Delete one, and its secrets. |
floor secrets list <project> | A project's secrets, without their values. |
floor secrets set <project> <name> [--value <value>] | Set a secret. Without --value it is read from stdin, which keeps it out of shell history. |
floor secrets delete <project> <name> | Delete one. |
floor users … | Floor accounts: list, show, create, set-password, roles <user> --role <project:role>…, disable, enable, link, delete. |
floor invite --email <email> --name <name> [--org <slug>] [--role <project:role>]… | Invite someone: makes their account and prints a link to set a password. |
floor orgs list | create <slug> --name <name> | delete <slug> | Organizations: customers, and the team that runs Floor. |
floor roles list | The roles each project defines. |
floor roles set <project> <role[=description]>… | Replace a project's roles. Removing a role removes it from everyone who holds it. |
floor clients list <project> | A project's sign-in clients: OIDC apps and service accounts. |
floor clients create <project> <client-id> --name <name> --kind … | Register one. A service client's secret is printed once. |
floor clients rotate-secret <project> <client-id> | Replace a service client's secret; the old one stops at once. |
floor clients delete <project> <client-id> --yes | Delete one. |
Data
| Command | |
|---|---|
floor db list | show <project> | Project databases, with size and connections. |
floor db create <project> | Create the project's database and its <project>_app role. |
floor db update <project> | Install more extensions or change the connection limit. |
floor db url <project> | Print the connection URL, password included: psql "$(floor db url sac)". |
floor db migrate <project> --source <dir> | Apply a directory of sqlx migrations to the project's database. |
floor db rotate-password <project> | Give the role a new password and print the new URL. |
floor db delete <project> --yes | Drop the database and its role, for good. |
floor cache list | show | create | url | rotate-password | delete | The project's Valkey user, confined to keys and channels under <project>:. |
floor kv namespaces | Every project's KV namespace, with counts. |
floor kv list <project> [--prefix <p>] | Keys in a namespace. |
floor kv get <project> <key> | Print a value (raw bytes to stdout). |
floor kv put <project> <key> [--value <v> | --file <path>] [--ttl <seconds>] | Store a value; from stdin without --value or --file. |
floor kv delete <project> <key> | Delete a key. |
floor blob info | The store, with usage per project and lifecycle rules. |
floor blob ls <project> [--prefix <p>] | Objects under the project's prefix. |
floor blob put <project> <file> [--key <key>] [--content-type <type>] | Upload a file. |
floor blob get <project> <key> [-o <file>] | Download an object (-o - for stdout). |
floor blob url <project> <key> | Print a signed download URL. |
floor blob rm <project> <key> | Delete an object. |
floor blob rules <project> [--rule <prefix>=<days>]… [--clear] | Show or replace lifecycle rules: --rule snapshots/=30. |
floor jobs queues [--project <slug>] | Every queue with jobs. |
floor jobs enqueue <project> <queue> [--payload <json>] [--delay <seconds>] | Add a job. |
floor jobs list <project> <queue> | Jobs in a queue, newest first. |
floor jobs show | retry | delete <project> <id> | One job; put a failed one back with fresh attempts; delete one. |
floor jobs work <project> <queue> | Take jobs from a queue by hand: claim them, print them, complete them. |
floor cron list [--project <slug>] | Schedules, including the floor.<name> entries of #[cron] handlers. |
floor cron set <project> <name> --schedule <cron> --queue <queue> [--payload <json>] [--timezone <tz>] | Create or replace a schedule that enqueues a job each time it fires. |
floor cron pause | resume | run | delete <project> <name> | Pause, resume, run now, or delete a schedule. |
floor ingest list | set | test | delete | Rules that turn device messages into rows in a project's database. |
floor backups status | now | Backups of the Postgres server, WAL archiving and restore drills. |
Realtime and devices
| Command | |
|---|---|
floor realtime status | The MQTT bridge and open realtime connections. |
floor realtime watch <project> [--channels <list>] | Print messages as they arrive. |
floor realtime publish <project> <channel> --data <json> | Send JSON to everyone listening on an app:<name> channel. |
floor devices list [--project <slug>] [--status <status>] | Devices: gateways, controllers, edge boxes. |
floor devices show <device> | One device, by id or project/HARDWARE-ID. |
floor devices config <device> [--set key=value]… [--remove key]… | Show the desired and reported config, or change desired settings. |
floor devices command <device> <name> [--args <json>] [--timeout <seconds>] [--no-wait] | Send a command and wait for the device's answer. |
floor devices commands | Recent commands and their answers. |
floor devices approve | revoke | delete | Approve a pending device; reject or revoke one; delete one. |
floor devices simulate <project> --hardware-id <id> | Act as a device: make a key, claim, wait for approval, get a token, connect to MQTT. |
floor claim-codes list | create | delete <project> | Claim codes to print on device labels (shown once). |
floor media … | Cameras, viewer leases, snapshots and recordings: status, cameras, add, set, remove, watch, leases, end, snapshot, recordings. |
floor releases … | Signed firmware and edge models, rolled out in rings: list, show, upload, rollout, pause, resume, abort, advance, remove, keys list | add | revoke. |
See Devices and MQTT.
Messaging
| Command | |
|---|---|
floor messages send <project> --to <to> (--template <name> [--var name=value]… | [--subject <s>] --text <t>) [--whatsapp | --push] [--lang en|ur] | Send an email, WhatsApp message or push notification. |
floor messages list [--project <slug>] [--status <status>] | The message log, newest first. |
floor messages show <id> | One message with its timeline and bodies. |
floor messages retry <id> | Send a failed message again. |
floor messages stats [--project <slug>] | Counts by status over 30 days. |
floor templates list | show | put | test | delete | Message templates in English and Urdu. put <project> <name> --file <json> saves the next version. |
floor email … | Sending domains (SPF, DKIM, DMARC), sender addresses and the suppression list: status, add-domain, check-domain, remove-domain, add-sender, remove-sender, suppressions, suppress, unsuppress. |
floor whatsapp … | WhatsApp numbers: numbers, add, link, warmup, skip-warmup, pause, resume, reconnect, relink, update, remove. |
floor push tokens | register | unregister <project> | Expo push tokens registered by a project's app. |
floor webhooks … | Signed callbacks: list, add, update, remove, rotate-secret, test, deliveries, delivery, redeliver, redeliver-failed, and receive, a local endpoint that checks signatures and prints each event. |
See Messages.
Gateway
| Command | |
|---|---|
floor gateway status | Listeners, certificate mode and totals. |
floor gateway routes [--project <slug>] | Routes by hostname. |
floor gateway add | update | remove | Add, change or remove a route. |
floor gateway certs | TLS certificates of routed hostnames. |
floor gateway renew <hostname> | Request a certificate now. |
floor gateway logs [--host <hostname>] [--project <slug>] [--errors] [--follow] | Recent requests, newest first. |
AI and maps
| Command | |
|---|---|
floor ai status | Providers, the default model, the OCR service and the last day's totals. |
floor ai ask <project> <prompt> [--model <m>] [--system <s>] [--max-tokens <n>] | Ask a model once, as the project. |
floor ai ocr | Read the text in an image. |
floor ai usage <project> [--days <n>] | What a project used and its limits. |
floor ai limits <project> [--tokens <n>] [--images <n>] | Set a project's monthly limits. |
floor maps … | Map data versions, owners, keys and the signals: status, data, use, owners, link, keys list | create | rotate | revoke, seed-signals. |
See AI.