Install YADM (Yet Another Dotfiles Manager)
You are helping the user install and set up YADM for managing their dotfiles.
Your tasks:
Check if YADM is already installed:
- Check:
which yadm - If installed:
yadm version - If already installed, ask the user if they want to:
- Configure it for first use
- Upgrade to the latest version
- Or exit
- Check:
Install YADM:
Option 1: Using apt (recommended for Ubuntu):
sudo apt update sudo apt install yadmOption 2: Using the install script (for latest version):
curl -fsSL https://github.com/TheLocehiliosan/yadm/raw/master/bootstrap/install_yadm.sh | sudo bashAsk the user which installation method they prefer.
Verify installation:
- Check version:
yadm version - Check location:
which yadm
- Check version:
Initialize YADM (if user wants to set it up):
For new setup:
yadm initFor cloning existing dotfiles: Ask the user if they have an existing dotfiles repository to clone. If yes, get the repository URL and run:
yadm clone <repository-url>Guide the user through initial configuration:
Add existing dotfiles: Suggest common dotfiles to track:
~/.bashrc~/.bash_profile~/.profile~/.gitconfig~/.ssh/config(if exists)~/.config/directories (ask which ones)
Show how to add files:
yadm add ~/.bashrc yadm add ~/.gitconfig yadm commit -m "Initial dotfiles commit"Set up remote repository (if user wants): Ask if they want to set up a remote repository:
yadm remote add origin <repository-url> yadm push -u origin mainExplain basic YADM usage:
yadm status- Check statusyadm add <file>- Track a fileyadm commit -m "message"- Commit changesyadm push- Push to remoteyadm pull- Pull from remoteyadm list- List tracked filesyadm diff- Show differences
Set up encryption (optional): Ask if the user wants to encrypt sensitive files:
echo ".ssh/id_rsa" >> ~/.config/yadm/encrypt yadm encryptSet up bootstrap (optional): Explain that YADM can run a bootstrap script on new systems. Offer to create a basic
~/.config/yadm/bootstrapscript:#!/bin/bash # Install common packages sudo apt update sudo apt install -y git vim tmuxProvide next steps and best practices:
- Regularly commit dotfile changes:
yadm add -u && yadm commit -m "Update dotfiles" - Use branches for experimental configurations
- Use
.config/yadm/encryptfor sensitive files - Consider alternate files for different systems (using YADM's alternate file feature)
- Backup remote repository (GitHub/GitLab)
- Regularly commit dotfile changes:
Important notes:
- Ask before making any commits or pushes
- Explain the difference between YADM and regular git (YADM operates on $HOME)
- Warn about not committing sensitive information unencrypted
- If user already has dotfiles in a git repo, explain migration process
- Be clear that YADM commands work like git commands