Skip to content

Command line

Terminal window
npm install --save-dev @motionskit/cli
npx motions <command>
Variable Default
MOTIONS_URL http://localhost:8787 The app’s address, without a path. --url overrides it.
MOTIONS_TOKEN none An API token from Settings → API tokens. Needed by push, pull and open.
Terminal window
export MOTIONS_URL=https://motions.pruma.tech
export MOTIONS_TOKEN= # paste your API token after the =

Commands that work on a tenant find it from the current folder by looking for tenant.yaml here and above. --tenant <folder> points them elsewhere.

Terminal window
npx motions check

Compiles the tenant without the network: validates tenant.yaml, crm.yaml, the fixtures and every motion.yaml, bundles every step and custom source, and checks that the CRM can do what the motions propose. Prints each motion’s version id, its steps, and the fixtures and sources it found. Writes .motions/sources.d.ts. Exits non-zero on any error.

orbita (America/Sao_Paulo)
domain-check @ 4c427355d5 3 steps, 2 bundles (29 KB), rules-4a23393c5c
company domain d8e4f9e6 sources=[rdap.lookup]
company note 6e77fd81 sources=[]
changeset write
fixtures on: built-in sources answer from 4 entries in 1 file
source brasilapi @ c2d0ef20d3 33 KB, hosts=[brasilapi.com.br] secrets=[]
op brasilapi.cnpj ttl=604800s
Terminal window
npx motions test

Runs motions/*/tests/**/*.test.ts with the tenant’s Vitest. See Testing.

Terminal window
npx motions push [--live] [-m <message>] [--reseed]

Compiles the tenant like check, then sends it: the tenant’s settings and CRM connection, the test CRM’s seed if it’s empty, each custom source, and each motion. Unchanged motions and sources stay as they are.

Option
--live Makes every new version live. Your token’s handle must be an approver of each motion.
--draft Keeps new versions as drafts, even with --live.
-m, --message A note stored with each new version.
--reseed Replaces everything in the test CRM with crm-seed.json.
seeded orbita's CRM with 6 records
orbita is in fixture mode: built-in sources answer from 4 fixtures
orbita/domain-check @ 4c427355d5 (new, live)
https://…/t/orbita/motions/domain-check/versions/4c427355…
Terminal window
npx motions open <tenant> <motion> [--list <name> | --companies <id,id>] [--label <text>]

Opens a batch on the motion’s live version, on a CRM list or on company ids. Without either, it uses the motion’s input.list. Prints the batch’s link.

Terminal window
npx motions pull <version> [--motion <id>] [--force]

Writes a version’s files into motions/<id>/, such as a version saved in the app. <version> is its id or a unique prefix of it. --motion is needed when the tenant has more than one motion. Refuses to overwrite files with uncommitted changes unless --force.

Terminal window
npx motions init [folder]

Writes a starting tenant: tenant.yaml, crm.yaml, an example motion with a test, package.json, tsconfig.json and a GitHub workflow.

Motions is built by Pruma. These docs describe what the platform does today; Limitations lists what it doesn't do yet. Open the app