| Crates.io | mntn |
| lib.rs | mntn |
| version | 2.2.0 |
| created_at | 2025-05-22 19:09:48.667248+00 |
| updated_at | 2026-01-09 00:57:12.508022+00 |
| description | A Rust-based CLI tool for system maintenance. |
| homepage | https://github.com/trotelalexandre/mntn |
| repository | https://github.com/trotelalexandre/mntn |
| max_upload_size | |
| id | 1685523 |
| size | 418,480 |
A Rust-based CLI tool for system maintenance and dotfiles management with a profile-based architecture.

cargo install mntn
# Run the interactive setup wizard (recommended for new users)
mntn setup
# Or manually configure:
mntn backup # Create your first backup
mntn restore # Restore configurations from backup
mntn validate # Check configuration status
# After editing config files, save your changes:
mntn backup # Sync your changes to the backup
# Enable Touch ID for sudo (macOS only)
mntn biometric-sudo
# Sync with git repository
mntn sync --init --remote-url https://github.com/yourusername/dotfiles.git
mntn sync --sync
mntn supports macOS, Linux, and Windows with platform-specific features:
The setup command provides an interactive wizard for configuring mntn:
mntn setup
The wizard guides you through:
Example output:
Welcome to mntn interactive setup!
This wizard will help you configure your dotfiles management.
Profile Setup
Profiles let you maintain different configurations for different contexts
(e.g., 'work', 'personal', 'minimal', 'gaming')
? Create a profile now? Yes
? Profile name: work
✓ Profile: work
Legacy Files Detected
Found files in ~/.mntn/backup/ that aren't in the layered structure.
? Migrate legacy files to common/ layer? Yes
Setup Summary:
Profile: work
✓ Migrate legacy files to common/
✓ Run initial backup
? Proceed with setup? Yes
Setup complete!
Quick reference:
mntn backup - Backup your configurations
mntn restore - Restore configurations from backup
mntn use <name> - Switch to a different profile
mntn profile - List and manage profiles
mntn validate - Check configuration status
Remember: Run 'mntn backup' after editing config files!
mntn uses a profile-based architecture that simplifies configuration management by focusing on profiles rather than machines or environments. This makes it easy to switch between different setups on any computer and share configurations across devices.
~/.mntn/
├── backup/
│ ├── common/ # Shared across all profiles
│ │ ├── .zshrc
│ │ ├── .vimrc
│ │ └── config/
│ ├── profiles/
│ │ ├── work/ # Profile-specific configs
│ │ │ ├── .gitconfig
│ │ │ └── config/zed/settings.json
│ │ ├── personal/
│ │ │ └── .gitconfig
│ │ └── gaming/
│ │ └── .zshrc
│ └── packages/ # Package lists
│ ├── brew.txt
│ └── npm.txt
├── profile.json # Profile definitions
├── .active-profile # Currently active profile
├── configs_registry.json # Tracked config files
└── package_registry.json # Package managers to backup
When restoring, mntn resolves sources in this order (highest priority first):
profiles/<profile-name>/) - Profile-specific (if active)common/) - Shared across all profilesbackup/) - Backwards compatibilityExample: If you have:
common/.zshrc - Base shell configprofiles/work/.zshrc - Work-specific shell configWith profile work active, the work version is used. Without an active profile, the common version is used.
# List all profiles and show current
mntn profile
# Create a new profile
mntn profile create work --description "Work laptop configuration"
# List all profiles
mntn profile list
# Delete a profile
mntn profile delete old-profile
Profile Examples:
work - Work-specific configurations (corporate git, work-specific tools)personal - Personal machine configurationsminimal - Minimal setup for servers or lightweight environmentsgaming - Gaming-focused configuration with different shell aliasespresentation - Clean setup for presentations or demos# Switch to a profile
mntn use work
# View current profile and available profiles
mntn profile
# Switch back to common only (no profile)
mntn use common
Note: After switching profiles, run mntn restore to apply the profile's configurations.
mntn uses a copy-based approach for managing dotfiles. This means:
mntn backup to sync# Backup to active profile (or common if no profile is active)
mntn backup
# Backup to a specific profile
mntn backup --profile work
# Preview what would be backed up
mntn backup --dry-run
What gets backed up:
backup/packages/)# Restore using active profile
mntn restore
# Preview what would be restored
mntn restore --dry-run
Restore uses layer resolution to find the best source for each config file.
The recommended workflow with mntn is:
~/.zshrc)mntn backupcd ~/.mntn && git add . && git commit -m "Update configs"git pushOn another machine:
cd ~/.mntn && git pull (or mntn sync --pull)mntn restoreThe migrate command moves files from the legacy location (flat backup directory) to the layered structure:
# Preview what would be migrated
mntn migrate --dry-run
# Migrate legacy files to common layer
mntn migrate
When to migrate:
~/.mntn/backup/ that aren't in common/ or profiles/What it does:
backup/ to backup/common/# Create your first backup
mntn backup
# Initialize git repository
cd ~/.mntn
git init
git remote add origin https://github.com/yourusername/dotfiles.git
# Commit everything
git add .
git commit -m "Initial mntn setup"
git push -u origin main
~/.mntn/ # Git repository root
├── .git/
├── .gitignore # Excludes mntn.log
├── profile.json # Profile definitions (versioned)
├── .active-profile # Current profile (may want to .gitignore)
├── configs_registry.json # Configuration registry
├── package_registry.json # Package manager registry
└── backup/
├── common/ # Shared configs
└── profiles/ # Profile-specific configs
Tip: Add .active-profile to .gitignore if you want each machine to maintain its own active profile.
# Install mntn
cargo install mntn
# Clone your configurations
git clone https://github.com/yourusername/dotfiles.git ~/.mntn
# Run setup wizard or manually switch profile
mntn setup
# or
mntn use work
# Restore configurations
mntn restore
# Initialize new repository
mntn sync --init --remote-url https://github.com/yourusername/dotfiles.git
# Pull latest changes
mntn sync --pull
# Push local changes
mntn sync --push --message "Update configs"
# Bidirectional sync
mntn sync --sync
# Auto-restore after pull
mntn sync --pull --auto-restore
The validate command checks your configuration status:
mntn validate
What it validates:
Example output:
Validating configuration...
Profile: profile=work
Registry Files OK
Layer Resolution OK
JSON Configuration Files OK
Legacy Symlink Check OK
File Mismatch Check OK
Validation complete: 0 error(s), 0 warning(s)
File Mismatch Validation:
The validator automatically compares your current filesystem files with their backed-up versions in ~/.mntn/backup/. This helps you:
Example with mismatches:
Validating configuration...
Profile: profile=work
Registry Files OK
Layer Resolution OK
JSON Configuration Files OK
Legacy Symlink Check OK
File Mismatch Check
! VSCode Settings (vscode_settings): File differs from backup
Fix: Run 'mntn backup' to update backup or 'mntn restore' to restore from backup
! SSH Config (ssh_config): Encrypted file differs from backup
Fix: Run 'mntn backup' to update backup or 'mntn restore' to restore from backup
Validation complete: 0 error(s), 2 warning(s)
Note: If you enter an incorrect password for encrypted files, the validator will skip encrypted file validation and show a warning.
# List all package managers
mntn registry-packages list
# List platform-compatible entries
mntn registry-packages list --platform-only
# Add custom package manager
mntn registry-packages add pipx \
--name "pipx Applications" \
--command "pipx" \
--args "list" \
--output-file "pipx.txt"
# Enable/disable entries
mntn registry-packages toggle pip --enable
# List all entries
mntn registry-configs list
# Add new entry
mntn registry-configs add my_config \
--name "My Config" \
--source "myapp/config.json" \
--target "/Users/alex/.config/myapp/config.json"
# Enable/disable entries
mntn registry-configs toggle my_config --enable
The encrypted registry provides secure backup and restore for sensitive configuration files like SSH keys and credentials. Files are encrypted using password-based encryption before being backed up.
# List all encrypted entries
mntn registry-encrypted list
# List only enabled entries
mntn registry-encrypted list --enabled-only
# Add new encrypted entry
mntn registry-encrypted add ssh_github_key \
--name "GitHub SSH Key" \
--source "ssh/id_github" \
--target "~/.ssh/id_github" \
--description "GitHub-specific SSH key" \
--encrypt-filename
# Remove an entry
mntn registry-encrypted remove ssh_github_key
# Enable/disable entries
mntn registry-encrypted toggle ssh_config --enable
# Preview changes
mntn registry-encrypted add my_secret --name "Secret" \
--source "secrets/my.key" --target "~/.config/secret.key" \
--dry-run
Encryption Features:
backup and restore commands--skip-encrypted flag to skip encrypted backups/restoresDefault Encrypted Entries:
ssh_config - SSH client configuration file (~/.ssh/config)ssh_private_key - SSH Ed25519 private key (~/.ssh/id_ed25519)Backup Workflow with Encryption:
# Backup with encryption (will prompt for password)
mntn backup
# Backup without encrypted files
mntn backup --skip-encrypted
# Restore with decryption (will prompt for password)
mntn restore
# Restore without encrypted files
mntn restore --skip-encrypted
Storage Structure:
Encrypted files are stored in a separate encrypted/ directory within your backup:
~/.mntn/backup/
├── common/
│ └── encrypted/
│ └── ssh/
│ ├── config.age
│ └── [hash].age # Encrypted filename
└── profiles/
└── work/
└── encrypted/
└── ssh/
└── config.age
# Install hourly backup task
mntn install
# Include daily cleaning
mntn install --with-clean
# Preview what would be installed
mntn install --dry-run
# Clean user-level files
mntn clean
# Include system files (requires sudo)
mntn clean --system
# Preview what would be cleaned
mntn clean --dry-run
# Remove unused user services
mntn purge
# Include system services
mntn purge --system
# Preview what would be removed
mntn purge --dry-run
mntn biometric-sudo
Enables Touch ID authentication for sudo commands.
~/.mntn/ directory exists and is writablemntn profile.mntn backup after editing config files to sync changesmntn use and layer priority with mntn validatemntn registry-configs addcommon/ or profiles/ are skippedmntn migrate to convert symlinks to real filesmntn sync --init --remote-url <URL>~/.mntn using standard git commandsmntn profile listmntn profile create <name>mntn use <other-profile>mntn migrate to update structuremntn backup or mntn migrate to convert to real filesMIT