Shell Completions
Enable tab completion for the Pinner CLI in your shell.
Overview
The Pinner CLI supports programmable completion for:
- bash
- zsh
- fish
- PowerShell (pwsh)
Generate Completion Script
Generate the completion script for your shell:
pinner completion bash > ~/.bash_completion.d/pinnerSetup per Shell
Bash
Add to your shell profile:
# Option 1: Source directly
source <(pinner completion bash)
# Option 2: Save to bash_completion.d (requires setup)
pinner completion bash > ~/.bash_completion.d/pinnerThe completion script will be automatically sourced in new bash shells if saved to ~/.bash_completion.d/pinner.
ZSH
Add to your .zshrc:
# Generate completion function
PROG=pinner
source <(pinner completion zsh)Or save to your completions directory:
pinner completion zsh > ~/.zsh/completion/_pinnerMake sure your .zshrc includes the completions directory:
fpath+=~/.zsh/completion
autoload -Uz compinit
compinitFish
Save to fish completions directory:
pinner completion fish > ~/.config/fish/completions/pinner.fishCompletions are automatically loaded in new fish shells.
PowerShell
Generate and source the completion script:
# Generate completion script
pinner completion pwsh > pinner.ps1
# Source for current session
. ./pinner.ps1
# Persist across sessions - add to profile
code $profile
# Add: . ./pinner.ps1Verify Installation
# Test completion is working
pinner <TAB><TAB>
# Should show: auth config doctor help list pin setup status unpin upload
# Test command completion
pinner auth <TAB><TAB>
# Should show available auth optionsCompletion Features
The completion script provides:
- Command completion (
pinner <TAB>) - Subcommand completion (
pinner auth <TAB>) - Flag completion (
pinner upload --<TAB>) - File/path completion for file arguments
Troubleshooting
Completion not working in new shell
Ensure the completion script is sourced in your shell profile:
- Bash:
~/.bashrcor~/.bash_profile - ZSH:
~/.zshrc - Fish:
~/.config/fish/config.fish - PowerShell:
$PROFILE
Regenerate completions
If you update the CLI, regenerate completions:
pinner completion bash > ~/.bash_completion.d/pinnerRelated Commands
pinner --help- General helppinner doctor- Diagnostic checks