Skip to main content

macOS configuration backup and restore tool

Project description

MyConfig

PyPI version Downloads License: GPL v2 Python 3.8+ macOS GitHub stars

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

๐Ÿš€ Quick Start

Installation Methods

Method 1: System Installation (Recommended)

# Clone the repository
git clone <repository-url>
cd myconfig

# Interactive installation
./install.sh

# Or direct user installation
./install.sh --user
# Or system installation (requires sudo)
./install.sh --system

# Using Makefile
make install-user    # User installation
make install-system  # System installation

Method 2: Direct Usage (No Installation Required)

# Clone the repository
git clone <repository-url>
cd myconfig

# Set execution permissions
chmod +x bin/myconfig

# Use directly
./bin/myconfig --help

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:

๐Ÿ”ง 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

myconfig_osx-1.0.0.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myconfig_osx-1.0.0-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

Details for the file myconfig_osx-1.0.0.tar.gz.

File metadata

  • Download URL: myconfig_osx-1.0.0.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for myconfig_osx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6859982ad2a8a9bb3114ee19dff1686d024361fc19a116ad73a143a4cbb65b5d
MD5 1d8a9434a8b67ad8931c13acf4010480
BLAKE2b-256 f3f8922e12ba36aee531f5c05135f5ad8b593e90720f1a17270fe35a27e4c535

See more details on using hashes here.

File details

Details for the file myconfig_osx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: myconfig_osx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for myconfig_osx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f5cf2cd61f46563006d1a447a4b9ae326d2e003c68c58e6c8cfb4dece9736b
MD5 55b216898b9b3d5de5617abeb938b868
BLAKE2b-256 a2eccbc514cb6e4dd3eed12bff23c901015f852ae6d2740c38b99022af1fa9d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page