Skip to content

Usage Examples

Youri Theodora Kopoulos Kirchner Mattar edited this page Jan 13, 2026 · 2 revisions

Basic Usage

# Create symlinks (default command)
hidedot

# Or explicitly
hidedot link

# Check status of all symlinks
hidedot status

# Remove symlinks
hidedot unlink

# Remove symlinks and restore backups
hidedot unlink --restore

Basic Configuration

- defaults:
    link:
      relink: true
      force: true
      backup: true  # Enable automatic backups
  
  create:
    - ~/.config
    - ~/.local/bin
  
  link:
    ~/.config/nvim: ~/.mydotfiles/nvim
    ~/.zshrc: ~/.mydotfiles/zsh/zshrc

Advanced Configuration

- defaults:
    link:
      relink: true
      force: true
      backup: true
  
  profile: personal  # Use with --profile personal
  
  create:
    - ~/.config/nvim
    - ~/.local/share/fonts
  
  link:
    ~/.config/nvim: nvim
    ~/.zshrc: zsh/zshrc
    ~/.tmux.conf: tmux/tmux.conf
  
  git:
    ~/.oh-my-zsh:
      url: https://github.com/ohmyzsh/ohmyzsh.git
      description: "Oh My Zsh"
    ~/.tmux/plugins/tpm:
      url: https://github.com/tmux-plugins/tpm.git
      description: "Tmux Plugin Manager"
  
  shell:
    - [fc-cache -fv, "Rebuild font cache"]
    - [touch ~/.hushlogin, "Create hushlogin"]
  
  hooks:
    pre_link:
      - echo "Setting up dotfiles..."
    post_link:
      - echo "Dotfiles configured!"

Using Templates

- link:
    # Dynamic config based on hostname
    ~/.config/git/config: ./git/config-{{ .Hostname }}
    
  shell:
    - ["echo 'Setting up {{ .Username }} on {{ .OS }}'", "Show setup info"]

Multi-Profile Setup

# Personal machine
- profile: personal
  link:
    ~/.gitconfig: ./git/gitconfig-personal

# Work machine  
- profile: work
  link:
    ~/.gitconfig: ./git/gitconfig-work

# Common config (always applied)
- create:
    - ~/.config

Run with:

hidedot --profile personal
hidedot --profile work

Shell Commands with Stdin

- shell:
    # Simple array format
    - [echo "Hello", "Say hello"]
    
    # Map format with stdin (for creating files)
    - command: "cat > ~/.config/myapp/settings.json"
      description: "Create app settings"
      stdin: |
        {
          "theme": "dark",
          "autosave": true
        }

Backup Management

# Create manual backups
hidedot backup create

# List all backups
hidedot backup list

# Remove symlinks and restore from backup
hidedot unlink --restore

Debugging and Testing

# Preview all changes without making them
hidedot --dry-run

# Verbose output for debugging
hidedot --verbose

# Combine dry-run and verbose
hidedot -n -v

# Check current symlink status
hidedot status

Command Line Examples

# Use custom config file
hidedot -c ~/dotfiles/config.yaml

# Apply only work profile
hidedot --profile work

# Quiet mode (errors only)
hidedot --quiet

# Disable colors (for scripts/CI)
hidedot --no-color

# Disable automatic backups
hidedot --no-backup

Clone this wiki locally