Completion Command

The entrenar completion command generates shell completion scripts for bash, zsh, fish, and PowerShell.

Usage

entrenar completion <SHELL>

Arguments

ArgumentDescription
<SHELL>Target shell: bash, zsh, fish, powershell

Installation

Bash

# Generate and install completions
entrenar completion bash > ~/.local/share/bash-completion/completions/entrenar

# Or for system-wide installation (requires sudo)
entrenar completion bash | sudo tee /etc/bash_completion.d/entrenar > /dev/null

# Reload completions
source ~/.bashrc

Zsh

# Generate completions
entrenar completion zsh > ~/.zsh/completions/_entrenar

# Add to fpath in ~/.zshrc
fpath=(~/.zsh/completions $fpath)

# Rebuild completion cache
rm -f ~/.zcompdump && compinit

Fish

# Generate and install completions
entrenar completion fish > ~/.config/fish/completions/entrenar.fish

# Completions are automatically loaded

PowerShell

# Generate completions
entrenar completion powershell | Out-File -Encoding utf8 $PROFILE.CurrentUserAllHosts

# Or append to existing profile
entrenar completion powershell | Add-Content $PROFILE

Completion Features

The generated completions provide:

  • Command completion - All subcommands (train, validate, info, etc.)
  • Option completion - All flags and options
  • File path completion - For file arguments (.yaml, .safetensors, etc.)
  • Value completion - For enum options (format, method, etc.)

Example Usage

After installation, type entrenar and press Tab:

$ entrenar <TAB>
audit       completion  info        inspect     merge       monitor
quantize    research    train       validate

$ entrenar train <TAB>
config.yaml  examples/    mnist.yaml

$ entrenar train config.yaml --<TAB>
--batch-size  --dry-run     --epochs      --help
--lr          --output-dir  --quiet       --verbose

Verification

Verify completions are working:

# Bash
complete -p entrenar

# Zsh
which _entrenar

# Fish
complete -c entrenar

Troubleshooting

Completions Not Working

  1. Check installation path:

    # Bash
    ls ~/.local/share/bash-completion/completions/entrenar
    
    # Zsh
    echo $fpath | grep completions
    
  2. Reload shell:

    exec $SHELL
    
  3. Regenerate completions:

    entrenar completion bash > /tmp/entrenar.bash
    source /tmp/entrenar.bash
    

Permission Issues

# Use sudo for system-wide installation
sudo entrenar completion bash > /etc/bash_completion.d/entrenar

See Also