Commands Reference

Complete reference for all YourTM CLI commands, options, and usage examples.

Command Anatomy

Every command follows a consistent structure to keep your workflow predictable.

ytm command sub-command --options
Tool Name
Primary Action
Scope/Target
Modifiers

Global Options

These options are available for all commands:

Option Description
--version Display CLI version
--help Display help for command
--debug Enable verbose debug logging

Project Commands

ytm init

Core

Initialize a new YourTM project in the current directory.

ytm init [options]
Option Description Default
-f, --force Overwrite existing configuration false

Examples

# Interactive initialization
ytm init

# Force overwrite existing config
ytm init --force

ytm create

Core

Create tags, triggers, zones, or variables from templates using an interactive wizard.

ytm create [type] [options]
Option Description Default
[type] Type to create: tag, trigger, zone, variable interactive
-p, --platform <platform> Pre-select platform (skip selection) -
-n, --name <name> Set the name -
-o, --output <path> Custom output path -
-y, --yes Skip confirmation prompts false

Examples

# Interactive wizard
ytm create

# Create a tag
ytm create tag

# Create a trigger
ytm create trigger

# Create a zone
ytm create zone

# Create Google tag with preset name
ytm create tag -p google -n "GA4 Pageview"

ytm import

Core

Import tags, triggers, and variables from another platform (currently supports Google Tag Manager JSON exports).

ytm import <source> <file> [options]
Option Description Default
<source> The source platform (e.g., 'gtm') -
<file> Path to the export file (JSON) -
-o, --output <dir> Custom output directory yourtm/
-f, --force Overwrite existing files false

Examples

# Import from a GTM export file
ytm import gtm ./gtm-export.json

# Import into a custom directory
ytm import gtm ./export.json --output ./custom-tags

ytm audit

Core

Perform a deep system audit to detect redundancy (DRY), performance bottlenecks, and best practice violations.

ytm audit [options]
Option Description Default
--fix Automatically fix simple issues where possible false

Examples

# Run system-wide audit
ytm audit

# Audit and attempt auto-fixes
ytm audit --fix

Build Commands

ytm build

Core

Compile TypeScript tags into optimized JavaScript bundles for production.

ytm build [options]
Option Description Default
-c, --clean Clean output directory before building false
--sourcemap Generate source maps false
--no-minify Disable minification false
-w, --watch Watch for changes and rebuild false

Examples

# Production build
ytm build

# Watch mode
ytm build --watch

ytm dev

Core

Start development server with hot reload for local testing.

ytm dev [options]
Option Description Default
-p, --port <port> Port to listen on 3456
-h, --host <host> Host to bind to localhost
-o, --open Open browser automatically false

Examples

# Start dev server
ytm dev

# Custom port
ytm dev --port 8080

Deploy Commands

ytm deploy

Deploy

Deploy compiled bundles to Cloudflare for global edge delivery.

ytm deploy [options]
Option Description Default
-e, --env <environment> Target environment (staging, production) staging
-m, --message <message> Deployment message -

Examples

# Deploy to production
ytm deploy -e production

# Deploy with message
ytm deploy -e production -m "Added TikTok pixel"

ytm deploy init

Deploy

Set up Cloudflare infrastructure (R2 bucket, Worker). Run once per project.

ytm deploy init [options]
Option Description Default
--account-id <id> Cloudflare Account ID interactive
--api-token <token> Cloudflare API Token interactive

Examples

# Interactive setup
ytm deploy init

ytm deploy versions

Deploy

List deployed versions for an environment.

ytm deploy versions [options]
Option Description Default
-e, --env <environment> Environment (staging, production) staging

ytm rollback

Deploy

Rollback to a specific previous version.

ytm rollback [version] [options]
Option Description Default
[version] Version to rollback to (e.g., v1.2.3) interactive
-e, --env <environment> Target environment staging

ytm status

Deploy

Show deployment status for all environments.

ytm status

Example Output

YourTM Status
─────────────
Container: YTM-MYSITE

Environment   Version   Deployed           Bundles
──────────────────────────────────────────────────
staging       v1.2.4    2 hours ago        4
production    v1.2.3    3 days ago         4

Testing Commands

ytm test

Test

Test tag firing on a URL using headless browser automation.

ytm test [url] [options]
Option Description Default
[url] URL to test -
--no-headless Run browser in headed mode false

Examples

# Test single URL
ytm test https://example.com

# Test with visible browser
ytm test https://example.com --no-headless

ytm monitor

Test

Real-time tag performance monitoring in your terminal.

ytm monitor [options]
Option Description Default
-m, --mode <mode> Monitor mode: preview or live preview

Examples

# Monitor in preview mode
ytm monitor

# Monitor production traffic
ytm monitor --mode live