Skip to main content

A tool to manage and synchronize dotfiles across multiple systems.

Project description

Dotfile Manager

A flexible, Python-based tool for managing, synchronizing, and linking your dotfiles across systems using a manifest-driven approach.


Features

  • Manifest-based configuration: Supports TOML, YAML, and JSON formats.
  • Git integration: Synchronize dotfiles with remote repositories.
  • Automatic linking: Create symlinks for dotfiles as specified in the manifest.
  • System import: Generate manifests from your current dotfiles.
  • Orphaned file detection: Find and manage unmanaged files in your dotfiles directory.
  • Customizable: Easily extendable and configurable.

Goals

Check pending features at goals.md


Installation

Clone the repository and install dependencies:

git clone https://github.com/yourusername/dotfile-manager.git
cd dotfile-manager
pip install -e .

Usage

All commands are available via the CLI app:

dfman <command> [options]

Commands Overview

Below are the main commands with usage and examples.


init

Initialize the dotfile manager and create a manifest.

dfman init
  • Prompts for manifest format, root directory, repository URL, and other settings.
  • Creates a manifest file and initializes the dotfiles directory.

check

Print the current manifest in a human-readable format.

dfman check

sync

Synchronize dotfiles with the remote repository (pull and/or push changes).

dfman sync --pull --save --m "Sync message"
  • --pull: Pull changes from remote (default: True)
  • --save: Push local changes (default: True)
  • --m: Commit message

review

Show the current status of the dotfiles git repository.

dfman review

link

Create symlinks for dotfiles as specified in the manifest.

dfman link
dfman link ~/.bashrc ~/.vimrc
  • If no files are specified, links all dotfiles in the manifest.

from-system

Import dotfiles from your system into the manifest and dotfiles directory.

dfman from-system
dfman from-system ~/.bashrc ~/.vimrc
  • Moves/copies files from your home directory into the managed directory and updates the manifest.

download

Clone a remote dotfiles repository and set up the manifest.

dfman download --repository-url <url> --branch main
  • Downloads the repository and links the manifest file.

edit-file

Edit a file using your preferred editor and add it to the manifest.

dfman edit-file ~/.bashrc --editor nvim
  • Opens the file in the specified editor, creates a symlink, and updates the manifest.

edit-manifest

Edit the manifest file directly in your editor.

dfman edit-manifest --editor nvim

unlink

Remove symlinks for specified dotfiles (or all if none specified).

dfman unlink
dfman unlink ~/.bashrc

remove

Remove dotfiles from the manifest and unlink them.

dfman remove ~/.bashrc ~/.vimrc

list-dotfiles

List all dotfiles in the manifest.

dfman list-dotfiles

map-orphaned-files

Find and map orphaned files in the dotfiles directory (files not tracked in the manifest).

dfman map-orphaned-files

log

Show the git log of the dotfiles repository.

dfman log --limit 20

exec

Execute a command on a dotfile (e.g., open with an editor or print contents).

dfman exec ~/.bashrc --with-command nvim
dfman exec ~/.bashrc

save-changes

Save changes to the manifest and optionally push them to the remote repository.

dfman save-changes --m "Commit message" --save
  • --m: Commit message for the changes.
  • --save: Push changes to the remote (default: True). If not set, only commits locally.

Manifest Example

[dotfile_manager]
root = "~/dotfiles"
repository_url = "git@github.com:yourusername/dotfiles.git"
repository_branch = "main"
dotfiles = [
    { name = ".bashrc", location = ".bashrc" },
    { name = ".vimrc", location = ".vimrc" }
]

Project Structure

dotfile_manager/
    app.py          # CLI entrypoint
    utils.py        # Utilities and helpers
    linker/         # Symlink logic
    manifest/       # Manifest schema, loader, and format logic
    syncer/         # Git integration

Requirements


License

Apache License


Contributions welcome! Send your pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dfman-0.1.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dfman-0.1.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file dfman-0.1.1.tar.gz.

File metadata

  • Download URL: dfman-0.1.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for dfman-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4f155e1699dcfcd567e5aadc352e24e65ac768baa793fa471cb64273499b6c84
MD5 77849a5bd659ef8a8c9da96db8a1bb7a
BLAKE2b-256 801996935d6efd8a37e9cbc796fe7f99a79a4816af6b9dbdc1ce030bc0ee9639

See more details on using hashes here.

File details

Details for the file dfman-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dfman-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for dfman-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 224c720098a3f9b42b85b3570d9329816112da7deda4cc6f8b5bda4453040f3c
MD5 79f333737382130d17949349c13ee27a
BLAKE2b-256 c301530ae2aa246dd8d9dfaa5f5fb04a8420dd0734aecafea37515ea327444d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page