Skip to content

Command reference

Terminal window
polymesa <command> [options]
CommandWhat it does
loginAuthenticate with email and password, print a JWT
authManage stored credentials
retrieveDownload configuration to a local directory
deployUpload a configuration directory
upsertInsert or update records from CSV
deleteDelete records listed in a CSV
queryRun a SQL SELECT and export CSV
pagesDeploy or retrieve custom pages
typesGenerate local TypeScript definitions

Every command that talks to the API accepts these:

FlagDefaultPurpose
-u, --url <url>$POLYMESA_API_URL, else http://localhost:3000API base URL
-a, --alias <alias>defaultWhich stored credentials to use
-t, --token <token>$POLYMESA_TOKENBearer token, overriding stored credentials
--workspace <slug>the alias’s defaultAct in this workspace

Authenticate and print a JWT to stdout. Does not store anything — see auth login for that.

Terminal window
polymesa login --email <email> --password <password>
FlagRequiredPurpose
-e, --email <email>yesEmail address
-p, --password <password>yesPassword
-u, --url <url>noAPI base URL

Credential management. See Authentication for the flows.

Terminal window
polymesa auth login [--alias <alias>] [--jwt --client-id <id> --key-file <path> --username <user>]
FlagPurpose
-a, --alias <alias>Store under this name (default default)
--jwtUse the JWT bearer flow instead of the browser flow
--client-id <id>Connected app client ID (JWT flow)
--key-file <path>RSA private key path (JWT flow)
--username <user>Username for the sub claim (JWT flow)

With no --jwt, opens a browser for OAuth.

Terminal window
polymesa auth logout [--alias <alias>] [--all]

Lists stored credentials. polymesa auth ls also works.

Shows the currently authenticated user.

Terminal window
polymesa auth whoami [--alias <alias>] [--workspace <slug>]

Downloads the current configuration into a directory, as editable files you can commit to version control.

Terminal window
polymesa retrieve [dir]
polymesa retrieve --directory ./config
FlagPurpose
-D, --directory <dir>Output directory, if you prefer a flag to the positional argument

Writes the configuration folders, plus pages/_meta.json when the workspace has custom pages.

Zips a configuration directory and uploads it.

Terminal window
polymesa deploy [dir]
polymesa deploy ./config --dry-run
FlagPurpose
-d, --dry-runValidate and report what would change, without committing
-D, --directory <dir>Project directory, as an alternative to the positional argument

retrieve and deploy move these folders:

FolderContents
groups/User groups and their hierarchy
entities/Entity definitions — your tables and fields
guest_files/TypeScript you author: triggers, jobs, controllers, views
automations/Automation definitions
share_rules/Model-level sharing rules
email_senders/Configured sender addresses

Inserts or updates records from a CSV. Matches on primary key: present rows are updated, absent ones inserted. Never deletes.

Terminal window
polymesa upsert --entity Issue --file ./issues.csv
FlagRequiredPurpose
-e, --entity <entity>yesEntity to upsert into
-f, --file <file>yesPath to the CSV

The CSV’s header row must match field names. To seed user accounts, target the __user entity; its groups column takes a ;-separated list.

Terminal window
polymesa upsert --entity __user --file ./users.csv

Deletes records whose primary key appears in the CSV.

Terminal window
polymesa delete <entity> <csv-file>
polymesa delete Issue ./stale-issues.csv

Only the primary key column is read; everything else is ignored, so you can pass a filtered export of a previous query straight back in.

Runs a SQL SELECT and writes the result as CSV.

Terminal window
polymesa query --sql "SELECT * FROM issue WHERE status = 'new'"
polymesa query --sql "SELECT * FROM issue" --output issues.csv
FlagRequiredPurpose
-s, --sql <query>yesThe SELECT statement
-o, --output <file>noWrite here instead of stdout

Runs as your user, so row-level sharing rules apply — results are limited to records you can see.

Manage custom pages independently of a full config deploy.

Terminal window
polymesa pages deploy <dir> [--dry-run]
polymesa pages retrieve <dir>

Both read and write pages/_meta.json inside the given directory. A full deploy already includes pages when that file is present; these subcommands are for iterating on pages alone.

Generates TypeScript definitions for system types and your entities, so editors can autocomplete against your actual schema.

Terminal window
polymesa types [dir]
polymesa types --directory ./my-workspace

Writes into .polymesa/ inside the target directory. Re-run it after changing entities. See Entities for what gets generated.