Skip to content

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

Open
aditya-ai-architect wants to merge 1 commit intoopenai:mainfrom
aditya-ai-architect:feature/shell-completion
Open

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

Conversation

@aditya-ai-architect
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 openai#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
@aditya-ai-architect aditya-ai-architect requested a review from a team as a code owner February 4, 2026 17:04
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