Obsessively curated dotfiles managed by a robust, extensible Go CLI.
Dots is a comprehensive development environment management system built in Go. It provides a CLI tool for installing, updating, and managing your development configuration including:
- Shell configurations (ZSH)
- Development tools and binaries
- Git extensions and configuration
- Vim/Neovim setup
- Homebrew packages
- Programming language environments (via asdf)
- macOS system preferences
- Custom utility commands
- Font management
- Hammerspoon configuration
- macOS (optimized for macOS systems)
- Homebrew package manager
- Go 1.15+ (recommended: 1.19+)
- ZSH shell (will be set as default)
-
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Go via Homebrew:
brew install go
-
Configure Go environment:
export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH
git clone https://github.com/drn/dots ~/.dots
cd ~/.dots
go install ./...
dots install all
dots # Show help and available commands
dots install all # Install all configuration components
dots install <component> # Install specific component
dots update # Update configuration
dots clean # Clean legacy configuration
dots doctor # Run system diagnostics
dots docker stop-all # Stop all Docker containers
dots spinner # Display spinner demos
The dots install
command supports the following components:
Component | Description | What it installs |
---|---|---|
all |
Runs all install scripts | Complete environment setup |
bin |
Binary utilities | Custom CLI tools in ~/bin |
git |
Git configuration | .gitconfig, .gitignore_global, git extensions |
home |
Home directory configs | Various .* configuration files |
zsh |
ZSH configuration | .zshrc, .zshenv, custom ZSH setup |
fonts |
System fonts | Developer fonts via Homebrew Cask |
homebrew |
Homebrew packages | System dependencies and tools |
npm |
NPM packages | Global Node.js packages |
languages |
Programming languages | asdf version manager and language runtimes |
vim |
Vim configuration | .vimrc and Vim plugins |
hammerspoon |
Hammerspoon config | Window management and automation |
osx |
macOS settings | System preferences and defaults |
The dots doctor
command performs system health checks:
- Xcode Command Line Tools installation
- ZSH as default shell
- Homebrew installation status
- System configuration validation
~/.dots/
├── main.go # Entry point
├── go.mod # Go module definition
├── cli/ # CLI implementation
│ ├── commands/ # Command implementations
│ │ ├── root.go # Main command setup
│ │ ├── install.go # Install orchestration
│ │ ├── install/ # Component installers
│ │ │ ├── bin.go
│ │ │ ├── git.go
│ │ │ ├── home.go
│ │ │ └── ...
│ │ ├── update.go
│ │ ├── clean.go
│ │ ├── doctor.go
│ │ ├── docker.go
│ │ └── spinner.go
│ └── is/ # Helper utilities
├── cmd/ # Standalone utilities
│ ├── battery-percent/
│ ├── git-ancestor/
│ ├── git-killme/
│ ├── spotify/
│ ├── tmux-status/
│ └── ...
├── pkg/ # Shared packages
│ ├── cache/ # Caching utilities
│ ├── log/ # Logging framework
│ ├── path/ # Path utilities
│ └── run/ # Command execution
└── home/ # Dotfile templates
The project includes 22+ custom command-line utilities that are installed to ~/bin
:
git-ancestor
- Find common ancestor between branchesgit-canonical-branch
- Get canonical branch namegit-killme
- Delete current branch and switch to mastergit-masterme
- Rebase current branch onto mastergit-rebase-master
- Interactive rebase onto mastergit-reset-hard-master
- Hard reset to master
battery-percent
- Display battery percentagebattery-state
- Show battery charging statecpu
- CPU usage informationrouter
- Router IP addressssid
- Current WiFi SSIDip
- IP address utilities (local, external, home)
search-github
- Search GitHub repositoriesspotify
- Spotify control and authenticationweather
- Weather informationtmux-status/*
- Tmux status bar components
go install ./...
go install github.com/mgechev/revive@latest
revive -set_exit_status ./...
- Add component to the
commands
slice incli/commands/install.go
- Create installation method in
cli/commands/install/<component>.go
- Implement using the
exec()
helper for error handling - Use
pkg/run
for command execution
- Create directory under
cmd/<utility-name>/
- Implement command using Cobra framework in
root.go
- Build with
go install ./...
- Use
pkg/log
for consistent logging - Use
pkg/run.Verbose()
for visible command output - Use
pkg/run.Silent()
for quiet execution - Follow existing patterns for error handling
- Maintain consistent code style
DOTS
- Override dots directory location (default: ~/.dots)GOPATH
- Go workspace (required)GOBIN
- Go binary installation directory
The project uses GitHub Actions for continuous integration:
- Runs on macOS latest
- Tests each installation component
- Validates update functionality
- Scheduled runs twice daily
-
Command not found: dots
- Ensure
$GOPATH/bin
is in your PATH - Run
go install ./...
from the dots directory
- Ensure
-
Installation failures
- Run
dots doctor
to check system requirements - Ensure Homebrew is properly installed
- Check for sufficient disk space
- Run
-
Permission errors
- Some commands may require sudo access
- Ensure you own the directories being modified
- Fork the repository
- Create a feature branch
- Make your changes following existing patterns
- Ensure linting passes
- Submit a pull request
This project is licensed under the MIT License