Skip to content

feat: shell completions — bash, zsh and fish (v1.7.0) #79

@shouze

Description

@shouze

Context

Part of the 🛠 Developer experience EPIC #77, targeting v1.7.0.

Goal

Add a completions subcommand that outputs a shell completion script for bash, zsh or fish.

Users install once:

# bash (~/.bashrc)
eval "$(github-code-search completions --shell bash)"

# zsh (~/.zshrc)
eval "$(github-code-search completions --shell zsh)"

# fish (~/.config/fish/config.fish)
github-code-search completions --shell fish | source

When --shell is omitted, the shell is auto-detected from $SHELL.

Scope

  • New completions subcommand in github-code-search.ts
  • Completion scripts as inline templates (no new runtime dependency)
  • Covers subcommands: query, upgrade, completions
  • Covers common options: --org, --format, --output-type, --exclude-repositories, --exclude-extracts, --group-by-team-prefix, --no-interactive, --include-archived, --no-cache
  • TDD: unit tests that verify the output is a non-empty string containing the tool name for each shell

Acceptance criteria

  • github-code-search completions --shell bash → valid bash script
  • github-code-search completions --shell zsh → valid zsh script
  • github-code-search completions --shell fish → valid fish script
  • Auto-detection from $SHELL (fish/zsh/bash)
  • Unknown shell → friendly error message + exit 1
  • Unit tests pass

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions