Skip to Content

Core commands

The foundation of your AlignTrue workflow. These commands handle initialization, syncing, validation, and monitoring.

aligntrue init

Initialize AlignTrue in a project with smart detection of existing rules and agent files.

Usage:

aligntrue init [options]

Options:

FlagAliasDescriptionDefault
--non-interactive-nRun without prompts (uses defaults)false
--yes-ySame as —non-interactivefalse
--no-syncSkip automatic sync after initializationfalse
--modeOperating mode: solo or teamsolo
--exportersComma-separated list of exporters (skips interactive selection)Auto-detect
--sourceImport rules from git URL or local path (skips auto-detect)Auto-detect
--refGit ref (branch/tag/commit) for git sourcesmain

What it does:

  1. Detects existing rules in agent-specific folders (.cursor/, AGENTS.md, etc.)
  2. Prompts to import or create starter templates
  3. Handles duplicate/similar files with smart overlap detection
  4. Selects exporters (agents to export to)
  5. Creates .aligntrue/config.yaml and .aligntrue/rules/
  6. Auto-syncs to configured agents (unless --no-sync)

Examples:

# Interactive initialization with agent detection aligntrue init # Non-interactive with defaults aligntrue init --yes # Initialize with external rules (git) aligntrue init --source https://github.com/org/rules # Team mode with lockfile aligntrue init --mode team --yes

Example output:

✓ AlignTrue Init ✓ Agent detection complete (found Cursor, VS Code, Claude) ✓ Config created: .aligntrue/config.yaml ✓ Rules directory: .aligntrue/rules/ (5 rules) ✓ Syncing to 3 agents... ✓ Exported to: .cursor/rules/, AGENTS.md, CLAUDE.md AlignTrue initialized and synced Helpful commands: aligntrue sync Sync rules to your agents aligntrue exporters Manage agent formats aligntrue status Check sync health

Exit codes:

  • 0 - Success
  • 1 - User cancelled
  • 2 - System error (permissions, invalid config)

aligntrue sync

Sync rules from .aligntrue/rules/ to configured agents. This is your primary workflow command.

Usage:

aligntrue sync [options]

Options:

FlagAliasDescriptionDefault
--dry-runPreview changes without writing filesfalse
--forceForce overwrite files even with local changesfalse
--offlineOffline mode: use cache, no network callsfalse
--verbose-vShow detailed output and fidelity notesfalse
--verbose-vvFull verbosity (files, warnings, details)false
--quiet-qMinimal output (errors only)false
--jsonMachine-readable JSON outputfalse
--force-refreshBypass cache TTL for git sourcesfalse
--skip-update-checkSkip git source updates, use cache onlyfalse
--no-detectSkip agent detectionfalse
--auto-enableAuto-enable detected agents without promptingfalse
--config-cCustom config file path.aligntrue/config.yaml
--cleanRemove exported files with no matching rulefalse

What it does:

  1. Loads rules from .aligntrue/rules/ (your source of truth)
  2. Fetches any linked git sources (with caching)
  3. Builds internal representation (IR)
  4. Detects agents in workspace
  5. Exports rules to each configured agent format
  6. Creates backup before overwriting files
  7. Validates lockfile/bundle in team mode

Examples:

# Standard sync aligntrue sync # Preview changes before committing aligntrue sync --dry-run # Force overwrite (use carefully) aligntrue sync --force # Verbose output to see all files aligntrue sync --verbose # Full verbosity for debugging aligntrue sync -vv # Offline mode (no git updates) aligntrue sync --offline # JSON output for CI/scripting aligntrue sync --json # Sync with auto-enable for new agents aligntrue sync --auto-enable

Example output:

✓ AlignTrue Sync Syncing rules to 3 agents ✓ cursor .cursor/rules/ (5 files) ✓ agents AGENTS.md (1 file) ✓ claude CLAUDE.md (1 file) ✓ Sync complete (2 seconds) Rules: 5 Exported: 3 agents Backup: .aligntrue/.backups/sync-2025-01-15-14-32-00

Exit codes:

  • 0 - Success
  • 1 - Validation error (schema, lockfile drift)
  • 2 - System error (missing files, permissions)

See also: Automating sync for pre-commit hooks and editor integration


aligntrue check

Validate rules, configuration, and lockfile consistency. Use in CI/CD pipelines.

Usage:

aligntrue check [options]

Options:

FlagAliasDescriptionDefault
--config-cCustom config file path.aligntrue/config.yaml
--ciCI mode (disables interactive output)false
--jsonOutput validation results in JSON formatfalse

What it does:

  1. Validates config file exists and loads
  2. Validates all exporters are recognized
  3. Validates rules schema (markdown or YAML)
  4. Validates lockfile if team mode enabled
  5. Validates overlays (if present)
  6. Warns on file organization issues

Examples:

# Check rules locally aligntrue check # CI mode with JSON output aligntrue check --ci --json # Check with custom config aligntrue check --config ./config.yaml

Example output:

✓ Validation passed Schema: .aligntrue/rules/ is valid Lockfile: .aligntrue/lock.json matches current rules Overlays: 2 overlay(s) validated

Exit codes:

  • 0 - All validations passed
  • 1 - Validation error (schema, lockfile mismatch)
  • 2 - System error (missing files)

aligntrue status

Display current workspace health at a glance: mode, exporters, sync status, and rules count.

Usage:

aligntrue status [options]

Options:

FlagAliasDescriptionDefault
--config-cCustom config file path.aligntrue/config.yaml
--jsonOutput status summary in JSON formatfalse

What it shows:

  • Active mode (solo/team)
  • Configured exporters and detection status
  • Last sync timestamp
  • Rule files and counts
  • Lockfile/bundle status
  • Missing or unused agents

Examples:

# Show status aligntrue status # JSON output for scripting aligntrue status --json

Example output:

AlignTrue Status ================ Mode: SOLO Config: .aligntrue/config.yaml Last sync: Today at 2:34 PM (5 minutes ago) Exporters (3 configured): ✓ cursor Cursor ✓ agents AGENTS.md ✓ claude Claude Code Rules: Directory: .aligntrue/rules/ Files: 5 .md file(s) - global.md (global, 3 sections) - typescript.md (3 sections) - testing.md (3 sections) Lockfile: Status: disabled Bundle: Status: disabled

Exit codes:

  • 0 - Success
  • 1 - Config not found


aligntrue doctor

Run health checks to diagnose workspace issues and verify configuration.

Usage:

aligntrue doctor [options]

Options:

FlagAliasDescriptionDefault
--config-cCustom config file path.aligntrue/config.yaml
--jsonOutput doctor report in JSON formatfalse

Checks performed:

  • Config file presence and validity
  • Rules file presence and size
  • Lockfile presence (if team mode)
  • Bundle presence (if enabled)
  • Exporter outputs exist
  • Agent detection vs configuration
  • File permissions

Examples:

# Run health check aligntrue doctor # JSON output for automation aligntrue doctor --json # Diagnose specific config aligntrue doctor --config ./custom/config.yaml

Example output:

AlignTrue Health Check ✓ Config file (.aligntrue/config.yaml) ✓ Config valid (mode: solo) ✓ Rules file (.aligntrue/rules/) ✓ Exporter: cursor (.cursor/rules/ detected) ✓ Exporter: agents (AGENTS.md detected) ✓ Exporter: claude (CLAUDE.md detected) Checks: 6 ok, 0 warnings, 0 errors ✓ All systems go

Exit codes:

  • 0 - All checks passed
  • 1 - Warnings or errors found
  • 2 - System error (permissions, missing config)

See also: Status command for workspace overview


Quick reference

CommandPurposeWhen to use
initSet up AlignTrueFirst time setup
syncExport rules to agentsAfter editing rules
checkValidate rulesBefore committing
statusView workspace healthTroubleshooting
doctorRun diagnosticsTroubleshooting issues
Last updated on