CLI Commands Since 3.5.0
The tcms CLI tool is the command-line interface to Total CMS. It exposes core CMS services as composable terminal commands, designed for both AI coding agents and human developers.
Running the CLI
Section titled “Running the CLI”php resources/bin/tcms <command> [options] [arguments]All commands support a --json flag that outputs valid JSON to stdout. This is the contract AI agents rely on — no decorative output, no progress bars, no color codes.
Global Options
Section titled “Global Options”| Option | Description |
|---|---|
--json | Output as JSON (for AI agent compatibility) |
-v | Verbose output |
-q | Quiet mode (errors only) |
-h, --help | Display help for a command |
-V, --version | Display version |
Site Information
Section titled “Site Information”Show site status, version, edition, license, collection count, and cache backends.
tcms infotcms info --jsonJSON output:
{ "version": "3.6.2", "build": "7f080a63", "edition": "pro", "license": { "valid": true, "trial": false, "trialDaysRemaining": null }, "domain": "example.com", "collections": { "total": 12 }, "schemas": { "reserved": 38, "custom": 4 }, "cache": { "backend": "apcu", "backends": { "opcache": "available", "apcu": "available", "redis": "active", "filesystem": "active" } }}cache.backend is the backend a web request stores data in; cache.backends lists every installed one with its status in the CLI process — available means installed but not usable from the command line, which is normal for APCu and OPcache when apc.enable_cli and opcache.enable_cli are off. The admin’s Cache Manager shows the same status for web requests.
The domain, and with it the edition and license, come from the Host header, which the CLI does not have. Web requests record the site’s origin in cache/.siteurl and the CLI reads it back, so the first tcms info on a fresh install (or right after a cache clear) can report unknown and a trial until the site has been loaded once in a browser. Setting domain in config/tcms.php overrides both.
The admin’s Server Checker (Admin → Utilities) from the command line: bundle integrity, license, server information, directory permissions, required and optional PHP extensions.
tcms checktcms check --config # also print the merged configuration, secrets redactedtcms check --jsonThe command exits 1 when the install cannot run — the bundle is corrupted, tcms-data, cache, logs or tmp is not writable, or a required extension is missing — or when the Security section has a critical finding that is not ignored. It exits 0 otherwise, so a deploy script can gate on it:
composer update && vendor/bin/tcms check || exit 1The Security section looks for common problems: a public data folder, exposed logs and project files, risky registration groups, debug mode, missing headers and more. Each finding links to its fix in the security guide. Pass --no-security to skip the section and get the old exit behavior. With --json, a security key holds checked, findings and url; url is null when the command line does not know the site’s address. That address is the one the site last recorded (see the cache/.siteurl rule below), so checks that make web requests are listed as not checked until someone visits the admin or domain is set. Ignore a finding on purpose with $settings['security']['ignore'] = ['check-id'] in config/tcms.php. The data folder and sensitive file checks write a small, world-readable test file and fetch it; a redirected request is listed as not checked, never as blocked. In the human output each finding prints its detail and then its fix, indented under the title. The report is saved to tcms-data/.system/security-report.json, which the dashboard alert reads for 24 hours.
The checks run in the command line’s PHP, which is not the one serving pages: the extensions, limits, cache state and session settings it reports can differ from the web server’s, and rows only a web request knows (the web server software) are left out. For the values a page request sees, use the Server Checker in the admin. The domain and license follow the same cache/.siteurl rule as info.
setup:admin
Section titled “setup:admin”Create the first admin account and mark setup finished, so the site opens ready to sign in instead of in the setup wizard. Use it when a script or a tool creates sites, such as Total CMS Studio.
The password is read from the first line of stdin and is never an option, so it stays out of the process list and your shell history. It needs at least 8 characters. --name defaults to Admin.
The command only makes the first admin. When the site already has one, it changes nothing and exits 1 with “This site already has an admin account.” It also exits 1 for an invalid email or a short password. With --json it prints {"created": true, "email": "…", "name": "…"} on success and {"error": "…"} otherwise.
Schema Commands
Section titled “Schema Commands”schema:list
Section titled “schema:list”List all schemas.
tcms schema:listtcms schema:list --customtcms schema:list --reservedtcms schema:list --category=Commercetcms schema:list --json| Option | Description |
|---|---|
--custom | Only show custom schemas |
--reserved | Only show reserved (built-in) schemas |
--category | Filter by category |
schema:get
Section titled “schema:get”Show full schema definition including properties, types, and field configurations.
tcms schema:get blogtcms schema:get blog --json| Argument | Required | Description |
|---|---|---|
id | Yes | Schema ID |
schema:export
Section titled “schema:export”Export a schema to a JSON file.
tcms schema:export blog --output=blog-schema.jsontcms schema:export blog| Argument | Required | Description |
|---|---|---|
id | Yes | Schema ID |
| Option | Description |
|---|---|
--output, -o | Output file path (omit for stdout) |
schema:import
Section titled “schema:import”Import a schema from a JSON file. Creates or updates the schema.
tcms schema:import my-schema.jsontcms schema:import my-schema.json --json| Argument | Required | Description |
|---|---|---|
file | Yes | Path to schema JSON file |
schema:lint
Section titled “schema:lint”Lint stored schemas without saving anything. schema:import validates on the way in, but schemas edited in place (by hand or by an AI agent) are never re-validated — the linter closes that gap. Errors are structural problems that break at runtime: no id property defined, required/index entries naming undefined properties, inheritFrom pointing at a missing schema, deck/card schemaref targets that don’t exist or contain deck-incompatible types, formgrid rows with a different number of names than the widest row (the browser drops the whole form layout when one row is short), and meta-schema violations. Warnings flag agent-legibility gaps — properties without help text (help feeds the MCP tool catalog) and schemas without a description.
tcms schema:lint # all custom schemastcms schema:lint blog # one schema (reserved schemas allowed by ID)tcms schema:lint --strict # warnings also fail the runtcms schema:lint --json # machine-readable report| Argument | Required | Description |
|---|---|---|
id | No | Schema ID (default: lint all custom schemas) |
| Option | Description |
|---|---|
--strict | Treat warnings as failures |
Exit code is 0 when no errors were found (warnings allowed), 1 when errors were found — or warnings under --strict — so it slots into CI.
schema:delete
Section titled “schema:delete”Delete a custom schema. It goes through the same checks as deleting from the admin: reserved schemas, schemas another schema inherits from (inheritFrom), and schemas a collection still uses are refused, and the error names what is in the way. A copy of the schema file is saved to .system/backups/schemas/{id}/ first.
tcms schema:delete retiredtcms schema:delete retired --force| Argument | Required | Description |
|---|---|---|
id | Yes | Schema ID |
| Option | Description |
|---|---|
--force, -f | Skip the confirmation prompt |
Only custom schemas can be deleted. An extension’s schemas go when the extension is removed.
Collection Commands
Section titled “Collection Commands”collection:list
Section titled “collection:list”List all collections with their schema and object count.
tcms collection:listtcms collection:list --schema=blogtcms collection:list --category=Contenttcms collection:list --json| Option | Description |
|---|---|
--schema | Filter by schema type |
--category | Filter by category |
collection:get
Section titled “collection:get”Show collection metadata including schema, sort order, and object count.
tcms collection:get blogtcms collection:get blog --json| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
collection:create
Section titled “collection:create”Create one collection. When the ID is a reserved collection (seo-site, automations, mailer, …) leave --schema off — the collection is provisioned with its shipped name and singleton flag, exactly as Project Setup → Setup Default Collections would, but for that one collection only. That is the point of this command on an existing site: tcms collection:create seo-site provisions just that collection, where Setup Default Collections would create every default. Any other ID is a custom collection and needs --schema.
tcms collection:create seo-sitetcms collection:create recipes --schema=blog --name="Recipes"tcms collection:create about --schema=text --singleton --json| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
| Option | Description |
|---|---|
--schema | Schema ID — required unless the collection ID is a reserved collection |
--name | Display name (defaults to the collection ID). Ignored for a reserved collection — it keeps its shipped name |
--singleton | Create as a single-object collection. Ignored for a reserved collection — its shipped singleton setting wins |
Exits 1 when the collection already exists, when a non-reserved ID is given without --schema, or when the schema is unknown or is a reference schema (totalcms, totalcms-item).
collection:update
Section titled “collection:update”Change some of an existing collection’s settings, keeping the rest. The save validates the result as the collection form does and fires collection.updated, which editing .meta.json by hand skips.
tcms collection:update recipes --set ownerProperty=authortcms collection:update blog --set url=/blog/{id} --set sortBy=date --set reverseSort=truetcms collection:update blog --set mcp.access=authenticatedtcms collection:update products --set properties.price.label=Costecho '{"seo":{"titleTemplate":"{title} | Recipes"}}' | tcms collection:update recipes ---set key=value sets one setting and can be repeated. A dot reaches into a map: mcp.access, or properties.price.label for one field override. The value is read as JSON when it parses (true, 5, null, ["a","b"]) and as a string otherwise; to keep a string that looks like something else, quote it as JSON: --set 'labelSingular="2024"'.
For bigger changes, pass JSON from a file or - for stdin; any --set is applied on top of it. These settings are maps that merge one key at a time, so send only the keys you change: properties, customProperties, formSettings, mcp, seo, sitemap and feed. A key set to null removes it. Field overrides live under properties, keyed by property name, and a field’s overrides merge too, so changing its label keeps its help text. Every other setting is replaced by the value sent.
| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
file | No | JSON file holding the settings to change, or - for stdin |
| Option | Description |
|---|---|
--set key=value | Set one setting; a dot reaches into a map. Repeatable |
--json | Print the saved settings |
Exits 1 when the collection does not exist, when nothing is given to change, or when the save refuses the result. A collection cannot be renamed, and its storage format changes only with collection:convert. Custom MCP tools (mcp.tools) are checked as the REST endpoints check them.
collection:delete
Section titled “collection:delete”Delete a collection. As in the admin, only its settings are deleted: its objects and files stay on disk, hidden, and creating a collection with the same id brings them back. The settings are saved to .system/backups/collections/{id}/ first, and the output says how many objects were kept.
tcms collection:delete old-newstcms collection:delete old-news --force| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
| Option | Description |
|---|---|
--force, -f | Skip the confirmation prompt, and delete even when something still refers to the collection |
--json | Print the result as JSON |
The collections the site signs people in with (auth.collection and the OAuth login collection) are refused, with or without --force.
Before deleting, the command looks for things that still refer to the collection: Data Views built from it, another collection’s owner or access collection setting, and auth.publicRegistration. If it finds any, it lists them and stops, even under --json; --force deletes anyway and prints the list. These would not break the delete, but they break later and quietly. Templates and relational fields that query the collection are not checked.
collection:query
Section titled “collection:query”Query a collection’s index with filtering, searching, sorting, and pagination.
tcms collection:query posts --search="photography" --limit=5tcms collection:query posts --include="featured:true" --sort="-date"tcms collection:query posts --exclude="draft:true" --limit=10 --offset=20tcms collection:query posts --filter="title:drone" --json| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
| Option | Description |
|---|---|
--search, -s | Full-text search query |
--filter | Contains filter (field:value) |
--include | Include filter (field:value,field:value) |
--exclude | Exclude filter (field:value,field:value) |
--sort | Sort by property (prefix with - for descending) |
--limit, -l | Maximum results (default: 20) |
--offset, -o | Number of results to skip (default: 0) |
JSON output:
{ "total": 37, "offset": 0, "limit": 5, "results": [...]}collection:export
Section titled “collection:export”Export a collection to JSON, CSV, or ZIP.
tcms collection:export blog --output=blog.jsontcms collection:export blog --format=csv --output=blog.csvtcms collection:export blog --format=zip --output=blog-backup.zip| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
| Option | Description |
|---|---|
--format, -f | Export format: json, csv, or zip (default: json) |
--output, -o | Output file path (omit for stdout; zip generates a default filename) |
The zip format includes all object JSON files and their associated media/assets. JSON export uses streaming for large collections when --output is specified.
collection:import
Section titled “collection:import”Import objects into a collection from a JSON or CSV file.
tcms collection:import blog posts.jsontcms collection:import blog data.csvtcms collection:import blog posts.json --updatetcms collection:import blog posts.json --format=json --json| Argument | Required | Description |
|---|---|---|
id | Yes | Collection ID |
file | Yes | Path to JSON or CSV file |
| Option | Description |
|---|---|
--format, -f | Import format: json or csv (auto-detected from extension) |
--update | Update existing objects instead of skipping |
collection:convert
Section titled “collection:convert”Convert a collection between json and markdown object storage; see Storage Format for how the conversion works and how to read its output.
tcms collection:convert docs --to=markdowntcms collection:convert docs --to=markdown --dry-runtcms collection:convert docs --to=json --json| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
| Option | Description |
|---|---|
--to | Target format: json or markdown |
--dry-run | Report what would change without writing anything |
Access Group Commands
Section titled “Access Group Commands”Access groups live in .system/access-groups.json, not in a collection, so these commands are how a script or agent reads and changes them. Changing a group needs the Access Groups edition, as the admin page does; reading works on every edition.
access-group:list
Section titled “access-group:list”List every group with what it grants on collection content.
tcms access-group:listtcms access-group:list --jsonaccess-group:get
Section titled “access-group:get”Show one group. With --json it prints the full definition, the shape access-group:set takes.
tcms access-group:get editortcms access-group:get editor --jsonaccess-group:set
Section titled “access-group:set”Create a group, or replace one, from a full JSON definition (a file, or - for stdin). Any permission section left out grants nothing.
tcms access-group:set authors authors.jsontcms access-group:get editor --json | tcms access-group:set editor-copy -{ "description": "Writes blog posts", "permissions": { "collections": {"operations": ["create", "read", "update"], "all": false, "allowed": ["blog"]}, "collectionsMeta": {"operations": ["read"], "all": true}, "schemas": {"operations": ["read"], "all": true}, "utils": {"all": false, "allowed": ["cache"]}, "settings": {"all": false, "allowed": []}, "extensions": {"all": true}, "dataviews": false, "builder": false, "mailer": false, "playground": false, "docs": true, "inlineEdit": true }}collections is content, collectionsMeta collection settings, and schemas schemas; each takes operations (from create, read, update, delete), all, and allowed, a list of ids used when all is false. utils, settings and extensions take all and allowed. The rest are true or false. An unknown section, key or operation is refused rather than saved, since a misspelled one would quietly grant nothing. The admin group cannot be changed.
access-group:patch
Section titled “access-group:patch”Change part of an existing group. Each permission section merges key by key, so send only what changes; a list (operations, allowed) is replaced by the list sent.
echo '{"permissions":{"collections":{"allowed":["blog","news"]}}}' | tcms access-group:patch editor -echo '{"permissions":{"dataviews":true}}' | tcms access-group:patch analysts -Object Commands
Section titled “Object Commands”object:list
Section titled “object:list”List object IDs in a collection.
tcms object:list blogtcms object:list blog --limit=10 --offset=20tcms object:list blog --json| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
| Option | Description |
|---|---|
--limit, -l | Maximum results |
--offset, -o | Number of results to skip |
object:get
Section titled “object:get”Fetch a single object with all its properties.
tcms object:get blog my-posttcms object:get blog my-post --json| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
object:create
Section titled “object:create”Create one object from a JSON file (or stdin with -). The object goes through the full save pipeline — schema defaults fill in, validation runs, the index updates, and the object.created event fires — exactly as if it were saved from the admin. Refuses to overwrite an existing object, and refuses a JSON array (use collection:import for bulk data).
tcms object:create blog my-post.jsonecho '{"id":"hello","title":"Hello"}' | tcms object:create blog -tcms object:create blog my-post.json --json # echoes the saved object| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
file | Yes | Path to a JSON file holding one object, or - for stdin |
object:patch
Section titled “object:patch”Merge changes into an existing object, leaving every field you don’t mention untouched. Like object:create, it goes through the full save pipeline — validation runs, the collection index updates, and object.updated fires — so it stays consistent with the admin in a way that editing the JSON file by hand does not.
Use this for a targeted change to one object. object:create only makes new objects, and collection:import works in bulk.
tcms object:patch blog my-post patch.jsonecho '{"title":"New Title"}' | tcms object:patch blog my-post -tcms object:patch blog my-post patch.json --json # echoes the saved objectThe merge is shallow. Patching a structured field from the top level replaces it wholesale, which will quietly discard the parts you didn’t mention. Target the property instead to merge into it:
# Replaces the whole image field — name, size and dimensions are lostecho '{"image":{"alt":"A description"}}' | tcms object:patch image social -
# Changes only alt, preserving everything else on the fieldecho '{"alt":"A description"}' | tcms object:patch image social - --property=image| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
file | Yes | Path to a JSON file holding the fields to merge, or - for stdin |
| Option | Description |
|---|---|
--property | Merge into this property instead of the top level, preserving its other keys |
object:export
Section titled “object:export”Export a single object as JSON or ZIP (with assets).
tcms object:export blog my-post --output=my-post.jsontcms object:export blog my-post --format=zip --output=my-post.ziptcms object:export blog my-post| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
| Option | Description |
|---|---|
--format, -f | Export format: json or zip (default: json) |
--output, -o | Output file path (omit for stdout; zip generates a default filename) |
object:delete
Section titled “object:delete”Delete a single object. The deletion goes through the same index-aware path as the admin UI, so the collection’s .index.json and object count stay consistent — unlike removing the flat file by hand, which leaves them stale.
tcms object:delete blog my-posttcms object:delete blog my-post --force| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
| Option | Description |
|---|---|
--force, -f | Skip the confirmation prompt (required for non-interactive/CI use) |
The prompt defaults to no. A run that cannot answer it — no terminal on stdin, or -n — fails with exit code 1 and deletes nothing, so a script that forgets --force finds out rather than carrying on. The same holds for every command that confirms before acting: backup:restore, update:apply, update:rollback and extension:remove. --json also skips the prompt.
Deck Commands
Section titled “Deck Commands”deck:import
Section titled “deck:import”Import items into a deck property from a JSON or CSV file.
tcms deck:import invoices inv-001 items line-items.jsontcms deck:import invoices inv-001 items line-items.csv --update| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
object | Yes | Object ID |
property | Yes | Deck property name |
file | Yes | Path to JSON or CSV file |
| Option | Description |
|---|---|
--format, -f | Import format: json or csv (auto-detected from extension) |
--update | Update existing deck items instead of skipping |
Feed Commands
Section titled “Feed Commands”rss:import
Section titled “rss:import”Queue every entry from an RSS, Atom, or JSON feed into a target collection. The CLI counterpart to the Utilities → Import RSS admin page. Designed for cron — the admin form has a “Schedule with cron” panel that builds the exact command line for the configured import so operators can paste it directly into crontab.
# Basic import — auto field mapping, items queued as draftstcms rss:import https://example.com/feed.xml blog
# Publish immediatelytcms rss:import https://example.com/feed.xml blog --no-draft
# Drain the queue in the same cron runtcms rss:import https://example.com/feed.xml blog && tcms jobs:process| Argument | Required | Description |
|---|---|---|
url | Yes | RSS / Atom / JSON Feed URL |
collection | Yes | Target collection ID |
| Option | Description |
|---|---|
--draft / --no-draft | Queue items as drafts (default) or publish immediately |
--map, -m | Field mapping in the form feedField=collectionField. Repeat the option or comma-separate within one value. See below. |
--user-agent | User-Agent for the feed request. See below. |
--json | Output JSON (success status + count) |
When a feed returns 403
Section titled “When a feed returns 403”Feed requests identify themselves as TotalCMS/{version} (+https://totalcms.co). Some hosts — Cloudflare-fronted sites in particular — block requests from unrecognized or generic clients outright, and a feed that opens fine in a browser can still return 403 to a server.
If a host rejects the default, --user-agent sets your own:
tcms rss:import https://example.com/feed.xml blog \ --user-agent "AcmeNews/1.0 (+https://acme.example)"Identify yourself honestly — a contactable URL is what gets a well-run site to allowlist you. Impersonating a browser tends to be treated as evasion and blocked harder.
Field mapping
Section titled “Field mapping”The importer maps these eight feed-side fields to your collection’s properties:
| Feed field | Default collection property |
|---|---|
title | title |
content | content |
summary | summary |
date | date |
author | author |
categories | categories |
link | media |
image | image |
To override a default mapping, pass --map feedField=collectionProperty. To drop a field entirely (don’t write it to the object), map it to an empty string with --map feedField=.
# Map the feed's `title` into your schema's `heading` property,# and the feed's `content` into your schema's `body` property.tcms rss:import https://example.com/feed.xml blog \ --map title=heading \ --map content=body
# Same thing, comma-separated single argument (handy in crontab one-liners).tcms rss:import https://example.com/feed.xml blog --map "title=heading,content=body"
# Drop the link/categories fields entirely; remap the rest.tcms rss:import https://example.com/feed.xml news \ --map title=headline \ --map content=body \ --map image=hero \ --map link= \ --map categories=
# Realistic news-import recipe targeting a schema with# `heading`, `body`, `excerpt`, `published`, `byline`, `tags`, `hero`.tcms rss:import https://example.com/feed.xml news --no-draft \ --map title=heading \ --map content=body \ --map summary=excerpt \ --map date=published \ --map author=byline \ --map categories=tags \ --map image=heroCron example
Section titled “Cron example”# Hourly RSS pull — drain the queue right after queuing0 * * * * /usr/local/bin/php /var/www/site/resources/bin/tcms rss:import "https://example.com/feed.xml" blog --no-draft --map "title=heading,content=body" && /usr/local/bin/php /var/www/site/resources/bin/tcms jobs:processThe admin UI’s “Schedule with cron” panel under Utilities → Import RSS prints this command for you with your site’s PHP and install paths already filled in — open the panel, copy, paste into crontab.
JumpStart Commands
Section titled “JumpStart Commands”jumpstart:export
Section titled “jumpstart:export”Export all site data (schemas, collections, objects, templates) as a JumpStart file.
tcms jumpstart:export --output=my-site.jsontcms jumpstart:export --name="My Site" --description="Full site export"tcms jumpstart:export --json| Option | Description |
|---|---|
--name | Name for the export |
--description | Description for the export |
--output, -o | Output file path (generates default filename if omitted) |
jumpstart:import
Section titled “jumpstart:import”Import a JumpStart file to set up schemas, collections, objects, and templates.
tcms jumpstart:import my-site.jsontcms jumpstart:import my-site.json --json| Argument | Required | Description |
|---|---|---|
file | Yes | Path to JumpStart JSON file |
Sync Commands
Section titled “Sync Commands”Push and pull schemas, templates, site-machinery objects, and collection settings between a local development instance and a production server. Configure the production server URL and API key in Settings > Sync in the admin dashboard. Full details, including the object-seeding workflow: Sync guide.
3.5.1 note:
--collectionsnow means collection settings (it used to mean objects from five allowlisted collections). The flag formerly namedcollection-metais gone —--collectionsdoes its job now. Objects for those five collections move via their own feature flags instead (--pages,--dataviews,--mailer,--mcp-prompts,--automations), and any other collection’s object data can be seeded with--objects. Full breaking-changes writeup: Sync guide.
Push schemas, templates, site-machinery objects, collection settings, and (optionally) seed object data to the production server.
tcms pushtcms push --dry-runtcms push --schemas=blog,productstcms push --templates=blog-post,sidebartcms push --pagestcms push --pages=home,abouttcms push --collections=comparisons,builder-pagestcms push --objects=blogtcms push --objects=blog:launch-day --overwrite --dry-runtcms push --schemas=blog --templates=blog-post --dry-run| Option | Description |
|---|---|
--schemas | Comma-separated schema IDs to push |
--templates | Comma-separated template IDs to push |
--pages[=id,id] | Site Builder pages — all of them, or just the ones listed |
--dataviews[=id,id] | Data Views — all of them, or just the ones listed |
--mailer[=id,id] | Mailer templates — all of them, or just the ones listed |
--mcp-prompts[=id,id] | MCP prompts — all of them, or just the ones listed |
--automations[=id,id] | Automations — all of them, or just the ones listed |
--collections | Comma-separated collection IDs whose SETTINGS to push (any collection; counters never travel) |
--objects | Seed object data: collection or collection:id,id, repeatable. Existing objects on the target are skipped unless --overwrite is given. Push-only |
--overwrite | Let --objects overwrite objects that already exist on the target |
--force | Allow --overwrite without a prior --dry-run when not attached to a terminal |
--dry-run | Compare both sides: per-item unchanged/differs/new status with newer-side hints |
Pull schemas, templates, site-machinery objects, and collection settings from the production server. --objects/--overwrite have no pull equivalent — seeding is push-only.
tcms pulltcms pull --dry-runtcms pull --schemas=blogtcms pull --templates=blog-post,sidebartcms pull --pages=home,abouttcms pull --collections=comparisons| Option | Description |
|---|---|
--schemas | Comma-separated schema IDs to pull |
--templates | Comma-separated template IDs to pull |
--pages[=id,id] | Site Builder pages — all of them, or just the ones listed |
--dataviews[=id,id] | Data Views — all of them, or just the ones listed |
--mailer[=id,id] | Mailer templates — all of them, or just the ones listed |
--mcp-prompts[=id,id] | MCP prompts — all of them, or just the ones listed |
--automations[=id,id] | Automations — all of them, or just the ones listed |
--collections | Comma-separated collection IDs whose SETTINGS to pull (any collection; counters never travel) |
--dry-run | Compare both sides: per-item unchanged/differs/new status with newer-side hints |
What gets synced: Custom schemas, custom templates, collection settings for any collection (never its counters), objects for the five feature-flagged collections — builder-pages (--pages), mailer, mcp-prompt (--mcp-prompts), dataviews, automations — and, push-only, seeded object data for any other seedable collection via --objects.
What never gets synced: Objects in custom collections you haven’t named with --objects; the image, gallery, file, depot, and playground collections, which can never be seeded; image/file/gallery/depot fields on any object, which are always stripped from every payload; media/images; system settings; API keys; reserved schemas. A custom collection’s schema syncs; its objects only travel if you explicitly seed them.
Filter semantics: a bare tcms push or tcms pull is a full mirror of schemas, templates, the five feature-flagged collections, and collection settings — it never seeds --objects, which only runs when named explicitly. The moment any filter flag is given, the categories you did not mention are excluded entirely, so tcms push --schemas=blog moves the blog schema and nothing else.
Backups: before an overwrite lands, the receiving instance snapshots the current version to tcms-data/.system/backups/{schemas,objects}/... (ten most recent per item). See the Sync guide for details.
Cache & Jobs
Section titled “Cache & Jobs”cache:clear
Section titled “cache:clear”Clear all caches.
tcms cache:cleartcms cache:clear --jsonHow this reaches the web server. APCu is per-process, so a CLI run cannot clear the cache the web server is holding — the two never share memory. Instead, cache:clear clears what it can reach directly (filesystem, Redis, Memcached) and writes a signal file to tcms-data/.system/.cache_invalidate. The next request to hit the site replays that signal and clears APCu in the web process.
That means the clear does not take effect until someone loads a page. If you clear from a deploy script and immediately check the site, the very request you make is the one that applies it — so a single reload can still look stale. Load the page twice.
If a clear appears not to have worked, check whether the signal file is still sitting there:
ls tcms-data/.system/.cache_invalidatePresent means no request has replayed it yet. Gone means it was applied.
Alternatives when you are iterating. Two options avoid the round trip entirely:
- Turn on Developer Mode in the admin. Cache reads are bypassed outright while it is active, so you see fresh output on every request without clearing anything. This is the right choice while you are actively editing templates or content.
- Hit the HTTP endpoint at
/api/emergency/cache/clear, which clears in the web process directly rather than by signal. It needs no login, and it is rate-limited to one call per IP every 15 minutes.
Note the
/apiprefix —/emergency/cache/clearwithout it returns a 404.
imageworks:warm
Section titled “imageworks:warm”Pre-build the ImageWorks cache for a collection, so the first visitor to a page does not wait for images to be made. It writes only to the ImageWorks cache and skips files that already exist.
tcms imageworks:warm blog image --widths=480,768,1024 --formats=avif,webp,nativetcms imageworks:warm blog --picture --dry-runtcms imageworks:warm blog --params="w=800&h=600&fit=crop" --preset=mediumtcms imageworks:warm blog --url="https://example.com/imageworks/blog/a/image.webp?w=800"tcms imageworks:warm blog --picture --id=a,b,ctcms imageworks:warm products mydeck/photo --picture| Argument / Option | Description |
|---|---|
collection | Collection ID (required) |
property | One image, gallery or video property, or parent/child for an image in a card or deck: mycard/photo, or mydeck/photo for every deck item. A video gives its poster. Default: every image and gallery property; videos, cards and decks must be named |
--widths | Comma list of widths. Makes every width in every format |
--formats | Comma list of formats for the grid: avif, webp, native, and so on. Defaults to native with --widths. Needs --widths or --picture |
--picture | The grid cms.render.picture() uses by default (the imageworks.picture setting) plus native |
--params | ImageWorks params as a query string. One exact variant, or extra params for the grid. Repeatable |
--preset | A preset name. Repeatable |
--url | Copy a variant from a real ImageWorks URL. A gallery URL ending in /first, /last or /featured gives its params only. Repeatable |
--id | Comma list of object IDs (default: the whole collection) |
--dry-run | Count what would be made and make nothing |
--memory, -m | Memory limit (default: 512M) |
You must give at least one of --widths, --picture, --params, --preset or --url. The summary lists objects, images, variants made (or would make), already cached, original and failed, then the first five failures. With --json it prints the same counts and the full failure list. The command exits 1 when anything failed. Run the command as the web server user; it warns when you are not the owner of the data folder. See Warming the cache for choosing variants.
jobs:process
Section titled “jobs:process”Process the pending job queue. This is typically run via cron.
tcms jobs:processtcms jobs:process -vtcms jobs:process --memory=1Gtcms jobs:process --json| Option | Description |
|---|---|
--memory, -m | Memory limit (default: 512M) |
-v | Verbose output with per-job details |
Cron setup:
* * * * * php /path/to/resources/bin/tcms jobs:processautomations:process
Section titled “automations:process”Fire due scheduled automations. Runs on its own cron line, parallel to jobs:process, so a large import backlog in the job queue never delays a time-sensitive scheduled automation. Single-flight locked, so overlapping cron ticks can’t double-fire the same run.
tcms automations:processtcms automations:process --jsonWebhook and event triggers do not depend on this command — webhooks fire on HTTP request and events fire when the originating write happens; their async runs are drained on the next tick.
Cron setup (add this as a second line, alongside jobs:process):
* * * * * php /path/to/resources/bin/tcms automations:processMCP Commands
Section titled “MCP Commands”See the MCP Server guide for the full server documentation.
mcp:status
Section titled “mcp:status”Show the MCP server’s operator-facing health: enabled state, public-access switch, edition gate, tool prefix, and the tool list each persona sees. Saved-query tools defined in collection MCP cards are included and annotated (saved query).
tcms mcp:statustcms mcp:status --json # persona tool lists plus a schema_tools arraymcp:test
Section titled “mcp:test”Invoke a tool locally without going through the HTTP endpoint — useful for verifying a tool’s output and persona visibility before an agent connects.
tcms mcp:test query_collection --params='{"collection":"blog","limit":3}'tcms mcp:test query_collection --params='{"collection":"blog"}' --persona=publicBackup Commands
Section titled “Backup Commands”Every object save keeps the version it replaced and every delete keeps the final state, under tcms-data/.system/backups/objects/. These two commands read that history back. See Backups for what is kept and for how long.
backup:list
Section titled “backup:list”List the snapshots kept for one object, newest first. The Snapshot column is the filename backup:restore takes. A deleted object still lists — its history survives the delete.
tcms backup:list blog my-posttcms backup:list blog my-post --json| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
backup:restore
Section titled “backup:restore”Put a snapshot back as the live record. This is an ordinary save: the index rebuilds, listeners fire, and the state being replaced is snapshotted first — so a restore can itself be undone by restoring one entry back. Restoring a deleted object recreates it.
tcms backup:restore blog my-post my-post-20260919-091500.jsontcms backup:restore blog my-post --latesttcms backup:restore blog my-post --latest --force| Argument | Required | Description |
|---|---|---|
collection | Yes | Collection ID |
id | Yes | Object ID |
snapshot | No | Snapshot filename from backup:list (omit with --latest) |
| Option | Description |
|---|---|
--latest | Restore the newest snapshot |
--force, -f | Skip the confirmation prompt (required for non-interactive/CI use) |
Maintenance Commands
Section titled “Maintenance Commands”repair:index
Section titled “repair:index”Rebuild a collection’s .index.json and totalObjects count from the objects on disk. Use this when the index has drifted from the actual files — for example after an object’s flat file was added or removed out-of-band. (search:reindex only touches the search provider; repair:files only rebuilds file/image metadata.)
tcms repair:index blogtcms repair:index --alltcms repair:index blog --check| Argument | Required | Description |
|---|---|---|
collection | No | Collection ID (omit and use --all to rebuild every collection) |
| Option | Description |
|---|---|
--all | Rebuild the index for every collection |
--check | Only report how the index and the object files disagree; change nothing |
Checking before you rebuild
Section titled “Checking before you rebuild”A rebuild makes the index match the files, so it also hides what was wrong. --check reports instead, and changes nothing:
- object files that cannot be read (invalid JSON, broken front matter)
- ids in the index with no object file
- object files the index does not list
- an index file that is missing or unreadable
- a collection object count that does not match the files
It reads every object, so it takes about as long as a rebuild. It exits with 1 when it finds a problem and 0 when the collection is consistent, so a script can gate on it. Combine with --all to check every collection and with --json for machine-readable output:
tcms repair:index blog --check'blog': 2 problem(s) — 41 object file(s), 42 in the index: In the index but no file: old-post The collection's object count says 42; there are 41 on diskNothing was changed. Run without --check to rebuild the index from the files.JSON output (--check --json):
{ "status": "problems", "collections": { "blog": { "objects": 41, "indexed": 42, "indexReadable": true, "recordedCount": 42, "unreadable": [], "missingFiles": ["old-post"], "notIndexed": [], "problems": [ "In the index but no file: old-post", "The collection's object count says 42; there are 41 on disk" ] } }}indexed is null when there is no readable index file; recordedCount is null when the count was never calculated.
Update Commands
Section titled “Update Commands”update:check
Section titled “update:check”Check for available updates from the license server.
tcms update:checktcms update:check --jsonJSON output:
{ "current": "3.2.2", "available": true, "version": "3.5.0", "releaseDate": "2026-04-10", "severity": "minor", "changelog": "New features and improvements", "downloadUrl": "/version/download/3.5.0"}update:apply
Section titled “update:apply”Download and apply an available update. The site enters maintenance mode during the swap.
tcms update:applytcms update:apply --forcetcms update:apply --json| Option | Description |
|---|---|
--force | Skip confirmation prompt |
The previous version is backed up automatically for rollback.
update:rollback
Section titled “update:rollback”Roll back to the previous version after a failed or unwanted update.
tcms update:rollbacktcms update:rollback --force| Option | Description |
|---|---|
--force | Skip confirmation prompt |
Restores the backup directory created during the most recent update.
Extension Commands
Section titled “Extension Commands”extension:list
Section titled “extension:list”List all discovered extensions with their status.
tcms extension:listtcms extension:list --jsonJSON output:
[ { "id": "acme/seo-pro", "name": "SEO Pro", "version": "1.2.0", "source": "composer", "enabled": true, "error": null }]source is where the extension was found: bundled (ships with Total CMS), composer (a totalcms-extension package in vendor/), project (the site’s extensions/ directory) or user (tcms-data/extensions/).
extension:install
Section titled “extension:install”Install an extension from a zip into tcms-data/extensions/{vendor}/{name}/, or replace one that is already there.
tcms extension:install ~/Downloads/seo-pro-1.2.0.ziptcms extension:install seo-pro-1.2.0.zip --force # replace without askingtcms extension:install seo-pro-1.2.0.zip --jsonThe zip is the extension folder zipped (a single top-level folder holding extension.json), or extension.json at the zip root. The install path comes from the manifest id. The archive is checked for unsafe paths and symlinks, the manifest is validated and checked against this site’s Total CMS, PHP and edition requirements, and the code is scanned before it lands. A fresh install is not enabled; run extension:enable when you have reviewed it. Replacing an installed extension keeps its state, permissions and settings and asks for confirmation unless --force is given; an enabled extension whose replacement adds risky code is disabled pending review.
An id owned by a bundled, Composer or project extension is refused with the owner named.
| Argument | Required | Description |
|---|---|---|
zip | Yes | Path to the extension zip |
| Option | Description |
|---|---|
--force, -f | Replace an existing copy without the confirmation prompt |
extension:package
Section titled “extension:package”Build the distributable zip for an extension directory: {name}-{version}.zip with everything inside a single {name}/ folder — the shape extension:install and the admin upload accept.
cd my-extension && tcms extension:packagetcms extension:package path/to/my-extension --output ~/releasestcms extension:package . --force # overwrite an existing zip.git, .github, .DS_Store, node_modules and tests are left out at any depth; everything else, including vendor/, goes in as found. Run composer install --no-dev first if the extension has Composer dependencies — the command warns when composer.json has requirements but there is no vendor/autoload.php.
| Argument | Required | Description |
|---|---|---|
dir | No | Extension directory containing extension.json (default: current directory) |
| Option | Description |
|---|---|
--output, -o | Directory to write the zip into (default: next to the extension directory) |
--force, -f | Overwrite an existing zip |
extension:enable
Section titled “extension:enable”Enable a discovered extension.
tcms extension:enable acme/seo-protcms extension:enable acme/seo-pro --json| Argument | Required | Description |
|---|---|---|
id | Yes | Extension ID (e.g. vendor/extension-name) |
Running it again on an extension that is already enabled keeps the operator’s permission choices and turns on any capability the extension has gained since. That is the quick way to pick up a new registration while developing an extension: a capability Total CMS first sees at boot is added turned off (see Stability & Safety), and the log says so with a warning naming the capability.
extension:disable
Section titled “extension:disable”Disable an extension without removing it.
tcms extension:disable acme/seo-protcms extension:disable acme/seo-pro --json| Argument | Required | Description |
|---|---|---|
id | Yes | Extension ID (e.g. vendor/extension-name) |
extension:remove
Section titled “extension:remove”Remove an extension’s files. Extension data in tcms-data is preserved.
tcms extension:remove acme/seo-protcms extension:remove acme/seo-pro --forceOnly an extension in tcms-data/extensions/ can be removed this way. A bundled extension ships with Total CMS, a project extension belongs to source control, and a Composer extension is removed with composer remove <package>; the command refuses each and names the alternative. extension:disable works for all of them.
| Argument | Required | Description |
|---|---|---|
id | Yes | Extension ID (e.g. vendor/extension-name) |
| Option | Description |
|---|---|
--force, -f | Skip confirmation prompt |
Agent Skill
Section titled “Agent Skill”skill:install
Section titled “skill:install”Install or refresh the bundled Total CMS agent skill into .claude/skills/totalcms/, so Claude Code, Cursor and other coding agents pick up the conventions that ship with your version of the CMS.
tcms skill:installtcms skill:install --jsonComposer installs run this for you on every composer install and composer update, so the skill always matches the installed totalcms/cms.
Zip installs run it by hand — once from the app folder after unpacking, and again after each update, since an update replaces resources/:
php resources/bin/tcms skill:installThe skill’s paths are rewritten to match the layout it is installed into. Composer installs get vendor/bin/tcms and vendor/totalcms/cms/resources/docs/; zip installs get php resources/bin/tcms and resources/docs/.
Installing overwrites the existing copy — the skill is core-owned, so keep local notes outside .claude/skills/totalcms/.
The same run installs the skill of every enabled extension that ships one (a skill/ directory next to its manifest — see Agent Skill) into .claude/skills/{vendor}-{name}/, and removes the folder of any extension that has since been disabled or removed. Only folders the command wrote are ever touched. --check covers them too, and exits 1 when any is stale.
Checking whether the installed skill is stale
Section titled “Checking whether the installed skill is stale”An agent loads the skill text once, at the start of a session, so a copy that has fallen behind keeps steering the agent with old conventions. --check compares the installed copy against the shipped source and writes nothing:
tcms skill:install --checktcms skill:install --check --jsonFreshness is a content hash, not a version number: the install stamps a sha256 of the shipped skill files into .claude/skills/totalcms/.skill-manifest.json and into SKILL.md’s frontmatter. A CMS release that does not touch the skill leaves the check passing, and editing one reference file flags exactly that file.
Exit codes make it scriptable:
| Exit | Meaning |
|---|---|
0 | The installed skill matches the shipped source |
1 | Stale, or not installed at all |
After re-installing, start a new agent session — the skill text already loaded cannot replace itself.
Optionally, have Claude Code run the check for you at the start of every session with a SessionStart hook in .claude/settings.json:
{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "vendor/bin/tcms skill:install --check" } ] } ] }}