Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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/pinner

Setup 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/pinner

The 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/_pinner

Make sure your .zshrc includes the completions directory:

fpath+=~/.zsh/completion
autoload -Uz compinit
compinit

Fish

Save to fish completions directory:

pinner completion fish > ~/.config/fish/completions/pinner.fish

Completions 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.ps1

Verify 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 options

Completion 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: ~/.bashrc or ~/.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/pinner

Related Commands