matter.work
Building Apps / Runtime & Shipping

The matter command

Complete CLI reference for matter app, matter table, and matter keys.

The matter CLI ships with the Matter desktop app and acts as the member signed in on your computer. Matter must be running. To use matter in your own terminal, add its binary folder to your PATH:

Terminal
export PATH="$HOME/.matter/bin:$PATH"

On Windows, add %USERPROFILE%\.matter\bin to your Path (the executable there is matter.cmd). Agent threads inside Matter already have matter on their PATH.

Most commands act on the app whose id is in ./matter.json; pass --app <id> to target a different app. If multiple Matter accounts are signed in on the same computer, set MATTER_ACCOUNT to the user ID you want to use; otherwise matter uses the most recently started session.

Creating#

matter app create [dir] --space <space> --name <name> [--icon <emoji>] [--worker] #

Creates a new app shared to <space> (by name or ID), yours and unpublished, and scaffolds a React, Tailwind and TypeScript project in dir (or the current directory):

  • matter.json configured with "tables": {}, a dedicated dev port, and build config
  • index.html, src/main.tsx, src/App.tsx, src/matter.css, components.json, .gitignore and README.md
  • Matter’s components in src/components/ui/
  • src/matter-app.d.ts generated from your tables
  • With --worker: adds src/worker.ts and esbuild bundling in npm run build

Existing files are preserved, and the command refuses to overwrite a folder whose matter.json already has an app ID. Next steps: npm install and matter app deploy.

matter app types [path]#

Generates TypeScript definitions for the app's tables and boards—augmenting @matter.work/app-sdk—and writes them to path, the types path in matter.json, or matter-app.d.ts. If the app declares tables or boards in matter.json, types are generated directly from matter.json by key (no deploy required first). Otherwise, it types the space's tables by name. See Typed Tables.

matter table apply <schema.json> [--space <space>] [--prune] #

Creates tables, fields, options, and indexes from a JSON schema file for shared space tables that aren't owned by an app. (App-owned tables belong in matter.json instead; see Tables & Indexes.)

JSON
{
  "tables": [
    {
      "name": "Contacts",
      "fields": [{ "name": "Status", "type": "select", "options": ["New", "Met"] }],
      "indexes": [{ "name": "by_status", "match": ["Status"] }]
    }
  ]
}

Fields accept options, table (target table name for relations), board (target board name for task fields), currency, and allow_multiple. Existing tables and fields are left untouched. Pass --prune to delete indexes on those tables that aren't listed in the schema file.

matter app sdk [path]#

Writes a copy of the runtime SDK module served by this version of Matter (default ./matter-sdk.js) for inspection. Apps don't need to call this—importing @matter.work/app-sdk delegates to the copy Matter serves automatically.

Inspecting & Logs#

matter app logs [worker | tools] [--preview] [-n <lines>] [-f] [--app <id>] #

Prints the last 50 lines (or -n <lines>) of a process log on this computer, or all logs if no process is named. Pass -f to follow output live, or --preview to inspect a preview deployment's logs. See Logs.

matter app env [--app <id>]#

Prints export statements for the environment variables that the app's worker and tools receive on this computer, so you can run a script or worker directly in your shell:

Terminal
eval "$(matter app env)"
node dist/worker.mjs

matter app open [--preview <deploymentId>] [--app <id>]#

Opens the app in Matter (or opens a specific preview version when --preview is passed).

Shipping#

matter app deploy [-m <message>] [--preview] [--key <key>] [--drop <key|key.field,...>] [--adopt <key,...>] [--app <id>] #

Runs your build, bundles deploy.dir, signs it, brings the app's tables and boards in line with matter.json, and uploads the deployment. Without --preview, the new version immediately becomes current for the space.

  • --drop deals,deals.value — Removes tables, boards, or fields that matter.json no longer declares, and fields nobody declares (by key or name). A dropped table or board goes to the trash with its rows or tasks, and is purged after 30 days.
  • --adopt deals — Takes over a table or board of the space that no app owns, with a declared one's name.
  • --key <key> — Signs with a specific key (otherwise falls back to MATTER_SIGNING_KEY, signingKey in matter.json, or your default key).

Before uploading, matter app deploy validates your project and stops if you have no signing key, if minMatterVersion is missing, if matter.json has invalid table, board, or badge definitions, or if declared entry files are missing from deploy.dir.

matter app deployments [--app <id>]#

Lists the 30 most recent deployments of the app, newest first, with * marking the current version.

matter app promote <deploymentId> [--drop <key|key.field,...>] [--adopt <key,...>] [--app <id>] #

Promotes a preview to current (bringing tables and boards in line as a deploy does, with the same --drop and --adopt), or rolls back to a previously current deployment, which removes nothing. See Previews and Rollbacks.

matter app pull [dir] [--app <id>]#

Downloads the current deployment's files into dir (or the current directory). These are the files that were deployed (deploy.dir), so a project with a build step gets its built output, not its source.

matter app list#

Lists all apps across your workspaces with their IDs.

Routines#

matter app setup [--app <id>]#

Adds the app for you, running on this computer: its worker and your member routines run here. Open it in Matter to add it with one click instead.

matter app routines [--app <id>]#

Lists your routines for the app: key, title, schedule (or on demand), paused status, and ID.

matter app run <routine> [--input <json>] [--dev] [--app <id>] #

Triggers one of your routines for the app immediately by key, optionally passing JSON input.

Webhooks#

matter app webhooks [--app <id>]#

Lists the webhooks the app’s current version declares: each one’s URL, and whether it has a signing secret, how many events are waiting, and how many failed. When events have waited more than 5 minutes without being picked up, it says which computer they’re waiting for.

matter app webhook <key> --secret [--app <id>] #

Saves the secret the service signs the webhook’s requests with. It asks for it without showing what you type, or reads it from standard input.

Signing Keys#

Signing keys live in ~/.matter/keys. You can refer to any key by its name or fingerprint. See Signing Keys.

Command What it does
matter keys create [--name <name>] [--no-passphrase] Generates a new Ed25519 key, prompts for a passphrase, and registers the public key in your workspaces. Your first key becomes your default.
matter keys list Lists your local keys (* marks default) and any keys you registered on other computers.
matter keys default <key> Sets the default key used by matter app deploy.
matter keys export [<key>] [--private] Prints the key's name, fingerprint, and public key. Pass --private to output the full key JSON for team sharing or CI (MATTER_SIGNING_KEY).
matter keys import <file> Imports a key file onto this computer and registers it in your workspaces if not already registered.
matter keys register [<key>] Registers your key in all workspaces you belong to.
matter keys revoke <key> Revokes a key across your workspaces and moves its local file to ~/.matter/keys/revoked. Every app version signed by a revoked key stops immediately until redeployed with another key.