Skip to content

feat(cli): Add shell completion for bash, zsh, fish, and PowerShell#2839

Closed
adityaidev wants to merge 1 commit intoopenai:mainfrom
adityaidev:feature/shell-completion
Closed

feat(cli): Add shell completion for bash, zsh, fish, and PowerShell#2839
adityaidev wants to merge 1 commit intoopenai:mainfrom
adityaidev:feature/shell-completion

Conversation

@adityaidev
Copy link

Summary

Fixes #843 - Add shell auto completion for different shells

Changes

Added completion subcommand generating scripts for Bash, Zsh, Fish, and PowerShell.

Usage

openai completion bash
openai completion zsh  
openai completion fish
openai completion pwsh

Installation

  • Bash: eval "$(openai completion bash)"
  • Zsh: eval "$(openai completion zsh)"
  • Fish: openai completion fish | source
  • PowerShell: openai completion pwsh | Out-String | Invoke-Expression

Fixes #843

Adds a new 'completion' subcommand that generates shell completion scripts.

Usage:
  openai completion bash   # Bash completion
  openai completion zsh    # Zsh completion
  openai completion fish   # Fish completion
  openai completion pwsh   # PowerShell completion

To enable, add to shell config:
  eval "$(openai completion bash)"  # Bash
  eval "$(openai completion zsh)"   # Zsh
  openai completion fish | source     # Fish
@adityaidev adityaidev requested a review from a team as a code owner February 4, 2026 17:04
@adityaidev adityaidev closed this by deleting the head repository Feb 24, 2026
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.

Add shell auto completion for different shell, like bash, zsh, fish, powershell

1 participant