Skip to Content

Uninstall

Remove AlignTrue from a project with options to convert or delete exported files.

Overview

The aligntrue uninstall command provides a clean way to remove AlignTrue from a project. It offers interactive prompts for what to keep or remove, and always creates a safety backup before making changes.

Usage

aligntrue uninstall [options]

Options

OptionDescription
--dry-runPreview changes without making them
--non-interactive, -yRun without prompts (use with export/source flags)
--convert-exportsConvert exports to editable (remove READ-ONLY markers)
--delete-exportsDelete all exported agent files
--keep-exportsKeep exports as-is (skip)
--delete-sourceDelete .aligntrue/ directory
--keep-sourceKeep .aligntrue/ directory
--helpShow help message

Interactive mode

By default, aligntrue uninstall runs interactively, guiding you through the removal process:

aligntrue uninstall

You’ll be prompted to choose:

  1. What to do with exported agent files:

    • Convert to editable (recommended): Removes READ-ONLY markers so you can continue editing files manually
    • Delete completely: Removes all exported files
    • Skip: Leaves files as-is with READ-ONLY markers
  2. What to do with source rules:

    • Keep (recommended): Preserves your .aligntrue/ directory for future reference
    • Delete: Removes the entire .aligntrue/ directory

A preview is shown before confirming any changes.

Non-interactive mode

For scripts and CI, use the -y flag with explicit export/source flags:

# Convert exports to editable, keep source rules aligntrue uninstall -y --convert-exports --keep-source # Full removal - delete everything aligntrue uninstall -y --delete-exports --delete-source # Preview without changes aligntrue uninstall --dry-run -y --convert-exports

Defaults in non-interactive mode

When using -y without specifying flags:

  • Exports: --convert-exports (default)
  • Source: --keep-source (default)

What gets removed

Exported agent files

Files created by AlignTrue exporters, which may include:

  • .cursor/rules/*.mdc - Cursor rules
  • AGENTS.md - Claude, Copilot, Aider rules
  • .clinerules/ - Cline rules
  • .augment/rules/ - AugmentCode rules
  • .openhands/microagents/ - OpenHands rules
  • .mcp.json - Root MCP configuration
  • Various other agent-specific files

AlignTrue configuration

  • .aligntrue/config.yaml - Configuration file
  • .aligntrue/rules/ - Source rule files
  • .aligntrue/.cache/ - Git source cache
  • .aligntrue/.backups/ - Local backups (kept for recovery)

Lockfile

  • .aligntrue/lock.json - Always deleted if present

Gitignore entries

AlignTrue-managed sections in .gitignore are removed:

  • # START AlignTrue Generated Files# END AlignTrue Generated Files
  • # START AlignTrue Gitignored Rules# END AlignTrue Gitignored Rules

READ-ONLY marker conversion

When you choose “Convert to editable”, the READ-ONLY marker block is removed from exported files:

Before:

<!-- READ-ONLY: This file is auto-generated by AlignTrue. DO NOT EDIT DIRECTLY. Changes will be overwritten. Edit rules in .aligntrue/rules/ instead. --> # My rule Content here...

After:

# My rule Content here...

The content is preserved, only the marker is removed.

Safety backup

A backup is always created before any changes are made. If something goes wrong, you can restore:

# List available backups aligntrue backup list # Restore the most recent backup aligntrue backup restore # Restore a specific backup aligntrue backup restore --timestamp <backup-id>

The backup timestamp is shown in the uninstall output.

Examples

Interactive uninstall

aligntrue uninstall

Walks you through the options with a preview before confirming.

Preview changes

aligntrue uninstall --dry-run

Shows what would be changed without making any modifications.

CI/scripting: convert and keep source

aligntrue uninstall -y --convert-exports --keep-source

Converts exported files to editable and keeps your source rules.

Full removal

aligntrue uninstall -y --delete-exports --delete-source

Removes all AlignTrue files and exported agent files.

Keep everything as-is except cleanup gitignore

aligntrue uninstall -y --keep-exports --keep-source

Only removes gitignore entries and lockfile (if present).

After uninstalling

After running uninstall:

  1. If you converted exports: Your agent files are now editable. You can modify them directly without AlignTrue.

  2. If you kept source rules: Your rules in .aligntrue/rules/ are still available for reference or manual copying.

  3. Re-installing later: Run aligntrue init to set up AlignTrue again. Your backup is available if you need to restore previous configuration.

Troubleshooting

Cannot delete files

If uninstall fails to delete some files, check:

  • File permissions
  • Files open in other applications
  • Files locked by version control

You can manually delete remaining files after addressing the issue.

Want to undo uninstall

Use the backup created during uninstall:

aligntrue backup restore --timestamp <backup-id>

This restores your .aligntrue/ directory. You’ll need to run aligntrue sync to regenerate exports.

Partial uninstall

If uninstall was interrupted, you may have a partial state. Either:

  • Run aligntrue uninstall again to complete the process
  • Restore from backup and start over

See also

Last updated on