aliazer analyzes your shell history, detects repeated command patterns (including argument variations), and suggests aliases. With your approval, it writes them directly to your shell config.
- Shell history parsing (bash, zsh, fish)
- Exact match detection (threshold: 5+ occurrences)
- Alias suggestion generation
- Simple list output + approval prompt
- Write approved aliases automatically to shell config
- Argument variation abstraction
cd ~/projects/foo,cd ~/projects/bar→ suggestcdp <name>git commit -m "fix",git commit -m "wip"→ suggestgc <msg>
- Pattern confidence score (variation count, occurrence count)
- Conflict detection against existing aliases
-
--interactiveflag with fzf-style TUI - Multi-select (space to mark, enter to approve batch)
- Inline alias name editing before approval
-
--dry-runflag — preview suggestions without writing to config -
--undo— revert last aliazer-written aliases -
--stats— command usage statistics - Config file (
~/.config/aliazer/config.toml) — threshold, ignored commands, shell override
aliazer/
├── src/
│ ├── main.py # Entry point, CLI arg parsing
│ ├── history/
│ │ ├── parser.py # Shell history reader (bash/zsh/fish)
│ │ └── normalizer.py # Normalize raw commands
│ ├── analyzer/
│ │ ├── exact.py # Exact match detection
│ │ └── pattern.py # Argument variation abstraction
│ ├── suggester.py # Alias name generator
│ ├── writer.py # Write to shell config
│ └── ui/
│ ├── simple.py # Simple list + prompt
│ └── interactive.py # fzf-style TUI (--interactive)
├── tests/
├── PLANNED.md
└── README.md
| Shell | History File | Format |
|---|---|---|
| bash | ~/.bash_history |
plain text |
| zsh | ~/.zsh_history |
timestamp;command |
| fish | ~/.local/share/fish/fish_history |
YAML-like |
Shell is auto-detected via $SHELL env var, overridable with --shell flag.
- Tokenize command via
shlex.split - Fix base command (
git,cd,npm, etc.) - Group arguments — if same position has varying values → abstract to
<arg> - If group size ≥ threshold → generate suggestion
Example:
git checkout feature/login
git checkout feature/signup
git checkout hotfix/bug-123
→ base: "git checkout", arg[0]: variation
→ suggestion: gco='git checkout'
- Initials of base command + subcommand initial
git commit→gc,git checkout→gco,cd ~/projects→cdp- On conflict, append number:
gc2 - User can edit the name in TUI before approving
Correct syntax per shell:
# bash/zsh
alias gc='git commit -m'
# fish
abbr --add gc 'git commit -m'Backup written before any modification: ~/.bashrc.aliazer.bak
aliazer [OPTIONS]
Options:
--shell SHELL Shell override (bash, zsh, fish) [default: auto]
--threshold INT Minimum occurrence count [default: 5]
--interactive fzf-style TUI mode
--dry-run Preview suggestions without writing to config
--undo Revert last aliazer write
--stats Command usage statistics
--config PATH Config file path
- GUI
- Cloud sync
- Multi-machine profile management
- Plugin system
| Version | Goal |
|---|---|
| v0.1.0 | Working MVP, bash/zsh/fish support |
| v0.2.0 | Pattern intelligence |
| v0.3.0 | Interactive TUI |
| v0.4.0 | Polish + config system |
| v1.0.0 | Stable, GitHub release |