# CLI

> The smallrun commands, the --json flag and non-interactive authentication.

Install: `curl -fsSL https://www.smallrun.app/install.sh | sh`. It installs one binary, `smallrun`, on Linux or macOS (amd64 or arm64), checks it against the release's checksums, and asks nothing. It puts the binary in `/usr/local/bin` when that is writable and in `~/.local/bin` otherwise; `SMALLRUN_INSTALL_DIR` chooses another folder and `SMALLRUN_VERSION` another version.

The CLI is the product surface. Every function of SmallRun is a command that an agent can run on the local machine: nothing exists only as a click or an email link. There is no MCP server; the agent uses the CLI.

## Rules for every command

- `--json` makes the command return one JSON object.
- `SMALLRUN_TOKEN` authenticates without interaction.
- Commands run in the app's folder. The app is the `name` in `smallrun.yaml`, or, with no manifest, the folder's name.
- An error carries a stable code, a message and a suggested next action.
- No command asks a question. A destructive command takes `--yes`.

## Commands

| Command | What it does |
|---|---|
| `smallrun login` | Opens the browser; the person signs in and approves, and the CLI saves the token. On a remote machine, `--device` prints a link and a code to approve from any device. Agents can also use `SMALLRUN_TOKEN` |
| `smallrun tokens` | Lists the account's tokens; revokes one. Every token has full access to the account |
| `smallrun init` | Generates the [manifest](https://www.smallrun.app/docs/manifest.md) |
| `smallrun deploy` | Uploads, builds and starts the app. Blocks until `RUNNING` or `FAILED`. `--rebuild` builds the current deployment again from its stored source |
| `smallrun status` | Shows the state of the app and its current deployment |
| `smallrun logs` | Shows stdout and stderr of every process, tagged by process name. `--process <name>` filters |
| `smallrun rollback` | Points the app at an earlier deployment. Does not revert data |
| `smallrun secrets [set\|list\|unset]` | Manages encrypted secrets, injected as environment variables. `set NAME=value`, or `set NAME` with the value on stdin; `list` shows names, never values. A change reaches the running app without a restart: processes it starts from then on see it |
| `smallrun share <email>...` | Invites people and sends each an invite email. Also approves an access request. `--message`, `--no-email`, `--resend` |
| `smallrun unshare <email>` | Removes an invite. `--deny` refuses a pending request |
| `smallrun access` | Lists the invited people and the pending requests, with the state of each invite and its email |
| `smallrun visibility [public\|private]` | Shows or changes who can open the app. New apps are private |
| `smallrun analytics` | Page views, visitors, paths and referrers. `--people` lists who opened the app. `--period 24h\|7d\|30d\|90d` |
| `smallrun domains [add\|verify\|rm] <hostname>` | Serves the app from your own domain (later version) |
| `smallrun dev` | Runs the app locally with the identity headers set to the developer |
| `smallrun db dump` | Dumps the app's database |
| `smallrun delete` | Removes the app and, after a grace period, its data |

## Local development

```sh
smallrun dev
```

`smallrun dev` runs the app on the developer's machine and sets the same `X-SmallRun-User-*` headers to the developer's own identity. The app needs no separate code path for local runs.

---
Source: https://www.smallrun.app/docs/cli/ · Index of all pages: https://www.smallrun.app/llms.txt
