Skip to content

feat: add shell completion support for bash, zsh, and fish#66

Merged
NormallyGaussian merged 1 commit intoparallel-web:mainfrom
mvanhorn:feat/shell-completions
Mar 12, 2026
Merged

feat: add shell completion support for bash, zsh, and fish#66
NormallyGaussian merged 1 commit intoparallel-web:mainfrom
mvanhorn:feat/shell-completions

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Adds a parallel-cli completion command group for shell tab-completion:

  • parallel-cli completion show [--shell bash|zsh|fish] - Print the completion script to stdout
  • parallel-cli completion install [--shell bash|zsh|fish] - Auto-install to your shell config file

Uses Click's built-in shell completion system, so completions stay in sync as commands are added. Shell is auto-detected from $SHELL with --shell override.

Usage

# Auto-install for your current shell
parallel-cli completion install

# Or manually add to your config
parallel-cli completion show --shell zsh >> ~/.zshrc

Details

  • Supports bash, zsh, and fish
  • Install is idempotent (guard comment prevents duplicates)
  • Standalone binary mode (PyInstaller) is detected and rejected gracefully with a helpful message - completions require the pip-installed version
  • 8 new tests covering all shells, auto-detection, idempotency, and standalone rejection
Research & Context

Project Context

  • The CLI has a deep command tree (search, extract, research, enrich, findall, monitor) with many subcommands and options
  • Shell completions are table-stakes UX for CLI tools - every mature CLI ships them
  • Click 8.1+ has built-in completion support that just needs to be exposed

Competitive Analysis

  • Most Python CLI tools using Click ship completion support
  • Typer (which wraps Click) auto-generates completion install commands
  • This brings parallel-cli in line with CLI UX expectations

This contribution was developed with AI assistance (Claude Code).

Add a `completion` command group with two subcommands:
- `parallel-cli completion show` - prints the completion script to stdout
- `parallel-cli completion install` - auto-installs completions to shell config

Uses Click's built-in shell completion system. Supports auto-detection
of the current shell from $SHELL, with --shell override for all three
shells. Install is idempotent (won't add duplicates) and detects
standalone binary mode (not supported for completions).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@NormallyGaussian NormallyGaussian merged commit ad4bbd3 into parallel-web:main Mar 12, 2026
7 checks passed
@mvanhorn
Copy link
Copy Markdown
Contributor Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants