---
title: Command line
description: Every sluurp command, what it is for, and the options used most.
section: Operations
order: 1
---

# Command line

<p class="lead">Everything is in one binary, <code>sluurp</code>. <code>sluurp --help</code> lists commands and <code>sluurp &lt;command&gt; --help</code> lists a command's options. This page is an overview.</p>

Every command accepts `--dir <DIR>`, the data folder (one SQLite file per project). Defaults to `sluurp_data` in the current directory.

## Serving

| Command | What it does |
|---|---|
| `serve` | Start the server: API, admin UI at `/_/`, and the `--public` app |
| `static` | Export the app as static files, islands included; `--base repo` for a subfolder ([Static sites](/docs/static-sites)) |
| `compile` | Build a single binary with one app embedded |
| `test` | Run an app's tests in a headless Chrome, Edge or Chromium, on a fresh database; `--grep`, `--coverage` ([Testing](/docs/testing)) |

`serve` options:

| Option | |
|---|---|
| `--public DIR` | The app at `/`: a folder or [repository URL](/docs/getting-started). `NAME=DIR` mounts another at `/NAME/`; repeatable |
| `--addr HOST:PORT` | Listen address; default `127.0.0.1:8090` (local only) |
| `--no-hot-reload` | Disable file watching, for production |
| `--admin-auto-login` | Sign the admin in as the first superuser without a password, from this machine only. For development; a warning is printed at start. Never use it on a server others can reach |
| `--attach NAME=FILE` | Use an existing SQLite database in place ([Existing SQLite databases](/docs/attach)) |
| `--events [ADDR]` | Accept local events over UDP ([Hooks and events](/docs/hooks-and-events)) |
| `--channel NAME`, `--apps` | Serve a published bundle, or all registered apps by hostname, instead of a folder |

```sh title="Terminal"
sluurp serve --public ./app --public reports=./reports --addr 0.0.0.0:8090
```

## Data

| Command | What it does |
|---|---|
| `migrate APP` | Run an app's [migrations](/docs/migrations); `--plan` previews |
| `schema plan`, `schema apply` | Diff a `schema.json` against the database, or apply it |
| `import FILE` | Import collections and records from an import document |
| `superuser EMAIL PASSWORD` | Create a superuser or reset their password |
| `backup` | Snapshot every project to a dated folder |
| `migrations` | Show Sluurp's internal migrations applied to a project |
| `bench` | Benchmark collections on this machine ([Why SQLite](/docs/why-sqlite)) |

## Packages

| Command | What it does |
|---|---|
| `add SPEC` | Vendor a package into an app: `add three`, `add npm:date-fns@4`, `add jsr:@std/path`, a CDN URL, or `font:inter:400,600` ([Packages](/docs/vendoring)) |
| `remove NAME` | Remove a vendored package |
| `outdated`, `update` | Show and apply newer versions, like `pnpm` |
| `vendor` | List vendored packages; `check` files against hashes, or `verify` against the source |
| `cache` | Show the package cache and bundle locations; `clear` empties them |

These take `--app DIR` for the target app (default: current folder).

## Publishing

| Command | What it does |
|---|---|
| `push DIR` | Store an app as a bundle; `--deploy CHANNEL` also deploys it |
| `bundles` | List bundles and what each channel serves |
| `deploy CHANNEL BUNDLE` | Point a channel at a bundle |
| `promote FROM TO` | Copy one channel's bundle to another, e.g. staging → production |
| `rollback CHANNEL` | Revert a channel to its previous bundle |
| `app` | Connect a git repository to publish on every push |

## Other

| Command | What it does |
|---|---|
| `emit NAME [JSON]` | Send an event to a server running with `--events` |
| `i18n` | List unused keys in an app's `i18n.json` |
