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
| Option | Description |
|---|---|
--dry-run | Preview changes without making them |
--non-interactive, -y | Run without prompts (use with export/source flags) |
--convert-exports | Convert exports to editable (remove READ-ONLY markers) |
--delete-exports | Delete all exported agent files |
--keep-exports | Keep exports as-is (skip) |
--delete-source | Delete .aligntrue/ directory |
--keep-source | Keep .aligntrue/ directory |
--help | Show help message |
Interactive mode
By default, aligntrue uninstall runs interactively, guiding you through the removal process:
aligntrue uninstallYou’ll be prompted to choose:
-
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
-
What to do with source rules:
- Keep (recommended): Preserves your
.aligntrue/directory for future reference - Delete: Removes the entire
.aligntrue/directory
- Keep (recommended): Preserves your
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-exportsDefaults 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 rulesAGENTS.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 uninstallWalks you through the options with a preview before confirming.
Preview changes
aligntrue uninstall --dry-runShows what would be changed without making any modifications.
CI/scripting: convert and keep source
aligntrue uninstall -y --convert-exports --keep-sourceConverts exported files to editable and keeps your source rules.
Full removal
aligntrue uninstall -y --delete-exports --delete-sourceRemoves all AlignTrue files and exported agent files.
Keep everything as-is except cleanup gitignore
aligntrue uninstall -y --keep-exports --keep-sourceOnly removes gitignore entries and lockfile (if present).
After uninstalling
After running uninstall:
-
If you converted exports: Your agent files are now editable. You can modify them directly without AlignTrue.
-
If you kept source rules: Your rules in
.aligntrue/rules/are still available for reference or manual copying. -
Re-installing later: Run
aligntrue initto 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 uninstallagain to complete the process - Restore from backup and start over
See also
- Backup and restore - Backup management
- Getting started - Re-installing AlignTrue