Cross-platform dotfiles automation with Python
Project description
dotfiles ๐
Cross-platform dotfiles automation for macOS and Windows, powered by Python.
Manage your development environment configurations with a single repository. Install once, sync everywhere.
Features
- ๐ Pure Python: No shell script complexityโclean, typed Python code
- ๐ Cross-Platform: Supports macOS (Homebrew), Windows (winget), and Linux (apt)
- ๐ฆ Package Management: Automated installation and updates for all development tools
- ๐ Smart Symlinks: Idempotent symlink creation with backup support
- ๐ ๏ธ Multi-Language Support: Rust, Python, Go, JavaScript/TypeScript, C/C++, Java
- โก Tool Updates: One command to update everything (brew, cargo, uv, bun, npm, etc.)
- ๐ Configuration Detection: Automatically detects and preserves existing configs
Supported Tools
Package Managers
- macOS: Homebrew (
brew) - Windows: Windows Package Manager (
winget) - Linux: APT (
apt-get)
Development Tools
- Python:
uv(package manager), Python 3.10/3.11/3.12 - Rust:
rustup,cargo - JavaScript/TypeScript:
bun,nvm(Node version manager) - Go:
go - C/C++: LLVM, clang, gcc
Shell & Terminal
- Shell:
zsh,bash - Prompt:
starship - Multiplexer:
tmux - Utilities:
jq,ripgrep,fd,bat,eza,tldr
Quick Start
Bootstrap Instructions
macOS & Linux
-
Install UV (Python package manager):
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install Python 3.12 (system version):
uv python install --python-preference only-system 3.12
-
Clone and install dotfiles:
git clone https://github.com/carlosferreyra/dotfiles.git ~/.dotfiles cd ~/.dotfiles dotfiles install
Or use
uv run dotfiles installif you prefer to run locally before installation.
Windows (PowerShell)
-
Install Git (required on Windows):
winget install Git.Git
Or download from: https://git-scm.com/download/win
-
Install UV:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install Python 3.12 (system version):
uv python install --python-preference only-system 3.12
-
Clone and install dotfiles:
git clone https://github.com/carlosferreyra/dotfiles.git $env:USERPROFILE\.dotfiles cd $env:USERPROFILE\.dotfiles dotfiles install
Usage
The dotfiles CLI provides a unified interface for all operations. You can run it directly if
installed, or use uvx to run it without installation:
Running the CLI
Local installation (after dotfiles install):
dotfiles [COMMAND] [OPTIONS]
From GitHub with uvx (no installation needed):
uvx git+https://github.com/carlosferreyra/dotfiles -- [COMMAND] [OPTIONS]
Available Commands
install- Install and configure dotfiles for your systemupdate- Update dotfiles, system packages, and development toolsverify- Verify all dotfiles symlinks are correctly set upconfig- Show current dotfiles configuration and system informationbackup- Manage dotfiles backups (list/restore)
Examples
Installation
Full installation with all system packages:
dotfiles install
Skip package manager updates (faster):
dotfiles install --no-packages
Overwrite existing configurations:
dotfiles install --force
Preview changes without executing:
dotfiles install --dry-run
Updates
Update everything (system packages + tools):
dotfiles update
Update only development tools (skip system packages):
dotfiles update --tools-only
Preview updates without executing:
dotfiles update --dry-run
Verification
Check if all symlinks are correctly set up:
dotfiles verify
Configuration
View current system configuration and managed files:
dotfiles config
Backups
List all existing backups:
dotfiles backup --list
Restore from backups (interactive):
dotfiles backup --restore
Configuration
Project Structure
dotfiles/
โโโ install.py # Main installation script
โโโ update.py # Tool and package updater
โโโ pyproject.toml # Python project config
โโโ config/ # Configuration files
โ โโโ zsh/
โ โ โโโ .zshrc # Main zsh config
โ โ โโโ .zshenv # Zsh environment variables
โ โ โโโ .zprofile # Zsh profile
โ โ โโโ config/ # Modular zsh configs
โ โ โโโ 00_environment.zsh
โ โ โโโ 01_plugins.zsh
โ โ โโโ 02_options.zsh
โ โ โโโ 03_aliases.zsh
โ โ โโโ 04_functions.zsh
โ โ โโโ 05_completions.zsh
โ โ โโโ 06_init.zsh
โ โโโ git/
โ โ โโโ .gitconfig
โ โ โโโ .gitignore_global
โ โโโ shell/
โ โโโ starship.toml
โโโ manifests/
โ โโโ links.json # Symlink configuration
โ โโโ Brewfile # macOS packages
โ โโโ packages.json # Windows packages
โโโ src/dotfiles/
โโโ __init__.py
โโโ helpers.py # Cross-platform utilities
โโโ config_manager.py # Symlink management
โโโ package_manager.py # Package installation
Symlink Manifest
The manifests/links.json defines which files get symlinked:
{
"config/zsh/.zshrc": "~/.zshrc",
"config/zsh/.zshenv": "~/.zshenv",
"config/git/.gitconfig": "~/.gitconfig"
}
Add new symlinks by adding entries to this JSON file.
Brewfile (macOS)
The manifests/Brewfile lists all macOS packages. Customize by editing:
# Edit Brewfile
code manifests/Brewfile
# Install/sync packages
brew bundle --file=manifests/Brewfile
Packages (Windows)
Windows package configuration is in manifests/packages.json (WIP).
Platform-Specific Configuration
Some configurations are OS-specific. The scripts handle this automatically:
- macOS: Uses Homebrew,
.zprofilefor shell init, GPG keychain - Windows: Uses winget, PowerShell profile, GPG4Win (placeholder)
- Linux: Uses apt, standard
.bashrc/.zshrc`, system GPG
Customization
Adding New Dotfiles
- Copy the file to
config/<category>/ - Add entry to
manifests/links.json - Run
uv run install.py --force
Adding New Tools
macOS:
# Edit Brewfile
code manifests/Brewfile
# Add package and run
uv run install.py
Windows:
// Edit manifests/packages.json
{
"packages": ["Git.Git", "JetBrains.Toolbox", "golang.Go"]
}
Python Version
This repo requires Python 3.12+ (set in pyproject.toml). To use a different version:
uv python install 3.13
uv run install.py
What Gets Installed
System Packages (Brewfile on macOS)
- Git, Zsh, Starship, Tmux
- Python 3.10/3.11/3.12, UV, Pipx
- Rustup, Go, LLVM, Make, CMake
- Utilities: jq, ripgrep, fd, bat, eza, tldr
- Optional: Docker, PostgreSQL
Development Tools
- UV self-updates and tool upgrades
- Rust/Cargo tool updates
- Bun upgrades
- npm global updates
Troubleshooting
UV not found after installation
# Ensure UV is in PATH
export PATH="$HOME/.cargo/bin:$PATH"
source ~/.zshrc
Symlink creation failed
# Check existing config
ls -la ~/.zshrc
# Use --force to overwrite
uv run install.py --force
# Or manually remove and retry
rm ~/.zshrc
uv run install.py
Homebrew not found (macOS)
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
winget not found (Windows)
Windows Package Manager comes with Windows 11+. For Windows 10, install from: https://github.com/microsoft/winget-cli
Backup & Recovery
The installer automatically backs up existing configurations with .backup extension:
~/.zshrc.backup(if.zshrcalready exists)~/.gitconfig.backup(if.gitconfigalready exists)
To restore:
mv ~/.zshrc.backup ~/.zshrc
Architecture
Design Principles
- Pure Python: No bash dependenciesโsingle language across platforms
- Cross-Platform:
platform.system()and conditional logic handle OS differences - Idempotent: Safe to re-run
install.pymultiple times - Modular: Each tool/feature in separate Python modules
- Declarative: Configuration in JSON manifests, not code
Key Modules
helpers.py: Cross-platform utilities (run_command, safe_symlink, etc.)config_manager.py: Symlink creation and verificationpackage_manager.py: Abstracts brew/winget/apt
Future Enhancements
- Windows package manifest (packages.json)
- GPG4Win setup wizard for Windows
- SSH config template with security best practices
- VSCode profile integration (if sync is disabled)
- Pre-commit hooks automation
- Custom functions/aliases installer
- Automated config backup to cloud storage
Contributing
This is a personal dotfiles repo, but if you have improvements:
- Fork the repository
- Create a branch for your feature
- Ensure Python 3.12+ compatibility
- Submit a pull request
License
MIT License - see LICENSE file for details
Resources
- UV Documentation: https://docs.astral.sh/uv/
- Homebrew: https://brew.sh
- Starship Prompt: https://starship.rs
- Dotfiles Community: https://dotfiles.github.io
Made with โค๏ธ by Carlos Ferreyra
Last updated: January 2026
Project details
Release history Release notifications | RSS feed
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 dfiles-0.1.0.tar.gz.
File metadata
- Download URL: dfiles-0.1.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34ed6874987538df074a3cc3bd484be188a97867fa02dd9206715aa608d0e926
|
|
| MD5 |
f9abc7e4e1810cf3d395fe39d512ea10
|
|
| BLAKE2b-256 |
667deee809907aa8a326e88f75d112059024c94b5b2853c8531f2f54e0f3767f
|
Provenance
The following attestation bundles were made for dfiles-0.1.0.tar.gz:
Publisher:
publish.yml on carlosferreyra/dotfiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dfiles-0.1.0.tar.gz -
Subject digest:
34ed6874987538df074a3cc3bd484be188a97867fa02dd9206715aa608d0e926 - Sigstore transparency entry: 805055120
- Sigstore integration time:
-
Permalink:
carlosferreyra/dotfiles@c713f95227336e57ae558fc266140823716bd2d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/carlosferreyra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c713f95227336e57ae558fc266140823716bd2d0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dfiles-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dfiles-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24a4633c5c185f9f4601ccd7f9f3fd5676eb8298f90be9ebfae0458570afa6e8
|
|
| MD5 |
9b8621a9cc814cd6eedbc4832b3eccb2
|
|
| BLAKE2b-256 |
595c1eb5b49e7846a2955515dad1525bc6f96f940a1693351c11cad03131b818
|
Provenance
The following attestation bundles were made for dfiles-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on carlosferreyra/dotfiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dfiles-0.1.0-py3-none-any.whl -
Subject digest:
24a4633c5c185f9f4601ccd7f9f3fd5676eb8298f90be9ebfae0458570afa6e8 - Sigstore transparency entry: 805055124
- Sigstore integration time:
-
Permalink:
carlosferreyra/dotfiles@c713f95227336e57ae558fc266140823716bd2d0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/carlosferreyra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c713f95227336e57ae558fc266140823716bd2d0 -
Trigger Event:
workflow_dispatch
-
Statement type: