Skip to content

CLI Reference

The Cortex TMS CLI is the primary tool for managing your TMS projects. Use it to initialize projects, validate documentation health, check project status, and more.

Terminal window
# Install globally
npm install -g cortex-tms@latest
# Or use with npx (no installation)
npx cortex-tms@latest <command>
Terminal window
cortex-tms [command] [options]
cortex-tms --help # Show help for all commands
cortex-tms --version # Show current version

init

Initialize Cortex TMS in your project

Sets up the complete TMS documentation structure with interactive prompts.

View init documentation

validate

Validate project health and compliance

Runs comprehensive health checks to ensure documentation follows TMS standards.

View validate documentation

status

Show project health dashboard

Displays a high-level overview of scope, sprint progress, health summary, and backlog.

View status documentation

migrate

Upgrade TMS files to current version

Safely updates template files while preserving customizations.

View migrate documentation

prompt

Access AI prompt templates

Provides quick access to project-aware AI prompts with clipboard integration.

View prompt documentation

review

Guardian: Pattern validation

AI-powered code review against project patterns and domain logic.

View review documentation

dashboard

Interactive terminal dashboard

Real-time governance health UI with tab navigation — file tiers, staleness, sprint progress, and validation in one view.

View dashboard documentation

hooks

Manage git hooks

Install pre-commit hooks for automatic documentation validation before every commit.

View hooks documentation


All commands support these global options:

OptionDescription
-h, --helpShow help for the command
-V, --versionShow CLI version

CommandPurposeCommon Usage
initInitialize TMS in projectcortex-tms init
validateCheck project healthcortex-tms validate --strict
statusText health summarycortex-tms status
dashboardInteractive terminal UIcortex-tms dashboard --live
auto-tierAuto-assign tiers via git historycortex-tms auto-tier --dry-run
migrateUpgrade templatescortex-tms migrate --apply
promptGet AI promptscortex-tms prompt init-session
reviewValidate code against patternscortex-tms review src/file.ts
tutorialLearn Cortex TMScortex-tms tutorial
hooksGit hook management (v4.1+)cortex-tms hooks install

All commands follow standard Unix exit code conventions:

CodeMeaning
0Success - command completed without errors
1Failure - command encountered errors

Terminal window
# 1. Initialize project
cortex-tms init
# 2. Verify setup
cortex-tms validate
# 3. Check status
cortex-tms status
Terminal window
# 1. Get AI session prompt
cortex-tms prompt init-session
# 2. Work on tasks in NEXT-TASKS.md
# 3. Validate before committing
cortex-tms validate --strict
Terminal window
# 1. Check for updates
cortex-tms migrate
# 2. Apply upgrades
cortex-tms migrate --apply
# 3. Verify changes
cortex-tms validate

Cortex TMS CLI respects these environment variables:

VariableDescriptionDefault
NO_COLORDisable colored outputNot set
CIIndicates CI/CD environmentNot set

The CLI uses .cortexrc in your project root for configuration:

{
"version": "1.0.0",
"scope": "standard",
"projectName": "my-project",
"metadata": {
"createdAt": "2026-01-19T10:00:00.000Z",
"customFiles": []
}
}

This file is automatically created by cortex-tms init and updated by other commands.


Explore individual command documentation: