CLI
The CLI lives in server/src/cli.ts and is built with Commander. It connects to the database and starts pg-boss before running a command, so it needs the same .env as the server and a reachable DATABASE_URL.
Running a command
Section titled “Running a command”From the server/ folder, in development:
npm run cli -- check-integrityThe -- separates npm’s arguments from the command’s. In a production container, where TypeScript is compiled to dist/, npm run cli still uses ts-node on the sources, so the source tree must be present (the Dockerfile copies it). Running it inside the container:
docker exec -it <container> npm run cli -- check-integrityCommands
Section titled “Commands”| Command | What it does |
|---|---|
check-integrity |
Runs the same integrity check as the daily system/integrity-check job, then exits. See Integrity check for what it compares and repairs. |
npm run cli -- --help prints the command list, and --version prints 1.0.0.
What is not a CLI command
Section titled “What is not a CLI command”- Migrations run automatically when the server boots (
migrationsRun: trueinserver/src/env.ts). There is no migrate command to run by hand. See Upgrading. - Creating the first admin is done in SQL. See First admin.
- TypeORM’s own CLI is exposed as
npm run typeormfor developers generating migrations; it is not needed to operate an instance.