Task commands
Every command in the API's Taskfile, the script behind each one, and how to install Task.
Look up a task command here while you work in the API repo. Each table lists the task, what it does, and the script it runs.
The API repo has a Taskfile.yml at its root. Each task wraps a pnpm script from package.json or a script in scripts/. Only Naalya-API has a Taskfile. The Education Hub and the website use their package scripts directly (bun dev, pnpm dev).
Install Task
Task is a single binary. Pick the line for your system:
brew install go-task # macOS with Homebrew
winget install Task.Task # Windows
npm install -g @go-task/cli # anywhere Node is installedThe installation guide on the Task website lists every other option. Its shell completion section adds tab completion for task names. Check the install with task --version.
Command line
Run tasks from the repo root.
task # list every task with its description
task dev # run one
task migration:generate NAME=add_widget # pass a variableA variable follows the task name as NAME=value. The tables show which tasks take one. The usage guide on the Task website describes the Taskfile format.
First run and keeping up
| Task | What it does | Runs |
|---|---|---|
task setup | Prepare a fresh clone: install, create .env.local, check DATABASE_URL, start infra, apply migrations. Stops and asks for credentials if DATABASE_URL is empty. Safe to run again | install, env, infra, migration:run |
task sync | Catch up after git pull: install new dependencies and apply new migrations | install, migration:run |
task install | Install dependencies | pnpm install |
task env | Copy .env.example to .env.local. Skipped when .env.local already exists, so it never overwrites your keys | cp .env.example .env.local |
Run the apps
| Task | What it does | Runs |
|---|---|---|
task dev | Start server, worker, and audit in watch mode, plus the email preview, the type bus watcher, and the PDF watchers, in one terminal | pnpm dev:all |
task dev:server | Start only the HTTP API, on port 8000 | pnpm start:dev |
task dev:worker | Start only the worker: background jobs and the Rover agent | pnpm worker:dev |
task dev:audit | Start only the audit app | pnpm audit:dev |
task email | Start the React Email preview on port 3001 | pnpm email:dev |
Local services
| Task | What it does | Runs |
|---|---|---|
task infra | Start Redis, Centrifugo, and Gotenberg in Docker, in the background | pnpm infra |
task infra:status | List the local containers with their state and ports | pnpm infra:status |
task infra:logs | Follow the logs of those three containers | pnpm infra:logs |
task infra:down | Stop and remove them | pnpm infra:down |
task docker:dev | Build and run the apps in containers too, with your code mounted | pnpm docker:dev |
task docker:dev:down | Stop that stack | pnpm docker:dev:down |
task infra does not start Postgres or RabbitMQ. Getting started covers those.
Database
| Task | What it does | Runs |
|---|---|---|
task migration:generate NAME=add_widget | Generate a migration from your entity changes. NAME is optional. Without it the script makes up a name | pnpm migration:generate |
task migration:run | Apply every pending migration to the database in DATABASE_URL | pnpm migration:run |
task migration:revert | Undo the most recent migration | pnpm migration:revert |
task seed | Bring the demo school's seed data in line with the configured counts. Safe to repeat | pnpm seed:sync |
task seed:stress | Load a large data set for load testing | pnpm seed:stress |
Check where DATABASE_URL points
migration:run, migration:revert, and the seed tasks change whatever database .env.local points at. Before you run one, make sure that is your own development database and not a shared one.
Read a generated migration before you run it. The database has the workflow.
Quality
| Task | What it does | Runs |
|---|---|---|
task test | Run unit tests | pnpm test |
task test:watch | Run unit tests again on each save | pnpm test:watch |
task test:cov | Run unit tests with coverage | pnpm test:cov |
task test:e2e | Run end-to-end tests | pnpm test:e2e |
task lint | Run ESLint, fixing what it can | pnpm lint |
task format | Run Prettier | pnpm format |
task check | Run lint, then tests | lint, test |
task build | Build the apps | pnpm build |
Shared types
The type bus shares TypeScript types with the Education Hub. How Chowbea works explains it.
| Task | What it does | Runs |
|---|---|---|
task bus | Extract shared types to chowbea.bus.json | pnpm bus:extract |
task bus:watch | Extract again on each save. task dev already runs this | pnpm bus:watch |
task bus:check | Validate without writing. This is the CI check | pnpm bus:check |
task bus:diff | Compare with staging. Fails if a type was removed | pnpm bus:diff |
Rover sandbox image
These manage the container image Rover's sandbox runs in, published to GitHub Container Registry.
| Task | What it does | Runs |
|---|---|---|
task sandbox:publish TAG=my-tag | Build and push the image. TAG is optional | scripts/sandbox-image.sh publish |
task sandbox:probe | Start the configured sandbox and check it has what the Dockerfile installs | node scripts/sandbox-probe.mjs |
task sandbox:list | List every published version | scripts/sandbox-image.sh list |
task sandbox:explain TAG=dev | Show what one tag contains | scripts/sandbox-image.sh explain |
task sandbox:delete TAG=old-thing | Delete one tag | scripts/sandbox-image.sh delete |
task sandbox:prune KEEP=5 | Delete old commit-named versions, keeping the newest KEEP | scripts/sandbox-image.sh prune |
task sandbox:clean | Delete untagged images no tag points to | scripts/sandbox-image.sh clean |
Deploys
| Task | What it does | Runs |
|---|---|---|
task redeploy-railway | Redeploy the Railway services for ENVIRONMENT, which defaults to staging. For production, pass ENVIRONMENT=production | scripts/redeploy-railway-services.sh |
This touches a real environment
redeploy-railway restarts live services. Only run it if you are responsible for that environment, and never against production without agreement from the team.