Skip to content

Feature Request: Full dotfile lifecycle management (auto-setup, reset, change, install) #18

Description

@grave0x

Summary

Add comprehensive lifecycle management for dotfiles — auto-setup on a new machine, detect and apply changes, reset to clean state, and auto-install all dependencies. Inspired by full dotfile ecosystems like the Spelljinxer/hyprdots setup pattern where a single clone + script gets everything running.

Workflow

dwell deploy                   # One-command full system setup
dwell deploy --dry-run          # Preview before touching anything
dwell deploy --fast             # Skip non-essential steps

dwell status                    # Current state (exists)
dwell diff                      # Changes vs source (exists)

dwell reset <file>              # Reset a single dotfile to source
dwell reset --all               # Reset ALL deployed files to source state
dwell reset --stray             # Remove files deployed by dwell but no longer in source

dwell watch --auto-sync         # Watch + auto-commit on changes (extends existing watch)

dwell deploy — the full setup pipeline

The dwell deploy command should orchestrate everything in sequence:

dwell deploy
  ├── 1. deps scan              # Auto-detect dependencies
  ├── 2. deps install           # Install required packages
  ├── 3. setup restore          # Restore captured packages
  ├── 4. diff --check           # Preview what will change
  ├── 5. apply                  # Deploy dotfiles
  ├── 6. sync                   # Commit initial state
  └── done: "System ready."

A single command to go from bare OS to fully configured system.

dwell reset — revert to source state

dwell reset ~/.bashrc            # Overwrite ~/.bashrc with source version
dwell reset --all                # Reset all tracked files
dwell reset --stray              # Delete targets not in source (cleanup)
dwell reset --staged             # Unstage git changes only
dwell reset --dry-run            # Preview without modifying

Reset should:

  • Single file: read the source entry, re-render template, write to target
  • All: iterate all source entries, re-apply clean versions
  • Stray: find targets in state.json that no longer have corresponding source entries, offer to delete
  • Template changes: re-render with current template data (hostname, os, etc.)

dwell change — auto-detect and suggest

dwell change                     # Scan for unmanaged changes, suggest action
dwell change --track <path>      # Start tracking a new file
dwell change --auto              # Auto-add all detected changes

Detects:

  • Files modified on disk but not in source → suggest dwell add
  • Files deleted on disk but still in source → suggest dwell remove / dwell reset
  • New programs in PATH not in deps.toml → suggest dwell deps scan
  • New config files in ~/.config/ that look managed → suggest dwell add

Auto-install from README dependency table

Parse a README-style dependency table (like the Spelljinxer dotfiles README) and auto-install listed programs:

| Component | Program |
|-----------|---------|
| WM        | hyprland |
| Terminal  | kitty |
| Shell     | zsh |

dwell setup capture --from-readme README.md would parse this table and install all listed tools via the available package manager.

Implementation notes

  • dwell deploy is an orchestration wrapper, not new logic — chains existing commands
  • dwell reset reuses the Deployer with a "force overwrite from source" mode
  • dwell change combines diff + deps scan + filesystem watcher data
  • --stray detection compares state.json entries against source directory entries
  • README table parsing: simple markdown table regex, column 2 = package name
  • All commands support --dry-run

Acceptance criteria

  • dwell deploy chains existing commands with progress output
  • dwell reset --all restores all targets to source state
  • dwell reset --stray finds and removes orphaned targets
  • dwell change scans for unmanaged changes
  • dwell deploy is a single command for fresh-machine setup
  • README dependency table parsing works on common formats
  • Integration tests cover deploy → change → reset cycle

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions