Development commands
Tools for working with markdown rules, managing adapters, and validating syntax.
Markdown commands overview
Important distinction:
- For authoring: Use fenced ```aligntrue blocks in your own markdown files
- For generated files: AlignTrue automatically uses HTML comment markers for round-trip fidelity
- To edit generated files: Use
aligntrue importto pull changes back to IR, not the md commands
Authoring workflow:
# My Rules
```aligntrue
id: my-rules
version: 1.0.0
spec_version: "1"
rules:
- id: style.naming
severity: warn
applies_to: ["**/*.ts"]
guidance: Use camelCase for functions
```Then use aligntrue md lint, aligntrue md compile, and aligntrue md format to work with these authored files.
Generated workflow:
# AGENTS.md
<!-- aligntrue:begin {"id":"style.naming"} -->
## Rule: style.naming
**ID:** style.naming
...
<!-- aligntrue:end -->To edit these files, use aligntrue import or edit directly and run aligntrue sync --accept-agent agents-md.
aligntrue adapters
Manage exporters (adapters) in your configuration. View, enable, and disable adapters for 43 supported AI coding agents.
Usage:
aligntrue adapters <subcommand>Subcommands:
list- Show all available adapters with install statusenable <adapter>- Enable an adapter in configenable --interactive- Choose adapters with multiselect UIdisable <adapter>- Disable an adapter in configdetect- Manually detect new agents in workspaceignore <adapter>- Add agent to ignored list (no detection prompts)
aligntrue adapters list
Show all 43 discovered adapters with their current install status.
Usage:
aligntrue adapters listStatus indicators:
✓Installed - Enabled in your.aligntrue/config.yaml-Available - Discovered but not enabled❌Invalid - In config but not found (shows warning, non-blocking)
Example output:
Available Adapters (44 total):
✓ cursor Export AlignTrue rules to Cursor .mdc format
Outputs: .cursor/rules/*.mdc
✓ agents-md Export AlignTrue rules to universal AGENTS.md format
Outputs: AGENTS.md
- claude-md Export AlignTrue rules to Claude CLAUDE.md format
Outputs: CLAUDE.md
- vscode-mcp Export AlignTrue rules to VS Code MCP configuration
Outputs: .vscode/mcp.json
- windsurf-mcp Export AlignTrue rules to Windsurf MCP configuration
Outputs: .windsurf/mcp_config.json
❌ nonexistent-adapter (Not found in available adapters)
Summary:
✓ Installed: 2
- Available: 41
❌ Invalid: 1Exit codes:
0- Success1- Config not found
aligntrue adapters enable
Enable one or more adapters by adding them to your config.
Single adapter:
aligntrue adapters enable <adapter>Interactive mode:
aligntrue adapters enable --interactive
# or
aligntrue adapters enable -iWhat it does:
- Validates adapter exists in discovered manifests
- Checks if already enabled (shows friendly message, exits 0)
- Adds to
config.exportersarray (sorted alphabetically) - Saves config atomically (temp + rename)
- Shows success message and next steps
Interactive mode features:
- Visual multiselect UI powered by @clack/prompts
- Pre-selects currently enabled adapters
- Toggle any available adapter
- Shows adapter descriptions and output paths
- Cancel-safe (Ctrl+C exits cleanly)
Examples:
# Enable a single adapter
aligntrue adapters enable claude-md
# Enable multiple adapters interactively
aligntrue adapters enable --interactive
# Already enabled (idempotent)
aligntrue adapters enable cursor
# Output: ✓ Adapter already enabled: cursorExample output:
✓ Enabled adapter: claude-md
Next step:
Run: aligntrue syncExit codes:
0- Success (or already enabled)1- Adapter not found, config error, or invalid adapter
aligntrue adapters disable
Disable an adapter by removing it from your config.
Usage:
aligntrue adapters disable <adapter>Safety features:
- Cannot disable last adapter (at least one must be configured)
- Validates adapter is currently enabled
- Shows clear error messages with actionable fixes
Examples:
# Disable an adapter
aligntrue adapters disable claude-md
# Cannot disable last adapter
aligntrue adapters disable cursor
# Error: Cannot disable last adapter
# At least one exporter must be configured
# Enable another adapter first: aligntrue adapters enable <adapter>
# Not enabled
aligntrue adapters disable nonexistent
# Error: Adapter not enabled: nonexistent
# Run: aligntrue adapters listExample output:
✓ Disabled adapter: claude-mdExit codes:
0- Success1- Adapter not enabled, last adapter, or config error
aligntrue adapters detect
Manually detect new agents in your workspace. Shows agents that have files present but are not yet in config and not on the ignored list.
Usage:
aligntrue adapters detectWhat it does:
- Scans workspace for agent-specific files (
.cursor/,AGENTS.md,.windsurf/, etc.) - Filters out agents already in config
- Filters out agents on the ignored list
- Displays new agents with their file paths
- Shows commands to enable or ignore each agent
Example output:
Detected 2 new agent(s):
- Windsurf
File: .windsurf/rules.md
- GitHub Copilot
File: AGENTS.md
To enable:
aligntrue adapters enable <agent-name>
To ignore:
aligntrue adapters ignore <agent-name>No new agents:
✓ No new agents detected
All detected agents are already enabled or ignored.Use case:
Run after installing a new AI coding agent to see if AlignTrue can export to it automatically.
Exit codes:
0- Success1- Config not found
aligntrue adapters ignore
Add an agent to the ignored list so it never triggers detection prompts during sync.
Usage:
aligntrue adapters ignore <agent>What it does:
- Validates config exists
- Checks if agent already ignored (shows message, exits 0)
- Adds agent to
detection.ignored_agentsarray in config - Saves config atomically
- Shows success message
Examples:
# Ignore an agent
aligntrue adapters ignore windsurf
# Already ignored
aligntrue adapters ignore windsurf
# Output: ✓ Agent already ignored: windsurfExample output:
✓ Added to ignored list: windsurf
This agent will no longer trigger prompts during sync.Config result:
detection:
ignored_agents:
- windsurfUse case:
Prevent prompts for agents you don’t use even though their files exist in your workspace.
Exit codes:
0- Success1- Missing agent name or config error
aligntrue md lint
Check markdown syntax in AGENTS.md or agent files.
Usage:
aligntrue md lint [file]What it validates:
- Fenced code blocks use
aligntruelanguage tag - One block per markdown section (no multiple blocks)
- Valid YAML inside fenced blocks
- Schema compliance for rules
Examples:
# Lint default rules file
aligntrue md lint
# Lint specific file
aligntrue md lint custom-rules.mdExit codes:
0- Valid markdown1- Syntax errors found2- File not found
aligntrue md format
Format markdown rules file with consistent style.
Usage:
aligntrue md format [file]What it does:
- Normalizes whitespace (tabs → spaces, trim trailing)
- Ensures consistent EOF newline
- Preserves guidance prose and structure
Examples:
# Format default rules file
aligntrue md format
# Format specific file
aligntrue md format custom-rules.mdaligntrue md compile
Compile markdown to intermediate representation (IR) for validation.
Usage:
aligntrue md compile [file]What it does:
- Extracts fenced
aligntrueblocks - Compiles to internal IR format
- Validates against schema
- Outputs JSON IR to stdout
Examples:
# Compile to IR
aligntrue md compile
# Compile and save to file
aligntrue md compile > rules.jsonaligntrue md generate
Generate markdown from YAML (round-trip workflow).
Usage:
aligntrue md generate <file> [--output <path>] [--preserve-style] [--canonical] [--header <text>]Flags:
--output, -o- Output file path (default: stdout)--preserve-style- Use_markdown_metaif present (default: true)--canonical- Force canonical formatting (ignore metadata)--header <text>- Custom header text
What it does:
- Reads YAML file (aligntrue.yaml or custom IR)
- Generates markdown with fenced
aligntrueblock - Preserves original formatting if metadata available
- Supports custom headers and indent styles
Examples:
# Generate markdown (stdout)
aligntrue md generate aligntrue.yaml
# Generate and save to file
aligntrue md generate aligntrue.yaml --output AGENTS.md
# Generate with custom header
aligntrue md generate aligntrue.yaml --header "## My Project Rules"
# Force canonical format (ignore metadata)
aligntrue md generate aligntrue.yaml --canonicalRound-trip workflow:
# Start with markdown
aligntrue md compile AGENTS.md --output aligntrue.yaml
# Edit YAML as needed
# Generate back to markdown
aligntrue md generate aligntrue.yaml --output AGENTS.md --preserve-styleOutput format:
# AlignTrue Rules
```aligntrue
id: my-rules
version: 1.0.0
spec_version: "1"
rules:
- id: testing.require.tests
severity: warn
applies_to: ["**/*.ts"]
```