A fully automated dotfiles repository that sets up a complete development environment in minutes. This repository manages application installation, configuration files, and environment setup with intelligent cross-platform support.
- β‘ Fast Setup: Get a fully configured dev environment in minutes, not hours
- π Cross-Platform: Full support for macOS and Ubuntu with intelligent platform detection
- π¦ Homebrew-Based: Uses Homebrew for all package management, making upgrades and uninstalls simple
- π Symlink Management: Configuration files are symlinked, allowing easy updates via git
- π― Platform-Aware: Automatically skips incompatible packages (e.g., colima on Ubuntu, GUI apps on servers)
CLI Tools (Both macOS & Ubuntu):
- Version Control: git, git-lfs, gh (GitHub CLI)
- Shell: zsh with completions and syntax highlighting
- Languages & Runtimes: fnm (Node.js), uv (Python)
- Containers: docker, docker-compose, kubectl, kustomize, k3d
- Infrastructure: terraform
- Cloud: awscli
- Utilities: starship (prompt), direnv, jq, yq, bat
macOS-Specific CLI:
- colima (container runtime)
- macmon (system monitoring)
GUI Applications (macOS only):
- Browser: Brave Browser
- IDE: Visual Studio Code, Antigravity, Zed
- Cloud: gcloud-cli
- AI Tools: ChatGPT, LM Studio, AnythingLLM
- Microsoft Office: Word, Excel, PowerPoint
- Utilities: Cloudflare WARP, Rectangle, Keka, Kap, IINA, Motrix, UTM
The following tools are automatically configured via symlinks:
-
Zsh (
.zshrc,.zsh_aliases)- Starship prompt theme
- oh-my-zsh with plugins (git, gh, fnm, npm, uv, docker, kubectl, terraform, direnv)
- Platform-specific Homebrew initialization
- fnm auto-switching on directory change
-
Git (
.gitconfig,.gitignore_global)- SSH-based GPG signing
- Auto-setup remote branches on push
- Case-sensitive file handling
- Commit/tag signing enabled
- Branch sorting by commit date
-
SSH (
~/.ssh/config)- Automatic SSH key generation (ed25519)
- Dual SSH key support for multiple SSH accounts
-
GitHub CLI (
~/.config/gh/)- Pre-configured gh settings
-
Docker (
~/.docker/config.json)- Custom Docker daemon settings
-
Starship (
~/.config/starship.toml)- Cross-shell prompt configuration
- macOS: Xcode Command Line Tools (installed automatically)
- Ubuntu: curl, git, and build-essential (installed automatically)
Clone the repository and run the installation script:
git clone https://github.com/phatpham9/dotfiles.git
cd dotfiles
./install.shThe installation script will:
- Request sudo password (required for system-level changes)
- Install Homebrew (if not already installed)
- Install all applications from
apps/cli/Brewfile(andapps/gui/Brewfileon macOS) - Create symlinks for all configuration files
- Generate SSH keys (if they don't exist)
Platform Detection:
- On macOS: Installs all CLI and GUI applications
- On Ubuntu: Installs CLI applications only, automatically skips macOS-specific packages (colima, macmon, and all casks)
Install without cloning via git:
mkdir dotfiles && cd dotfiles && curl -#L https://github.com/phatpham9/dotfiles/tarball/master | tar -xzv --strip-components 1 && ./install.shYou can test the installation in a clean Ubuntu environment using Docker:
# Start Ubuntu container with project mounted
docker run -d --name dotfiles-test -v $(pwd):/root/dotfiles ubuntu:latest tail -f /dev/null
# Install prerequisites
docker exec dotfiles-test apt-get update
docker exec dotfiles-test apt-get install -y sudo curl git
# Run installation
docker exec -it dotfiles-test bash -c "cd /root/dotfiles && ./install.sh"
# Clean up when done
docker rm -f dotfiles-testAfter installation completes:
- Log out and log back in (or restart your terminal)
- Verify installations:
brew list - Check zsh configuration:
echo $SHELL(should be/bin/zsh)
Manage multiple Git/SSH profiles for different projects or organizations (e.g., personal, work, client projects).
Use the add_profile.sh script to create a new profile:
./add_profile.shThe script will:
- Prompt for profile name, Git user.name, and Git user.email
- Convert the profile name to snake_case automatically
- Generate a new SSH key (
~/.ssh/id_ed25519_[profile]) - Create profile-specific SSH config (
configs/ssh/config_[profile]) - Create profile-specific Git config (
configs/git/gitconfig_[profile]) - Set up symlinks for both configs
- Add an
includeIfdirective to the main.gitconfig
After running the script:
- Add the SSH public key to your Git hosting service:
cat ~/.ssh/id_ed25519_[profile].pub - Create a directory for profile projects:
~/code/[profile]/ - Any Git repositories under
~/code/[profile]/will automatically use the profile's Git config
Use the remove_profile.sh script to remove an existing profile:
./remove_profile.shThe script will:
- Prompt for the profile name to remove
- Display all files and configurations that will be deleted
- Ask for confirmation before proceeding
- Remove SSH keys, SSH config, Git config, symlinks, and the
includeIfdirective
Warning: This operation cannot be undone. Make sure to backup any important data before removal.
dotfiles/
βββ .gitignore # Git ignore rules
βββ LICENSE # MIT License
βββ install.sh # Main installation script
βββ add_profile.sh # Add new Git/SSH profile
βββ remove_profile.sh # Remove existing Git/SSH profile
βββ utils/ # Utility functions
β βββ is_macos.sh # macOS detection helper
β βββ create_symlink.sh # Symlink creation helper
β βββ generate_ssh_key.sh # SSH key generation helper
β βββ to_snake_case.sh # String to snake_case converter
βββ apps/
β βββ install.sh # Application installation logic
β βββ cli/
β β βββ install.sh
β β βββ Brewfile # CLI applications (cross-platform)
β βββ gui/
β βββ install.sh
β βββ Brewfile # GUI applications (macOS only)
βββ configs/
βββ install.sh # Configuration symlink setup
βββ zsh/ # Zsh configuration
β βββ install.sh
β βββ zshrc
β βββ zsh_aliases
βββ git/ # Git configuration
β βββ install.sh
β βββ gitconfig
β βββ gitconfig_[profile] # Profile-specific Git config template
β βββ gitignore_global
βββ ssh/ # SSH configuration
β βββ install.sh
β βββ config
β βββ config_[profile] # Profile-specific SSH config template
βββ gh/ # GitHub CLI configuration
β βββ install.sh
β βββ config.yml
β βββ hosts.yml
βββ docker/ # Docker configuration
β βββ install.sh
β βββ config.json
βββ starship/ # Starship configuration
βββ install.sh
βββ starship.toml
Edit the appropriate Brewfile:
apps/cli/Brewfile- Add CLI tools withbrew "package-name"apps/gui/Brewfile- Add GUI apps withcask "app-name"(macOS only)
- Add your config files to the appropriate subdirectory under
configs/ - Update
configs/install.shto create symlinks for your new configs - Follow the existing pattern using the
create_symlinkfunction
To skip a package on Ubuntu, add it to the HOMEBREW_BUNDLE_BREW_SKIP variable in apps/cli/install.sh:
HOMEBREW_BUNDLE_BREW_SKIP="colima macmon other-macos-only-package" brew bundle --file="${DIR}/Brewfile"# Update Homebrew and upgrade all packages
brew update && brew upgrade
# Or update specific package
brew upgrade <package-name>Since configs are symlinked, simply pull the latest changes:
cd dotfiles
git pullChanges take effect immediately (you may need to restart your shell for some changes).
Add Homebrew to your PATH manually:
# macOS
eval "$(/opt/homebrew/bin/brew shellenv)"
# Ubuntu
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"Ensure you have proper permissions and sudo access:
sudo -vIf symlinks fail due to existing files, back them up first:
mv ~/.zshrc ~/.zshrc.backupThen re-run the installation.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using Commitizen (
git cz) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your changes:
- Work on both macOS and Ubuntu (or use platform detection)
- Follow the existing code style
- Include appropriate comments
- Don't break existing functionality
This project is licensed under the MIT License - see the LICENSE file for details.
Phat Pham
- GitHub: @phatpham9
- Email: phat@onroads.xyz
- Website: onroads.xyz
- Homebrew - The missing package manager for macOS (and Linux)
- oh-my-zsh - Framework for managing Zsh configuration
- Starship - Cross-shell prompt