CLI
reactor is the command-line client for a cluster. It talks to /console/v1 with a console session, and to the platform routes with an operator token. Use it to create the first operator, link a project directory, and ship SQL, functions, and a site.
Named sessions live in ~/.config/reactor/contexts.json. REACTOR_HOME overrides that directory. --context or REACTOR_CONTEXT selects one for a single command.
Project commands read reactor.toml in the current directory and use the session whose URL matches that file.
Install
Section titled “Install”Homebrew, on a Mac:
brew tap reactor-cloud/reactorbrew install reactorv1.26.11-beta1 builds from source and needs Rust, which Homebrew installs as a build dependency. The formula uses tag v1.26.11-beta1 of reactor-cloud/reactor.
From a clone of the server repository, at the repository root:
cargo install --locked --path crates/reactor-cliThat binary is named reactor-cli. Homebrew renames it to reactor. Either name runs the same commands.
Session
Section titled “Session”reactor setup --url http://127.0.0.1:18000 --cluster local --email you@example.com --name "Ada Lovelace"reactor login --context local --url http://127.0.0.1:18000 --email you@example.comreactor login --context fly --url https://fly1.reactor.cloud --email you@example.comreactor login --url http://127.0.0.1:18000 --token "$OPERATOR_TOKEN"reactor contextreactor context use flyreactor logoutsetup is the first run. When it returns a session, that session is stored under the cluster name. login stores a named context and makes it current. Omit --context and the name comes from the host (127.0.0.1 is local). A later login to the same URL updates that context. login --email stores the console token. login --token stores the platform operator token used by db migrate on the same context. A password flag or REACTOR_PASSWORD skips the prompt.
context lists contexts. context use changes the current one. logout clears the current context’s tokens. projects and cluster use the current context. Project commands use the context that matches reactor.toml.
Projects and keys
Section titled “Projects and keys”reactor projectsreactor projects create todos --linkreactor link --url http://127.0.0.1:18000 --ref <ref> --service-key <service key>reactor keys rotateprojects lists projects this operator can open. create prints the ref, anon key, and service key once:
ref: abcdefghijklmnopqrstanon: eyJ...service: eyJ...--link writes reactor.toml and .reactor/service_key. link does the same write when you already have the key. keys rotate prints a new pair and rewrites .reactor/service_key when that file exists. The previous anon and service keys stop working.
Service keys
Section titled “Service keys”reactor service-keysreactor service-keys create factory --scope projects.create --scope auth.usersreactor service-keys revoke <id>service-keys lists the signed-in operator’s console service keys: id, name, scopes, and created time. create prints the token once. Repeat --scope for each scope: projects.create, projects.migrate, projects.sql, auth.settings, auth.providers, auth.email, auth.users. revoke deletes that key.
reactor sql --file query.sqlreactor sql --write --confirmsql runs against the linked project. The default is a read-only transaction. --write allows changes. --confirm accepts warnings such as DROP or a table created without row-level security. With no --file, the statement comes from stdin.
Deploy and database
Section titled “Deploy and database”reactor deployreactor db migrate --allreactor db tablesreactor db rows todosdeploy uses the service key in .reactor/service_key. It applies pending project migrations, uploads functions/<name>/ as zips, and uploads site/ as one deployment. A failed file upload does not promote the site.
db migrate --all needs the operator token from login --token. --dry-run lists project refs and does not apply SQL. db tables and db rows read the linked project through the console. rows prints up to 50 lines.
Day to day
Section titled “Day to day”reactor logsreactor usersreactor membersreactor members add --email dev@example.com --name "Dev" --role developerreactor clusterreactor functionsreactor functions promote ping 2reactor functions demote pingreactor functions env pingreactor functions env ping set TOKEN secret-valuereactor functions env ping unset TOKENreactor functions env ping copy --from sitereactor functions env ping copy --to sitereactor sitesreactor sites envreactor sites env set SITE_BANNER "hello" --visiblereactor sites env unset SITE_BANNERreactor storagereactor storage bucketsreactor storage buckets create photos --publicreactor storage url photos notes/hello.txtreactor queue listreactor queue create jobsreactor queue send jobs '{"hello":"world"}'reactor queue read jobsmembers add creates an operator if the email is new. The role default is developer. functions lists deployments. Promote pins a version. Demote clears the pin. functions env lists a function’s variable names and when they changed. It never prints a value. set and unset write that function’s variables. copy --from site and copy --to site move the sealed values between the site and that function. One of those flags is required. sites env set without --visible stores a secret, and the value is not returned later.
queue needs REACTOR_EXTENSIONS=queue on the server and the linked service key. send takes --delay-secs. read takes --vt-secs and --qty. Peek, delete, archive, and subscriptions are on the HTTP API.
cluster prints liveness. Platform-admin actions on operators are in the console.