to move · Enter to open · Esc to close Something not working? Troubleshooting
    On this page

    Aliases

    Create, manage, and auto-discover shell aliases directly from your command history. Suvadu analyzes what you type most and suggests shortcuts so you never have to configure aliases by hand again.

    Quick Start

    Open the interactive manager, or register an alias directly:

    suv aliases
    
    # Or add directly (regenerates aliases.sh automatically)
    suv aliases add dcu "docker compose up -d"

    Your alias is now available in every new shell session. Suvadu writes aliases to a sourceable file that your shell config loads automatically (set up during suv init).

    Interactive Manager

    Bare suv aliases opens a manager with live fuzzy filtering. Use Up/Down to navigate, Ctrl+A to add, Enter or Ctrl+E to edit, Ctrl+D to delete with confirmation, and Esc to quit. Letters are search text. The old suv alias name remains an alias.

    TUI changes regenerate aliases.sh when aliases remain, and new shells load the updated file through Suvadu's shell integration. Existing shells retain definitions already loaded; open a new shell to pick up additions and edits.

    Adding Aliases

    Use suv aliases add to register a new alias. The name must be alphanumeric and may include hyphens (-) and underscores (_). The command can be any valid shell expression.

    suv aliases add <NAME> <COMMAND>

    Examples

    # Short alias for docker compose
    suv aliases add dcu "docker compose up -d"
    
    # Git shortcut
    suv aliases add gp "git push origin HEAD"
    
    # Compound command
    suv aliases add deploy "git pull && cargo build --release && systemctl restart myapp"

    The CLI updates an existing alias with the same name. Use the interactive manager to inspect an alias before editing it.

    Removing Aliases

    Remove a previously registered alias by name.

    suv aliases remove <NAME>

    Example

    suv aliases remove dcu

    After removing an alias, run suv aliases apply to regenerate the sourceable file while other aliases remain. In 0.4.0, removing the last alias leaves the old aliases.sh in place; remove its obsolete definitions manually. Existing shells also retain loaded aliases until you use unalias NAME or start a fresh shell.

    Listing Aliases

    View all aliases currently managed by Suvadu.

    suv aliases list

    This prints a human-readable table of alias names and their associated commands.

    Flag Description
    --json Output aliases as a JSON array. Useful for scripts, automation, or feeding into other tools.

    Example

    # Plain table output
    suv aliases list
    
    # Machine-readable JSON
    suv aliases list --json

    Applying Aliases

    Adding aliases and accepting suggestions regenerate the sourceable file automatically. After the CLI remove command, use suv aliases apply to regenerate it while aliases remain. Your shell config (set up by suv init) sources this file on startup, so new terminal sessions will automatically pick up the changes.

    suv aliases apply
    Flag Description
    --stdout Print the alias definitions to stdout instead of writing to the shell file. Useful for previewing or piping into a custom setup.

    Example

    # Preview what will be written
    suv aliases apply --stdout
    
    # Write to shell file (default behavior)
    suv aliases apply

    Suggesting Aliases

    Suvadu can analyze your command history and suggest aliases for the commands you type most frequently. This is one of the most powerful features — it turns your actual usage patterns into time-saving shortcuts.

    suv aliases suggest

    The command scans human-typed history, filters for commands above a minimum frequency and length threshold, and presents a ranked list of suggestions.

    Flag Description
    -c, --min-count <N> Minimum number of times a command must appear in history to be suggested. Defaults to 10.
    -l, --min-length <N> Minimum character length of the command string. Short commands (like ls) are excluded by default. Defaults to 12.
    -d, --days <N> Only analyze history from the last N days. Omit to scan all history.
    -n, --top <N> Number of suggestions to show. Defaults to 20.
    --text Output suggestions as plain text instead of the interactive TUI.

    Examples

    # Suggest aliases from the last 30 days, minimum 5 uses
    suv aliases suggest --days 30 --min-count 5
    
    # Top 10 suggestions, plain text output
    suv aliases suggest --top 10 --text
    
    # Only suggest long commands (20+ chars) used at least 15 times
    suv aliases suggest --min-length 20 --min-count 15

    In the suggestions TUI, Space toggles a suggestion, Ctrl+A selects all, Ctrl+N deselects all, Ctrl+E edits a suggested name, Enter confirms, and q or Esc quits.

    Adding Suggested Aliases Interactively

    Use suv aliases add-suggested to run the same history analysis as suggest, but with an interactive picker that lets you select which suggestions to register as aliases. Suvadu auto-generates alias names based on the command structure.

    suv aliases add-suggested

    This command accepts the same flags as suv aliases suggest (-c, -l, -d, -n); --text belongs only to suggest to control which commands are surfaced.

    Example

    # Interactively pick from recent high-frequency commands
    suv aliases add-suggested --days 14 --min-count 3

    How It Works

    Aliases are stored in Suvadu's local SQLite database alongside your history. When you run suv aliases apply, Suvadu generates aliases.sh in its data directory containing standard shell alias declarations. Your shell config sources this file on startup, so aliases are always in sync with what Suvadu manages.

    The suggest and add-suggested commands query your history database directly, grouping and ranking commands by frequency. All analysis is performed locally — no data leaves your machine.

    Tip: Run suv aliases suggest periodically (e.g., monthly) to discover new aliases as your workflow evolves. Combine with tags to focus on specific projects.