@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
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
templates/*.json or add a
section under theme/custom/sections/ — yourself or with your agent — and open the preview.3
Check
4
Share
5
Publish
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.