Skip to main content

CLI commands

Run the CLI from the repository root. It uses the database directly; it does not call the HTTP API or need a bearer token.

SetupCommand prefix
Source checkoutpnpm cli
Built appnode dist/cli.js
Docker Composedocker compose exec pantrypal node dist/cli.js

Use one prefix with the commands below.

Commandsโ€‹

CommandPurpose
--helpShow command help
migrateApply pending database migrations
household init --name "Our House" --timezone Europe/LondonCreate the instance's household
household showShow the household
token create --name assistantCreate a token; copy the secret now
token listList token IDs and usage, without secrets
token revoke TOKEN_IDRevoke a token by its ID, not its secret
seed seed/example.jsonImport a household snapshot

--timezone is optional when you create a household. The default is UTC. An instance supports one household. A second household init fails.

Select a databaseโ€‹

The path is chosen in this order:

  1. --db PATH.
  2. PANTRYPAL_DB_PATH.
  3. ./data/pantrypal.db.

For example:

pnpm cli --db /tmp/pantrypal-demo.db household show

The container sets PANTRYPAL_DB_PATH=/data/pantrypal.db. Use the same database path for the CLI and server. Each command that opens the database applies pending migrations first. Help does not open the database.

Import guardโ€‹

seed refuses to run if the household has ingredients or recipes. --force skips this guard. It does not clear, replace, or merge existing data; name conflicts can still fail. Back up before any import.

See Data import and Access and security.