| name | add-alias |
| description | Add a new shell alias to dot_aliae.yaml with proper cross-platform templating |
| argument-hint | <alias-name> <command> |
Add Alias
Add a new alias to dot_aliae.yaml following existing patterns.
Steps
- Read
dot_aliae.yaml to understand current structure and grouping
- Find the appropriate section for the new alias (or create a new section)
- Add the alias using aliae YAML format
- Validate YAML syntax
- Regenerate fallback files for all shells:
chezmoi apply ~/.aliae.yaml
aliae init zsh > ~/.local/share/chezmoi/dot_aliae_fallback.zsh
aliae init bash > ~/.local/share/chezmoi/dot_aliae_fallback.bash
aliae init pwsh --print > ~/.local/share/chezmoi/dot_aliae_fallback.ps1
Or just run aliae-update-fallback if aliae is loaded.
- Run
chezmoi diff to preview the change
Alias Format
Simple alias:
- alias: name
value: command
Cross-platform paths (use {{ .Home }} instead of ~ or $HOME):
- alias: myapp
value: '{{ .Home }}/bin/myapp'
OS-conditional:
- alias: open
value: '{{ if eq .OS "darwin" }}open{{ else }}xdg-open{{ end }}'
Arguments
$1: Alias name
$2: Command value (or description of what you want)
Rules
- Always add to
dot_aliae.yaml, never to .zshrc or .bashrc
- Group with related aliases (git aliases together, navigation together, etc.)
- Use aliae template syntax for paths and OS-specific commands
- Keep alias names short and memorable
- Check for conflicts with existing aliases before adding
- Always regenerate all fallback files (
dot_aliae_fallback.{zsh,bash,ps1}) after changes — these are used when aliae isn't installed