@platformdtc/cli gives you — and any coding agent working in your editor — a PlatformDTC theme as a local folder. It talks to the same Agent Gateway /themes endpoints as the remote MCP server, and runs the same theme check locally.

Install

Requires Node.js 20 or later.

Sign in

Your browser opens PlatformDTC. Sign in, choose the store, choose the permissions to grant, and approve. The CLI receives the result on a local 127.0.0.1 callback — nothing to copy and paste. Credentials are kept in your operating system’s keychain (macOS Keychain, or libsecret on Linux), or otherwise in ~/.config/platformdtc/credentials.json, readable only by you. Access tokens last one hour and are refreshed automatically. CI and headless machines: set DTC_AGENT_KEY to a static sq_agt_* key with the theme scopes the job needs. When it is set, the CLI uses it and does not use stored credentials.

Commands

Options every command accepts: --theme defaults to the theme the folder was initialized from. --only takes comma-separated globs (*, **, ?, {a,b}) and can be repeated. Run dtc theme <command> --help for every option of a command.

A typical session

1

Set up the folder

init links the folder to a theme and writes AGENTS.md and CLAUDE.md so Claude Code, Codex and Cursor know the rules of a PlatformDTC theme. Those files, .dtcignore, and editor folders such as .cursor/ and .claude/ stay local and are never pushed.
2

Develop

Works against a development theme, never your live theme. Edit templates/*.json or add a section under theme/custom/sections/ — yourself or with your agent — and open the preview.
3

Check

Fix every error. TypeScript errors are warnings here and errors on publish, so fix those too.
4

Share

Uploads the folder to a new development theme and prints a temporary preview link for a colleague or client.
5

Publish

Runs theme check locally in publish mode, then publishes; the server runs the same check again and refuses the publish with CHECK_FAILED if anything is wrong. If your store requires approval, the command reports that the publish is waiting — approve it in Settings → Developer → Build with your agent.

How push keeps other people’s changes safe

The CLI remembers the checksum of every file it last pulled or pushed (in .platformdtc/state.json, which is git-ignored). When you push a file, it sends that checksum as checksum_before. If someone changed the file on PlatformDTC in the meantime — the merchant in the theme editor, or another agent — the server refuses that file with CONFLICT instead of overwriting their work. Pull, merge, and push again. Push also follows the ownership rules: platform-owned files are refused with PLATFORM_OWNED, and node_modules/, .next/, out/, .git/ and data/ are never uploaded. theme/custom/index.ts is generated by the platform and is never uploaded either. Add your own exclusions to .dtcignore, one glob per line. Large pushes are split automatically into batches of at most 50 files and 2 MiB (a single file may be at most 2 MiB). Each batch is saved as one version. Every write carries an Idempotency-Key, so a request retried after a network error is applied once.

Versions and rollback

Every successful write — from the CLI, an agent or the editor — is recorded as a theme version.
Rolling back a development theme does not change your live store; publish it to put it live.

Local dev MCP for your agent

Give a local agent the docs, schemas and validators without granting it access to your store:
See MCP tool reference → Local dev MCP.