This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a cross-platform dotfiles repository for setting up new computers and keeping settings synchronized across macOS, Windows, and Linux systems. Different platforms serve different purposes:
- macOS: Primary development environment
- Windows: Gaming-focused with minimal development setup
- Linux (Ubuntu): Development environment
uv run ruff check src/- Run comprehensive linting checksuv run ruff format src/- Format Python codeuv run ruff format --check src/- Check if formatting is neededuv run ruff check src/ --fix- Auto-fix linting issuesuv run mypy src/- Run strict type checkinguv run ruff check --watch src/- Run linting in watch mode
uv run src/main.py- Run all configuration modulesuv run src/main.py --module git- Run specific moduleuv run src/main.py --dry-run- Show what would be doneuv run src/main.py --list- List available modules
- macOS: Run
./install_mac.sh(requires default Apple Terminal) - Ubuntu: Run
./install_ubuntu.sh(uses Snap for applications) - Windows: Run
.\install_windows.ps1(gaming + minimal dev) - Other Debian-based: Run
./install_debian_base.sh(base functionality)
All scripts are idempotent and safe to run multiple times.
This is a cross-platform dotfiles repository that uses Python + uv for configuration setup. The main components are:
-
Installation Scripts: Platform-specific shell scripts that bootstrap the entire system
install_debian_base.sh: Shared functionality for Debian-based systems (sourced by Ubuntu script)install_ubuntu.sh: Ubuntu-specific (extends debian-base, uses Snap)install_mac.sh: macOS-specific (uses Homebrew)install_windows.ps1: Windows-specific (uses Winget/Scoop, gaming-focused)
-
Python Setup Modules: Located in
src/modules/directory, each handles specific configurationgit.py- Global git configuration setup (supportsGIT_USER_EMAILandGIT_USER_NAMEenv vars)zsh.py- Zsh configuration file symlinking (.zshrc, .zsh_aliases)starship.py- Terminal prompt configurationvscode.py- Settings and extension managementosx.py- macOS system defaults (Dock, Finder, etc.)windows.py- Windows system settings and preferencesterminal.py- GNOME Terminal and Alacritty configuration (Linux)mouse.py- Linux mouse settings via gsettings
-
Utilities:
src/utils/file_ops.pyprovides common functions for file operations, symlinks, and directory creation -
Configuration Files: Located in
config/directoryconfig/zsh/- Zsh configuration and aliasesconfig/vscode/- VSCode settings and extensionsconfig/starship/- Starship prompt configurationconfig/powershell/- PowerShell profiles for Windowsconfig/alacritty/- Alacritty terminal configurationconfig/osx/- macOS system defaults scriptconfig/windows/- Windows system configuration
- All setup scripts use
uv run src/main.pyto execute Python configuration - Configuration files are symlinked to their target locations using the
create_symlinkutility - Each platform installer handles package management and then runs Python configuration
- The system uses uv for Python dependency management and execution
- Cross-platform compatibility with graceful platform detection and error handling
- Platform-specific modules only run on their target platform (defined in
src/main.py) - All shell scripts use
set -e,set -u, andset -o pipefailfor robust error handling - NVM version is centralized in a variable at the top of install scripts
The src/main.py file defines which modules run on each platform:
- macOS: git, zsh, starship, vscode, osx
- Linux: git, zsh, starship, vscode, terminal, mouse
- Windows: git, starship, vscode, windows
This repository follows a strict separation between package installation and configuration management:
- Package installation: Installing applications, CLI tools, fonts, and system dependencies
- Package managers: Using platform-specific package managers (Homebrew, Scoop, apt, Winget, Snap, Flatpak)
- System setup: Creating directories, setting up shell environments, installing runtimes
- Examples: Installing VSCode, Chrome, Node.js, Nerd Fonts, Git, Python, gaming applications
- Configuration management: Setting up config files, preferences, and user settings
- Symlink management: Creating symlinks to dotfiles configurations
- User preferences: Git config, VSCode settings, terminal themes, shell prompts
- Cross-platform logic: Handling OS-specific configuration differences
- Examples: Git user.name/email, VSCode settings.json, starship.toml, terminal colors
- Clarity: Clear distinction between "installing software" vs "configuring software"
- Maintainability: Package installation logic stays in platform-native scripts
- Reliability: Package managers work best in their native environments
- Consistency: Configuration logic is unified across platforms in Python
- Testability: Configuration can be tested independently of package installation
- Fonts → Install scripts (they are packages/software)
- VSCode application → Install scripts (package installation)
- VSCode settings.json → Python modules (configuration)
- Git CLI tool → Install scripts (package installation)
- Git user config → Python modules (configuration, customizable via env vars)
- Gaming applications (Steam, Discord) → Install scripts (package installation)
- PowerShell profiles → Python modules (configuration via symlinks)
- Zsh configuration files → Python modules (symlinks via zsh.py module)
- Requires default Apple Terminal (not iTerm2, etc.) because the install script restarts terminals
- Uses Homebrew exclusively for package management
- Installs both development and productivity applications
- Applies system defaults via
config/osx/.defaultsscript
- Primary focus is gaming with minimal development setup
- Uses Winget for GUI applications and Scoop for CLI tools
- Installs gaming platforms: Steam, Epic Games, Ubisoft Connect, Logitech G Hub
- Minimal development tools: Git, VSCode, Node.js, Python, Rust
- PowerShell profiles configured for both 5.1 and 7+
- Uses Snap for applications (Chrome, VSCode)
- Combines apt, Homebrew, and Snap for comprehensive package coverage
- VSCode installed from Microsoft's official repository
install_debian_base.shprovides shared functionality for all Debian-based distros- Can be sourced by other scripts (Ubuntu) or run standalone
- Includes core package installation, Homebrew setup, NVM, and zsh configuration
To add a new configuration module:
- Create a new Python file in
src/modules/(e.g.,mymodule.py) - Implement an async
setup()function - Add the module to the platform list in
src/main.pyin theget_platform_modules()function - Create any necessary config files in
config/mymodule/ - Use utilities from
src/utils/file_ops.pyfor file operations
Example module structure:
async def setup():
"""Setup mymodule configuration."""
print("Setting up mymodule...")
# Your configuration logic hereThe git module sets up global git configuration. By default, it uses the repository owner's email and name, but you can override these using environment variables:
export GIT_USER_EMAIL="your.email@example.com"
export GIT_USER_NAME="Your Name"
uv run src/main.py --module gitOr set them permanently in your shell profile before running the install script.
- Edit the appropriate install script (e.g.,
install_mac.sh) - Add the package to the relevant package manager section
- Do NOT modify Python modules for package installation
- Add the config file to the appropriate
config/subdirectory - Create or modify a Python module in
src/modules/to symlink it - Use
create_symlink()fromsrc/utils/file_ops.py
- Use
uv run src/main.py --dry-runto see what would change - Use
uv run src/main.py --module <name>to test a specific module - Use
uv run src/main.py --listto see available modules