Skip to content

CLI reference

Below is the full CLI command reference. For the workflows behind the commands, get setup with install, and the understand the Sectr dev loop.

Log in once and every other command follows that login. If you run your own server, log in with --api the first time:

Terminal window
sectr auth login --api http://localhost:8080
  • sectr auth login picks its server from --api, then SECTR_API_URL, then the server you last logged in to, then Sectr’s hosted server.
  • sectr deploy, sectr init --endpoint, sectr secrets, sectr send --cloud and sectr tail --cloud pick theirs from --api, then SECTR_API_URL, then your login, and print server: <url> when they start.
  • Your saved key only goes to the server you logged in to. If a command resolves to a different server, it stops and tells you to log in there. A key you pass with --key or SECTR_PLATFORM_KEY is always used as given.
Sign in: opens the dashboard in your browser to approve the request (or pass --key / --with-key to store an API key instead)
Usage: sectr auth login [OPTIONS]
Options:
--with-key Read the platform key from a hidden prompt or stdin instead of using the browser
--no-browser Print the approval link without trying to open a browser (remote machines, coding agents)
--api <API> The server base URL. Default: SECTR_API_URL, then the saved login's server, then the public endpoint
--key <KEY> Platform API key (`skp_…`). With `login`, stores that key instead of opening the browser
-h, --help Print help
Print the stored identity (org + server) after re-validating
Usage: sectr auth whoami [OPTIONS]
Options:
--api <API> The server base URL. Default: SECTR_API_URL, then the saved login's server, then the public endpoint
--key <KEY> Platform API key (`skp_…`). With `login`, stores that key instead of opening the browser
-h, --help Print help
Forget the stored key (and revoke it, if the browser login made it)
Usage: sectr auth logout [OPTIONS]
Options:
--api <API> The server base URL. Default: SECTR_API_URL, then the saved login's server, then the public endpoint
--key <KEY> Platform API key (`skp_…`). With `login`, stores that key instead of opening the browser
-h, --help Print help
Scaffold a new agent project: framework, frontend and where-it-runs pickers (or --template / --frontend / --endpoint), file emission, `uv sync`, and a smoke inspect. `--endpoint` in an existing project adds the files to run it on your own platform. See `init --help`
Usage: sectr init [OPTIONS] [NAME]
Arguments:
[NAME] Project directory name (created if missing; refused if non-empty unless --force)
Options:
--template <TEMPLATE> Agent framework: `openai-agents`, `langgraph` or `pydantic-ai`. Given → fully non-interactive (docs/CI). Omitted → interactive picker (needs a terminal)
--frontend <FRONTEND> Chat frontend: `none` (agent only) or `copilotkit` (a Next.js + CopilotKit app at the root, the agent in `agent/`; needs Node 20+). Omitted → `none` with --template, else an interactive picker
--endpoint <ENDPOINT> Run it on your own platform: `lambda`, `cloud-run` or `container`. Adds a Dockerfile pinned to your server and `[deploy] endpoint` to sectr.toml; in an existing project (a sectr.toml here, no name), adds only those. Needs a server (`sectr auth login`, or --api). Omitted → Sectr Run with --template, else an interactive picker
--api <API> The server whose base image and ingest URL a compute endpoint's Dockerfile pins (so only for a project on your own platform). Defaults through `sectr auth login` (or SECTR_API_URL)
--key <KEY> Platform API key (`skp_…`) for that server (so only for a project on your own platform). Defaults through `sectr auth login` (or SECTR_PLATFORM_KEY)
--force Scaffold into a non-empty directory anyway (and, with --endpoint, replace an existing Dockerfile and .dockerignore)
-h, --help Print help

sectr dev needs no server or login. It opens the dashboard from --dashboard or SECTR_DASHBOARD_URL, then your login’s dashboard, then app.sectr.dev. Your agent and its data stay on your machine either way, because the browser talks directly to the local gateway.

Run the app locally end-to-end: SQLite journal, subprocess runner, gateway for clients. See `dev --help`
Usage: sectr dev [OPTIONS]
Options:
--path <PATH> Project directory (must contain sectr.toml) [default: .]
--config <CONFIG> Config file path (relative to --path) [default: sectr.toml]
--no-open Don't open the dashboard (CI / containers)
--dashboard <DASHBOARD> Dashboard to open. Default: the saved login's dashboard, else https://app.sectr.dev. Point it at a local `next dev` when working on the dashboard itself [env: SECTR_DASHBOARD_URL=]
--port <PORT> Gateway port. Default: the port this project used last, else 8420. A port given here is strict: if it's busy, `sectr dev` exits
-h, --help Print help
Send a message / decide an approval through the running `sectr dev` gateway (a thin client — it never starts the engine)
Usage: sectr send [OPTIONS] [MESSAGE]
Arguments:
[MESSAGE] The message (positional). Omitted: prompted on the terminal, or read from all of stdin when piped
Options:
--path <PATH> Project directory (must contain a `.agent/dev.json` from `sectr dev`) [default: .]
--session <SESSION> Existing session (a plain `sectr send "msg"` creates one)
--approve Approve the session's pending tool call (resumes the turn)
--deny Deny the session's pending tool call (resumes with the rejection)
--no-tail Don't follow the turn's output — send, print the session id, exit
--json Raw event envelopes (one JSON per line) instead of the human renderer
--cloud CLOUD mode: talk to a sectr-server instead of the local dev gateway. Requires --app; auth/server come from --api/--key, the env, or `sectr auth login` (shared resolution)
--app <APP> The app slug (cloud mode) — as `sectr deploy` created it
--route <ROUTE> Route path (cloud mode). Default: the app's first route
--api <API> Server base (cloud mode). Defaults through `sectr auth login`
--key <KEY> Platform key (cloud mode). Defaults through `sectr auth login`
-h, --help Print help
Follow a session's journal (never stops until ctrl-c)
Usage: sectr tail [OPTIONS] --session <SESSION>
Options:
--path <PATH> Project directory (must contain a `.agent/dev.json` from `sectr dev`) [default: .]
--session <SESSION> Session to follow (all-sessions tail is future work)
--cloud CLOUD mode: follow a session on a sectr-server (auth/server from --api/--key, the env, or `sectr auth login`)
--api <API> Server base (cloud mode). Defaults through `sectr auth login`
--key <KEY> Platform key (cloud mode). Defaults through `sectr auth login`
--json Raw event envelopes (one JSON per line) instead of the human renderer
-h, --help Print help
Store a secret (prompt hides input when `=VALUE` is omitted — avoiding both shell history and terminal echo)
Usage: sectr secrets set [OPTIONS] <KEY_VALUE>
Arguments:
<KEY_VALUE>
Options:
--path <PATH> Project directory (must contain sectr.toml — the app is identified by its slug, exactly as `sectr deploy` creates it) [default: .]
--config <CONFIG> sectr.toml location relative to the project [default: sectr.toml]
--api <API> The server base URL (`http(s)://host[:port]`). Defaults through `sectr auth login` (or SECTR_API_URL)
--key <KEY> Platform API key (`skp_…`). Defaults through `sectr auth login` (or SECTR_PLATFORM_KEY)
-h, --help Print help
List secret NAMES for the app (values are write-only)
Usage: sectr secrets list [OPTIONS]
Options:
--path <PATH> Project directory (must contain sectr.toml — the app is identified by its slug, exactly as `sectr deploy` creates it) [default: .]
--config <CONFIG> sectr.toml location relative to the project [default: sectr.toml]
--api <API> The server base URL (`http(s)://host[:port]`). Defaults through `sectr auth login` (or SECTR_API_URL)
--key <KEY> Platform API key (`skp_…`). Defaults through `sectr auth login` (or SECTR_PLATFORM_KEY)
-h, --help Print help
Remove a secret (idempotent)
Usage: sectr secrets rm [OPTIONS] <KEY>
Arguments:
<KEY>
Options:
--path <PATH> Project directory (must contain sectr.toml — the app is identified by its slug, exactly as `sectr deploy` creates it) [default: .]
--config <CONFIG> sectr.toml location relative to the project [default: sectr.toml]
--api <API> The server base URL (`http(s)://host[:port]`). Defaults through `sectr auth login` (or SECTR_API_URL)
-h, --help Print help

sectr deploy packages the project and ships it to Sectr Run, which builds and runs it. With [deploy] endpoint in sectr.toml, it uploads nothing: your agent runs on your own AWS Lambda, Google Cloud Run or container platform (your compute endpoint), and this registers its URL. sectr init --endpoint <platform> sets a project up for it. See Run it on your own compute.

Ship the project to a server: package → upload → the server builds and activates. With `[deploy] endpoint` in sectr.toml, register your own compute endpoint instead. See `deploy --help`
Usage: sectr deploy [OPTIONS]
Options:
--path <PATH> Project directory (must contain sectr.toml) [default: .]
--config <CONFIG> sectr.toml location relative to the project [default: sectr.toml]
--api <API> The server base URL (`http(s)://host[:port]`). Defaults through `sectr auth login` (or SECTR_API_URL)
--key <KEY> Platform API key (`skp_…`). Defaults through `sectr auth login` (or SECTR_PLATFORM_KEY)
--timeout-secs <TIMEOUT_SECS> How long to wait for the server-side build (or your compute endpoint's registration) to resolve, in seconds [default: 600]
-h, --help Print help

The CLI sends an anonymous ping at most once a day: its version and a random install id. Usage pings lists exactly what’s sent. sectr telemetry status shows whether pings are on and the exact body of one, and sectr telemetry off turns them off.

Anonymous usage pings: turn them on or off, or see exactly what one sends (on/off/status)
Usage: sectr telemetry <COMMAND>
Commands:
on Turn usage pings on, with a new install id
off Turn usage pings off and delete the install id
status Show whether usage pings are on, and exactly what one sends
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help