A modern, secure, and user-friendly dotfile manager built with Rust
A modern, secure, and user-friendly dotfile manager built with Rust
A modern, secure, and user-friendly dotfile manager built with Rust
DotState is a terminal-based tool that helps you manage your dotfiles effortlessly. Whether you're syncing your configuration across multiple machines or setting up a new development environment, DotState makes it simple, safe, and fast.
https://github.com/user-attachments/assets/9be0df5e-87ce-4b61-ae0f-1c8ffe94cb36
Managing dotfiles can be a pain. You want your .zshrc, .vimrc, and other config files synced across machines, but traditional solutions are either too complex, insecure, or require too much manual work.
DotState solves this by being:
.gitconfig or .tmux.conf) across all profiles automatically.curl -fsSL https://dotstate.serkan.dev/install.sh | bashcargo install dotstatebrew tap serkanyersen/dotstate
brew install dotstateOr use the direct install:
brew install serkanyersen/dotstate/dotstateLaunch DotState:
dotstateFirst-time Setup:
DOTSTATE_GITHUB_TOKEN environment variableAdd Your Files:
Sync with Remote:
That's it! Your dotfiles are now synced and ready to use on any machine.
DotState also provides a powerful CLI for automation:
…Generate completions for your shell:
# Bash
source ~/.zsh/completions/_dotstateThen add fpath=(~/.zsh/completions $fpath) to your .zshrc before your framework loads.
~/.config/dotstate/storage)common section and linked regardless of the active profileProfiles are how DotState organizes your dotfiles for different machines or contexts. Each profile has its own set of files, while Common Files are shared across all profiles automatically.
…In the TUI, go to Manage Profiles and press C to create a new profile. You can:
Inherit vs Copy: Inheritance is a live relationship — changes to the parent are reflected in the child. Copy is a one-time fork — after creation, the two profiles are independent.
A profile can inherit from one parent. When activated, DotState resolves files from the full chain:
base
│ .zshrc, .vimrc, .tmux.conf
│
work (inherits base)
│ .zshrc (overrides base's)
│ .ssh/config (own)
│
work-laptop (inherits work)
.ssh/config (overrides work's)In this example, work-laptop gets: its own .ssh/config, work's .zshrc, and base's .vimrc and .tmux.conf.
Cycles are detected and rejected. Profiles that are inherited by others cannot be deleted until the inheritance is removed.
Select a profile and press Enter to switch. DotState will remove symlinks for the old profile and create symlinks for the new one automatically (including inherited files). Common files stay linked regardless of which profile is active. If activation fails, the old profile is automatically restored.
You decide which files are shared. Move any file to Common and it will be symlinked in every profile. Common files stay linked when you switch profiles. To move a file between profile-specific and common:
M to move it to Common (or back to the active profile)Personal profile on your laptop, Work on your work machine, and Server for headless setups. Keep shared configs (.gitconfig, .tmux.conf) in Common.day, night, or focus with different terminal themes and defaults, and switch between them instantly.base profile with your core setup, then have work and personal inherit from it — each only overrides what's different (like .zshrc or .ssh/config). Changes to base automatically flow to all children.DotState supports two repository setup modes:
Let DotState create and manage a GitHub repository for you. Requires a GitHub Personal Access Token.
GitHub Token Options:
DotState supports both Classic tokens and Fine-grained tokens (recommended).
Option 1: Fine-grained Token (Recommended)
Fine-grained tokens offer better security through granular permissions. Create one at github.com/settings/personal-access-tokens.
Required permissions:
| Permission | Access Level | Purpose |
|---|---|---|
| Administration | Read & write | Create your dotstate-storage repository |
| Contents | Read & write | Sync your dotfiles to/from the repository |
Note: Metadata (read-only) is automatically included by GitHub for all fine-grained tokens.
Repository access:
dotstate-storage repositoryOption 2: Classic Token
Create a classic token at github.com/settings/tokens.
Required scope: repo (Full control of private repositories)
Token Configuration:
Environment Variable (Recommended for automation):
export DOTSTATE_GITHUB_TOKEN=ghp_your_token_here
# or for fine-grained tokens:
export DOTSTATE_GITHUB_TOKEN=github_pat_your_token_hereThe environment variable takes precedence over the config file token.
Config File: The token can be stored in the config file (set during first-time setup).
Use any existing git repository from any host (GitHub, GitLab, Bitbucket, self-hosted, etc.).
Setup:
git clone ~/.config/dotstate/storagegit push origin mainBenefits of Local Mode:
DotState automatically checks for updates and shows a notification in the main menu when a new version is available. You can also check manually:
# Check for updates interactively
dotstate upgrade
# Just check without prompting
dotstate upgrade --check**Conf
No open issues yet, or sync has not completed.