A CLI tool to sync and manage your dotfiles across all your machines.
This project is currently under active development and not yet production-ready:
- Git commands and symlink operations are not fully tested (coverage ~70-80%)
- Do NOT DELETE
~/.dotsxwithout first creating a backup, as it contains the content of your files.- You must initialize a GitHub repository
- The
dotsx backupcommand is coming soon
# Run directly without installation
bunx dotsx
npx dotsx
pnpm dlx dotsx
# Or install globally
bun add -g dotsx
npm install -g dotsx
pnpm add -g dotsxManaging configuration files (dotfiles) across multiple machines is challenging:
- Synchronization: Manually copying
.zshrc,.vimrc, IDE settings between machines - Version Control: No history of configuration changes
- Backup: Risk of losing configurations when switching machines
- Organization: Scattered config files across the filesystem
- Multi-OS: Different paths for the same tool (Linux vs macOS)
dotsx centralizes and version-controls all your configurations in ~/.dotsx:
- β Unified Management: All dotfiles in one place
- β Git-Backed: Full version history and synchronization via GitHub
- β Automatic Symlinks: Original locations point to centralized configs
- β Multi-OS Support: OS-specific configurations (Debian, Arch, macOS, etc.)
- β Backup System: Automatic daily backups before modifications
- β Script Management: Centralized executable scripts with auto-aliasing
graph LR
A[Original Config<br/>~/.zshrc] -->|symlink| B[dotsx Storage<br/>`~/.dotsx/debian/symlinks/__home__/.zshrc`]
B -->|git sync| C[GitHub<br/>Backup & Sync]
C -->|git pull| D[Other Machine<br/>`~/.dotsx/macos/symlinks/__home__/.zshrc`]
D -->|symlink| E[~/.zshrc]
~/.dotsx/
βββ <os>/ # OS/distro name (debian, arch, macos, etc.)
βββ dotsx.config.json # OS-specific configuration
βββ bin/ # Executable shell scripts
β βββ dotsx.bin.aliases
βββ packages/ # Package manager metadata
β βββ dotsx.packages.json
βββ symlinks/ # All symlinked configurations
βββ __home__/ # User home directory paths
βββ .zshrc
βββ .config/Code/User/settings.json
βββ .claude/CLAUDE.md
What it does: Creates symbolic links from your original config locations to centralized dotsx storage.
How it works:
-
Path Normalization: Converts system paths to portable format
~/.zshrc β ~/.dotsx/debian/symlinks/__home__/.zshrcThe
__home__prefix replaces~for user-agnostic storage. -
Symlink Creation Process:
- Detects original file location (e.g.,
~/.zshrc) - Creates backup in
~/.backup.dotsx/(timestamped) - Moves original file to
~/.dotsx/<os>/symlinks/__home__/.zshrc - Creates symlink:
~/.zshrc β ~/.dotsx/<os>/symlinks/__home__/.zshrc
- Detects original file location (e.g.,
-
Integrity Checking:
- Scans all files in
~/.dotsx/<os>/symlinks/ - Verifies each symlink exists and points to correct location
- Detects broken/missing symlinks and offers automatic repair
- Scans all files in
What it does: Version-controls your dotfiles on GitHub with SSH authentication.
How it works:
-
Initial Setup:
- Initializes Git repository in
~/.dotsx/ - Requires GitHub SSH connection (SSH keys must be configured)
- Sets remote:
git@github.com:username/dotsx.git
- Initializes Git repository in
-
Sync Operation (
dotsx git sync):# Internally executes: git add -A # Stage all changes git commit -m "update dotsx [timestamp]" # Commit with timestamp git push origin main # Push to remote
-
Pull Operation (
dotsx git pull):# Internally executes: git pull origin main # Fetch updates # Then validates: - Checks for merge conflicts - Verifies symlink integrity - Offers to fix broken symlinks
-
Conflict Resolution:
- Detects conflicts during pull
- Prompts user to resolve manually
- After resolution, user runs
dotsx checkto validate
Security: Only SSH authentication is supported (no HTTPS tokens).
What it does: Centralizes executable shell scripts with automatic aliasing.
How it works:
-
Script Storage:
- Scripts are stored as native files (not symlinks) in
~/.dotsx/<os>/bin/ - Example:
~/.dotsx/debian/bin/deploy.sh
- Scripts are stored as native files (not symlinks) in
-
Automatic Aliasing:
- dotsx scans
bin/directory - Generates aliases in
~/.dotsx/<os>/bin/dotsx.bin.aliases:alias deploy="~/.dotsx/debian/bin/deploy.sh" alias backup="~/.dotsx/debian/bin/backup.sh"
- Alias file is auto-sourced in shell RC (
.zshrcor.bashrc)
- dotsx scans
-
Execution Flow:
Loadinggraph LR A[User types: deploy] --> B[Shell reads alias] B --> C[Executes: ~/.dotsx/debian/bin/deploy.sh] -
Setup Process:
# 1. Add script manually echo '#!/bin/bash\necho "Deploying..."' > ~/.dotsx/debian/bin/deploy.sh # 2. Run dotsx bin dotsx bin # Makes executable (chmod +x) # Generates alias # Sources in ~/.zshrc # 3. Use from anywhere deploy # Works from any directory
Cleanup: If a script is deleted, its alias is automatically removed from dotsx.bin.aliases.
What it does: Tracks installed packages per OS, with separate text files per package manager.
How it works:
-
Package Detection:
- Detects OS/distro on initialization
- Identifies available package managers (apt, brew, pacman, etc.)
- Each package manager has its own
.txtfile
-
Storage Format (
~/.dotsx/<os>/packages/):~/.dotsx/debian/packages/ βββ apt.txt # One package per line βββ snap.txt βββ flatpak.txt ~/.dotsx/macos/packages/ βββ brew.txt ~/.dotsx/arch/packages/ βββ pacman.txt βββ yay.txtExample
apt.txt:git curl tmux neovim
-
Package Manager Operations (
dotsx packages):- Select package manager: Choose from available managers (apt, snap, brew, etc.)
- Check status: Scans
.txtfile and checks each package installation status# For apt packages: dpkg -s git # Check if installed dpkg -s curl # Check if installed
- Install missing: Prompts to install packages not yet installed
sudo apt install -y tmux
- Remove installed: Prompts to remove packages currently installed
sudo apt remove -y neovim
-
Workflow:
LoadingsequenceDiagram participant User participant dotsx participant PackageFile as apt.txt participant System User->>dotsx: dotsx packages dotsx->>User: Select package manager User->>dotsx: apt dotsx->>PackageFile: Read package list PackageFile->>dotsx: [git, curl, tmux, neovim] dotsx->>System: Check installation status System->>dotsx: git β , curl β , tmux β, neovim β dotsx->>User: Show status + prompt action User->>dotsx: Install missing packages dotsx->>System: sudo apt install -y tmux neovim -
Sync Across Machines:
- Package lists (
.txtfiles) are version-controlled in Git git syncbacks up your package lists to GitHubgit pullon new machine downloads package lists- Run
dotsx packagesto install missing packages
- Package lists (
| OS/Distro | Package Managers |
|---|---|
| macOS | brew |
| Debian/Ubuntu | apt, snap, flatpak |
| Mint/Kali/Pop/Zorin/Deepin/Elementary/Endless/Parrot/Raspbian | apt, snap, flatpak |
| Fedora/RHEL/CentOS/Rocky/AlmaLinux/Oracle/Amazon Linux | dnf, yum |
| Arch/Manjaro | pacman, yay |
| Alpine | apk |
Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
