macOS configuration backup and restore tool
Project description
MyConfig
A comprehensive macOS system configuration backup and restore tool.
๐ Features
- ๐ Complete Backup: Supports Homebrew, VS Code, dotfiles, system preferences, and more
- ๐ Secure & Reliable: Automatically skips sensitive files and validates backup integrity
- ๐ Preview Mode: Preview what will be backed up/restored before executing
- ๐ Progress Tracking: Real-time progress indicators and detailed status updates
- โ๏ธ Flexible Configuration: Multiple configuration profiles and customization options
- ๐ Extensible: Plugin system for extending functionality
- ๐ Self-Documenting: Auto-generated README.md for every backup with detailed manifests
- ๐๏ธ Compression Support: Create compressed archives for easy storage and sharing
- ๐จ Template System: Customizable file generation using professional templates
- ๐งช Comprehensive Testing: Unit and integration tests ensuring reliability
- ๐๏ธ Modern Architecture: Class-based design with proper separation of concerns
๐ Quick Start
Installation
Method 1: PyPI Installation (Recommended)
# Install from PyPI
pip install myconfig-osx
# Verify installation
myconfig --version
myconfig doctor
Method 2: Development Installation
# Clone the repository
git clone https://github.com/kehr/myconfig.git
cd myconfig
# Install in development mode
pip install -e .
# Verify installation
myconfig --version
myconfig doctor
Method 3: Direct Usage (No Installation)
# Clone the repository
git clone https://github.com/kehr/myconfig.git
cd myconfig
# Set execution permissions
chmod +x bin/myconfig
chmod +x scripts/install.sh
# Use directly
./bin/myconfig --help
# Or install from source
./scripts/install.sh
Basic Usage
After Installation:
# Export current system configuration
myconfig export
# Preview export contents
myconfig --preview export
# Restore configuration from backup
myconfig restore <backup-directory>
# System health check
myconfig doctor
Direct Usage:
# Export current system configuration
./bin/myconfig export
# Preview export contents
./bin/myconfig --preview export
# Restore configuration from backup
./bin/myconfig restore <backup-directory>
# System health check
./bin/myconfig doctor
๐ Documentation
Detailed documentation is available in the docs directory:
- Usage Guide - Comprehensive usage instructions and examples
- Configuration Reference - Configuration files and options
- Security Features - Security mechanisms and best practices
- Plugin Development - Plugin system and extension development
- Template System - Customizing output file templates
- Optimization History - Project optimization history
๐ง Main Commands
| Command | Description |
|---|---|
export [dir] |
Export configuration to specified directory |
export --compress [dir] |
Create compressed backup archive (.tar.gz) |
restore <dir> |
Restore configuration from backup directory |
unpack <archive> |
Unpack compressed backup archive |
doctor |
System environment check and diagnostics |
--preview |
Preview mode - show what will be processed |
--dry-run |
Test run mode - don't execute actual operations |
๐ก๏ธ Security Features
- Automatically skips sensitive files (SSH keys, password files, etc.)
- Backup integrity verification and validation
- Detailed operation logging
- Security-filtered dotfiles export
- Safe restoration with automatic backups of existing files
๐ Supported Components
- System Tools: Homebrew (auto-generates Brewfile), Mac App Store applications
- Development Environment: VS Code extensions, npm/pip packages
- Configuration Files: Shell configs, Git settings, editor configurations
- System Settings: macOS preferences (defaults domains)
- Services: LaunchAgents user services
๐ Project Structure
myconfig/
โโโ bin/myconfig # Executable script
โโโ config/ # Configuration files
โ โโโ config.toml # Main configuration file
โ โโโ defaults/ # defaults domain configurations
โ โโโ profiles/ # Configuration profiles
โโโ docs/ # Documentation
โโโ src/ # Python source package
โ โโโ core/ # Core modules (class-based architecture)
โ โ โโโ config.py # Configuration management
โ โ โโโ executor.py # Command execution
โ โ โโโ backup.py # Backup orchestration
โ โ โโโ components/ # Individual backup components
โ โโโ actions/ # Legacy action modules
โ โโโ templates/ # File generation templates
โ โโโ template_engine.py # Template processing engine
โ โโโ logger.py # Logging configuration
โ โโโ cli.py # Command line interface
โ โโโ utils.py # Utility functions
โโโ README.md # Project documentation
๐ New Features
๐ Auto-Generated Documentation
Every backup now includes a comprehensive README.md with:
- Detailed component analysis (package counts, file sizes, etc.)
- Export statistics and metadata
- Restore instructions and important notes
- Professional formatting with clear organization
๐๏ธ Compression Support
# Create compressed backup
myconfig export my-backup --compress
# Creates: my-backup.tar.gz
# Unpack compressed backup
myconfig unpack my-backup.tar.gz extracted-backup
# Restore from unpacked backup
myconfig restore extracted-backup
๐จ Template System
- Customizable file generation using templates
- Located in
src/templates/directory - Easy to modify without touching Python code
- Supports variables, conditionals, and loops
- Professional output formatting
๐๏ธ Uninstallation
If you need to uninstall MyConfig:
# Use uninstall script
./uninstall.sh
# Or use pip directly
pip3 uninstall myconfig
# Using Makefile
make uninstall
๐ ๏ธ Development
# Development mode installation (editable)
pip3 install -e .
# Code formatting
make format
# Code checking
make lint
# Build package
make build
# Clean up
make clean
๐ค Contributing
Issues and Pull Requests are welcome!
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Note: Run myconfig doctor (if installed) or ./bin/myconfig doctor (direct usage) to check your system environment before first use.
๐๏ธ Architecture
MyConfig uses a modern, class-based architecture:
- Modular Design: Each component (Homebrew, VS Code, etc.) is a separate module
- Abstract Base Classes: Consistent interface for all backup components
- Template Engine: Flexible file generation system
- Error Handling: Comprehensive error handling with graceful fallbacks
- Logging System: Centralized logging with configurable levels
- Configuration Management: TOML-based configuration with profiles
๐ Export Example
A typical backup contains:
- System environment information
- Homebrew configuration (Brewfile with 16 packages, 5 casks)
- VS Code extensions (55+ extensions)
- Configuration files (16MB+ compressed dotfiles)
- System preferences (15+ domains)
- LaunchAgents (8+ services)
- Auto-generated README.md with complete manifest
- Metadata files (MANIFEST.json, version info)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myconfig_osx-1.1.1.tar.gz.
File metadata
- Download URL: myconfig_osx-1.1.1.tar.gz
- Upload date:
- Size: 64.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49ff192d715681bbdf698f6f150616806ecfcfee6c030dece865822841852752
|
|
| MD5 |
08baa00a6c34f80f622fb22e4781a47e
|
|
| BLAKE2b-256 |
6d7248ad88833ca4292775ff64c74c7a999d80c37a5cc223c8253939233d3f81
|
File details
Details for the file myconfig_osx-1.1.1-py3-none-any.whl.
File metadata
- Download URL: myconfig_osx-1.1.1-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dbc97b2739bbb93809d48f18e463d3cc26b6d8a6e4f297181311f343af9c9b4
|
|
| MD5 |
422bee8b63818adc98612734d673413e
|
|
| BLAKE2b-256 |
0417f173adaf00f3465f7c4a6919071b034cf5b8b5e7728047f802726a226bd9
|