SHADE is young: 0.1.0-next.2 is a pre-release, and 0.1.0 isn't out yet.

SHADE
Run SHADE

Console commands

The console commands work on an instance without the admin: for its first admin, for setting it up from a script, and for the way back when the admin cannot be reached. Run them where the API runs, with the API's settings (DATABASE_URL and the rest, from the environment or SHADE_ENV_FILE). migrate and restore change the schema, so they also need DATABASE_OWNER_URL, the owner's address (The database's roles): run them in the admin container, which holds it:

  • in the image: node console/<command>.mjs;
  • in a checkout of SHADE: pnpm <command> from the repository root (it reads the repository's .env).

Every change a command makes goes through the same rules as the admin, and the audit log records it as made from the console (CLI). A password or secret is read from the terminal or from stdin (--password-stdin), never from a flag: a flag ends up in your shell's history and in the list of running processes.

CommandWhat it does
create-adminAn admin, asked for on the terminal: from a script, from Desk, or the first admin where the browser cannot open the owner's page (the guides start with that page instead: Coolify).
create-memberA team member of any role, from a script.
create-tokenAn API token for a team member, from a script.
settingsThe email settings, from a script.
maintenanceMaintenance mode on or off (Maintenance mode).
restoreLists, checks and restores backups (Updating and backups).
backup-targetSets where the built-in backups go and the bucket's keys, in the backup secrets volume, from the admin container.
exportThe content and settings, without people, as one .tar.
importLoads such a .tar into an empty instance.
generate-secretsGenerates the instance's secrets that are not set into SHADE_SECRETS_DIR, once: what the deployment template's secrets service runs before the others start.
new-env-fileA new env file with a fresh APP_SECRET (by hand; shade install writes one itself).
rotate-secretsSeals the stored secrets again with a new APP_SECRET (Rotating APP_SECRET).
doctorChecks the environment, Redis, the stored secrets, the backup key and the database's migrations, and prints one report (Checking an instance).
migrateApplies SHADE's own migrations, then exits.
statusSays whether the instance is ready: the database, pending migrations, the worker and the modules.
schemaLists the database's secret columns.
envLists the variables SHADE reads, and checks an env file before it is used.
pluginChecks modules under development, every problem at once.
queueThe queue's jobs per queue, the ones not finished and the ones that failed; sends a failed event delivery again, or cancels a job.
installWrites a server's files into /etc/shade, as root: what shade install and shade update run in the image, not a command to run by hand (Self-hosting without Coolify).

create-member

echo "$PASSWORD" | node console/create-member.mjs --email ann@example.org --name "Ann" --role editor --password-stdin
node console/create-member.mjs --email assistant@example.org --name "Assistant" --role ai
  • --role is admin, editor or ai. An editor can get a custom role with --custom-role <key>.
  • An admin's or editor's password is asked on the terminal, twice, without showing it, or read from the first line of stdin with --password-stdin. It follows the same rules as in the admin (at least 12 characters).
  • An AI account has no password. It works with an MCP token only, which create-token --kind mcp makes.
  • --json prints the member as one JSON object, { "id", "email", "role" }, for a script that reads it. create-admin takes --json too. When the member is refused, nothing is printed on stdout and the reason goes to stderr.

create-token

node console/create-token.mjs --email ann@example.org --kind build --name "Website" --out website.token
node console/create-token.mjs --email assistant@example.org --kind mcp --name "Assistant" --stdout
  • --kind is one of these:
    • build: a frontend's build;
    • read: reading only;
    • data: chosen collections, with --grant posts=read, which you can repeat;
    • mcp: an AI account's MCP;
    • automation: a script acting as the member. It needs --expires 2027-01-01 and one --action <action> for each action it may do, chosen from the member's own.
  • The member named by --email owns the token.
  • A token is shown once and never again, so say where it goes:
    • --out <file> writes it to a new file that only you can read, and never over an existing file;
    • --stdout prints it, for a script that captures it;
    • --json prints one JSON object with the token in it, for a script that also wants to know which token it is:
      { "id": "…", "token": "shd_…", "prefix": "shd_…", "kind": "build", "name": "Website",
        "member": { "id": "…", "email": "ann@example.org" }, "expiresAt": null }
      

    Without one of them, no token is made. With --stdout or --json, stdout holds the token only; the log goes to stderr.
  • The same rules as in the admin hold. An MCP token belongs to an AI account only. An automation token only holds actions its member has, and never one that stays with people, such as managing the team or tokens.
  • --expires sets an end date for any kind. Without it, the token works until it is revoked in the admin (API tokens).

settings

echo "$SMTP_PASSWORD" | node console/settings.mjs email smtp --host smtp.example.org --port 587 --username mailer \
  --from-name "Voorbeeld" --from-address hello@example.org --password-stdin
  • This saves the email settings for sending over SMTP, the same as Settings → Email in the admin.
  • --secure means TLS from the start (port 465). Without it, the mail server must offer STARTTLS.
  • The SMTP password comes from stdin with --password-stdin. Without that option, a password stored before is kept.
  • The password is stored encrypted with the instance's APP_SECRET, as the admin stores it. The audit log names it as changed, never its value.
  • A change that leaves email unusable is refused while accounts or a module that sends email still need it.

backup-target

node console/backup-target.mjs set --url s3://voorbeeld-backups/shade --access-key-id <key id> \
  --endpoint https://s3.nl-ams.scw.cloud --region nl-ams
node console/backup-target.mjs show
node console/backup-target.mjs clear
  • Run it in the admin container of the deployment template, the only running container that mounts the secrets-backup volume writable. It writes backup-target.json there, which the admin and the worker read when they start, so restart both afterwards. The public container never reads it.
  • The secret access key is asked on the terminal without showing it, or read from the first line of stdin with --secret-stdin. --endpoint is the service's address without the bucket, --region its region (auto when left out) and --path-style addresses the bucket path-style.
  • Before it saves anything, it checks the settings with the API's own rules and asks the bucket for its backups; --skip-check saves without asking the bucket. The audit log records the change with the bucket's address, never a key, before anything is saved; when the database can't be reached, nothing is saved. A save that fails after that is recorded as failed.
  • --no-audit (with set or clear) is for recovery only, such as setting the target for a restore before the database is up: it saves without recording the change in the audit log and warns that it did.
  • show says where each setting comes from (the file, the environment, or not set) and shows no key. A variable set in the environment wins over its line in the file. clear removes the file. A file the API can't use (not JSON, or holding another variable) stops the admin and the worker at their start; show and the doctor say why, and set or clear replace or remove it.

export

node console/export.mjs --content --out content.tar
docker exec <api container> node console/export.mjs --content --out - > content.tar
  • This writes the instance's content and settings as one .tar: every collection's entries with their drafts (forms are a collection too), the media library with its originals, the site's settings, the email and user accounts settings, the wording of the emails, and each module's settings. It is the same format as Exporting an instance, and its manifest.json says "scope": "content".
  • It never holds people or secrets: no team members or users, no module's own data (form submissions, orders and bookings stay home), no passwords, tokens, two-factor data or sessions, no setting marked secret, no visitor IP hashes, and not the audit or error log. A developer can take it to their own machine.
  • --out <file> writes a new file and never overwrites one. --out - writes the file to stdout, so you can copy it out of a container. Messages and the log then go to stderr.
  • --content is required. The whole instance, with its people, is exported only from the admin, after signing in again.
  • The command loads the installed modules without starting them. It refuses when a module can't be loaded, or is switched on but not installed: that module's content would be missing.
  • The audit log records it as an export by CLI, with its size and what it holds.

import

node console/import.mjs --content content.tar
  • This loads a file that export --content wrote into an instance that holds no content yet: no entries in any collection and no media. Start a new instance, or empty one first.
  • The instance needs the same modules installed. Each collection's fields must be the same as in the file: update SHADE and the modules to the versions of the instance the file came from.
  • Nothing is written until the whole file is checked: every file against the sizes and SHA-256 hashes in its manifest.json, with nothing extra. A changed or incomplete file is refused.
  • Then it loads everything in one go:
    • the media library, through the same checks as an upload; images get their smaller versions made again;
    • the site's settings;
    • the email and accounts settings;
    • the wording of the emails;
    • every entry with its id, its status, its draft and its other languages;
    • each module's settings.
  • Secrets are never in the file. Set the SMTP password or Brevo key, the payment keys and modules' secret settings again. A setting that can't work without its secret is left as it was, and the command names it. For example, user accounts stay off while email isn't set up.
  • Modules aren't switched on. The command names the ones that were on, and you switch them on in the admin.
  • It clears what modules keep in their cache in Redis, so nothing from before the import comes back. When Redis can't be reached it says so: empty Redis before you start the containers.
  • Afterwards, build the site.
  • The audit log records it as an import by CLI.

migrate

node console/migrate.mjs

The admin container applies new migrations itself when it starts with MIGRATE_ON_START=true. migrate is for a deploy script or CI job that wants them in before anything starts. It applies SHADE's own migrations and exits; the modules' migrations still run when SHADE starts, since they come with the modules it loads. It connects as the owner, with DATABASE_OWNER_URL.

It keeps to the order an update follows at start. Where backups are set up, it takes the backup first (SHADE_BACKUP_BEFORE_MIGRATE), and when the backup fails nothing is applied. Then it applies the migrations and adds a row to the upgrade history naming them. A database migrated before SHADE squashed its migrations is refused, as at start. It exits 0 when the migrations are in or there were none, and 1 when something failed.

status

node console/status.mjs
node console/status.mjs --json

status answers whether an instance is ready, from its database and Redis, without going through the API. A deploy script or a monitor can poll it while the containers come up. It prints one line per part:

database   ok     The database answered.
migrations ok     None pending.
worker     ok     Last heartbeat 5 seconds ago, from worker-1.
plugins    ok     Loaded: website.
  • database: whether it answers.
  • migrations: SHADE's own and the installed modules' that the database lacks. While SHADE's own are pending, the modules aren't loaded, since their code reads SHADE's tables.
  • worker: whether a worker wrote its heartbeat in the last two minutes (Background work).
  • plugins: the modules that load, and those left out because they could not be loaded or are switched on but not installed here. The log says why.

--json prints the same as one object on stdout, with the log on stderr:

{ "ok": true,
  "database": { "ok": true, "message": "The database answered." },
  "migrations": { "ok": true, "core": [], "plugins": {} },
  "worker": { "ok": true, "lastSeenAt": "2026-11-26T11:59:55.000Z", "worker": "worker-1" },
  "plugins": { "ok": true, "loaded": ["website"], "leftOut": [] } }

A part it could not read has ok: false and a message saying why. It exits 0 when every part is ok and 1 otherwise, and prints the report either way. It changes nothing in the database or Redis.

schema

node console/schema.mjs --secrets
node console/schema.mjs --secrets --json

schema --secrets lists the columns that hold what signs someone in or opens something: passwords, session and API tokens and their hashes, two-factor secrets, sealed values, and a build hook's address, which is itself the key. Use it when you give a person or a tool read access to the database and want to leave those columns out. Shade Desk's read-only database role is granted every column but these.

The list comes from where SHADE's tables and the installed modules' tables are defined, never from a column's name. It prints one table.column per line, or with --json one object, { "secrets": [{ "table", "column", "plugin" }] }, where plugin names the module a table belongs to. When a module could not be loaded its columns aren't known, so the command names it and exits 1.

env

node console/env.mjs --json
node console/env.mjs --check /etc/shade/shade.env --json

env lists every variable SHADE reads, one per line, with what it is for and whether it is required or holds a secret. With --json it prints one object, which is how Shade Desk builds its env file editor:

{ "variables": [
  { "name": "APP_SECRET", "description": "Signs sessions and preview tokens. Long, random, stable.", "secret": true, "required": true },
  { "name": "SHADE_API_URL", "description": "Where the API answers …", "secret": false, "required": false } ] }

required means SHADE does not start without it. A few others are needed only together with another one, such as SHADE_BACKUP_KEY with SHADE_BACKUP_URL. --check <file> finds those too. It reads the file's NAME=value lines on their own (not the shell's environment, nor a checkout's .env), runs them through the same checks SHADE runs at start, and prints each problem by variable:

{ "ok": false, "problems": [
  { "name": "SHADE_BACKUP_KEY", "message": "SHADE_BACKUP_KEY is required with SHADE_BACKUP_URL: 32 random bytes in base64 (openssl rand -base64 32)" } ] }

A problem of the whole file has "name": null. When the file sets SHADE_SECRETS_DIR, the secrets it leaves unset count as generated on the first start, and the report names which are set and which will be generated ("secrets": [{ "name": "APP_SECRET", "origin": "generated" }]), never a value. The command never prints a value, and a secret a message would repeat is shown as ***. It exits 0 when the file is valid and 1 when it is not, or cannot be read.

module

node console/module.mjs check
node console/module.mjs check ../modules/my-plugin --json

plugin check imports each folder's module.ts, as SHADE_DEV_MODULES does, and checks it as SHADE checks a module before it runs it: its name, capabilities, tables, actions, routes and the rest of the manifest, and its files. A module that would stop the instance from starting is listed here with every problem at once. Without a folder it checks the folders SHADE_DEV_MODULES names. It needs no database.

ok       my-plugin
failed   other-plugin: capabilities.telepathy is not a capability this SHADE knows

With --json: { "ok": false, "plugins": [{ "folder", "name", "problems": [] }] }. name is null when the folder's module could not be imported, and problems says why. It exits 1 when any module has a problem.

queue

node console/queue.mjs --json
node console/queue.mjs --days 1 --limit 20
node console/queue.mjs --run-again 3f0c…
node console/queue.mjs --cancel 8a21…

queue reads the queue's jobs from the database: per queue how many wait, how many are in flight, and how many failed, finished or were cancelled in the last 7 days (--days, up to 30, the time finished jobs are kept). Then come the newest 50 jobs not finished yet, each waiting (until its runAt) or in flight (since its sentAt), and the newest 50 that failed, with their tries and last error. --limit (up to 500) caps each of the two lists.

{ "since": "2026-11-20T12:00:00.000Z",
  "queues": [{ "queue": "webhooks.deliver", "waiting": 2, "inFlight": 1, "failed": 1, "finished": 40, "cancelled": 0 }],
  "pending": [{ "id": "8a21…", "queue": "webhooks.deliver", "createdAt": "…", "runAt": "…", "sentAt": null }],
  "failed": [{ "id": "3f0c…", "queue": "webhooks.deliver", "attempts": 5, "error": "…", "failedAt": "…", "runAgain": true }] }

A job's data is never shown: it may hold a person's details, and a job that finished keeps none. For the same reason only an event's delivery can run again (runAgain: true). --run-again <id> sends it to its subscriber once more, as Resend on the admin's Errors page does, and the audit log records it as the console's. Any other failed job's work can't be repeated from here. An error that holds one of the instance's secrets shows it as ***.

--cancel <id> takes back a job that hasn't finished, whether it still waits or is in flight. It is kept for the same 7 days as cancelled, without its data, and the audit log records it as the console's. A job in flight is skipped at its next try, but a try that is running at that moment still ends. A job that finished can't be cancelled: the command says so and exits 1. Both --run-again and --cancel answer { "ok": true, "id": "…" } with --json, or { "ok": false, "message": "…" }.

Switching a module from a script

There is no console command for switching a module. A module is switched on in the running instance, where its code is loaded: it gets ready for work, the other modules hear about it, and the site rebuilds when the module shows anything there. A script does it through the admin API, with an automation token that may manage modules:

node console/create-token.mjs --email ann@example.org --kind automation --name "Set-up script" \
  --expires 2026-12-31 --action packages.manage --out setup.token
curl -X PUT https://admin.example.com/api/packages/catalog/website/enabled \
  -H "Authorization: Bearer $(cat setup.token)" -H "Content-Type: application/json" -d '{"enabled":true}'
  • The same rules as Modules in the admin hold. A module that needs setup first, or another module that is off, is refused with the reason.
  • Give the token a short life with --expires, and revoke it in the admin when the script is done.