mayros completion
Generate and install shell completion scripts for tab-completion of Mayros commands, subcommands, and options. Supports zsh, bash, fish, and PowerShell.
Completion scripts are cached to disk for fast shell startup, avoiding the overhead of generating completions on every shell launch.
Options
| Flag | Description | Default |
|---|---|---|
-s, --shell <shell> | Shell to generate completion for: zsh, bash, powershell, fish | zsh |
-i, --install | Install completion script to shell profile | false |
--write-state | Write completion scripts to $MAYROS_STATE_DIR/completions (no stdout) | false |
-y, --yes | Skip confirmation (non-interactive) | false |
Supported shells
| Shell | Profile path |
|---|---|
zsh | ~/.zshrc |
bash | ~/.bashrc (falls back to ~/.bash_profile) |
fish | ~/.config/fish/config.fish |
powershell | Platform-dependent PowerShell profile |
Installation
The recommended installation flow uses cached completion files for fast shell startup:
bash# Step 1: Generate and cache completion scripts mayros completion --write-state # Step 2: Install the source line to your shell profile mayros completion --install
This writes a # Mayros Completion block to your shell profile that sources the cached file. If a previous completion entry exists, it is replaced automatically.
Manual usage
To output the completion script to stdout (useful for piping or manual setup):
bash# Print zsh completion script mayros completion --shell zsh # Print bash completion script mayros completion --shell bash # Eval directly (slower startup — prefer --install) source <(mayros completion --shell zsh)
Examples
bash# Install for your current shell (auto-detected) mayros completion --install # Install for a specific shell, skip confirmation mayros completion --install --shell bash --yes # Cache completions for all shells mayros completion --write-state # Cache completions for a specific shell only mayros completion --write-state --shell fish # Print the fish completion script to stdout mayros completion --shell fish
Related
- onboard — setup wizard (includes completion installation)