CLI Commands Since 3.3.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 backend.
tcms infotcms info --jsonJSON output:
{ "version": "3.2.2", "build": "7f080a63", "edition": "pro", "license": { "valid": true, "trial": false, "trialDaysRemaining": null }, "domain": "example.com", "collections": { "total": 12 }, "schemas": { "reserved": 22, "custom": 4 }, "cache": { "backend": "apcu" }}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 |
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: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 |
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: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) |
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 |
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 and templates between a local development instance and a production server. Configure the production server URL and API key in Settings > Sync in the admin dashboard.
Push schemas and templates to the production server.
tcms pushtcms push --dry-runtcms push --schemas=blog,productstcms push --templates=blog-post,sidebartcms push --schemas=blog --templates=blog-post --dry-run| Option | Description |
|---|---|
--schemas | Comma-separated schema IDs to push (default: all custom) |
--templates | Comma-separated template IDs to push (default: all custom) |
--dry-run | Preview what would be pushed without sending |
Pull schemas and templates from the production server.
tcms pulltcms pull --dry-runtcms pull --schemas=blogtcms pull --templates=blog-post,sidebar| Option | Description |
|---|---|
--schemas | Comma-separated schema IDs to pull (default: all) |
--templates | Comma-separated template IDs to pull (default: all) |
--dry-run | Preview what would be pulled without applying |
What gets synced: Custom schemas and custom templates only.
What never gets synced: Content/objects, media/images, system settings, API keys, reserved schemas.
Cache & Jobs
Section titled “Cache & Jobs”cache:clear
Section titled “cache:clear”Clear all caches. When run from CLI, a signal file is written so the web process clears its APCu cache on the next request.
tcms cache:cleartcms cache:clear --jsonjobs: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:processUpdate 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.3.0", "releaseDate": "2026-04-10", "severity": "minor", "changelog": "New features and improvements", "downloadUrl": "/version/download/3.3.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.