-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shell auto-completion #1603
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Added argcomplete to the dependencies
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Added argcomplete to _cli.py
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Added bash command requirement for bash in the readme file
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
edit readme structure
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
simplified step to register argcomplete
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Added activation instructions for zsh and fish to readme
…activation Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Modified readme to include both temporary and permanent autocomplete
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
removed global completion and added subsections for different shells
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Reworded CLI Usage section
Co-authored-by: hoonman <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
Fixed readme typo
Merge OpenAI main with our fork
Co-authored-by: Tienbruh <[email protected]> Co-authored-by: JesusG2022 <[email protected]>
openai main -> our fork
Moved argcomplete to become an optional dependency
add try except block for importing argcomplete and changes to the readme
README.md
Outdated
pip install openai[cli] | ||
``` | ||
|
||
### Bash & Zsh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: are there existing docs we could link to here instead of listing out all the possible environments here? maybe argcomplete's docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both temporary and permanent argcomplete activation instructions for Fish and Powershell are available on argcomplete's contrib directory. However, only the temporary activation commands for Bash and Zsh are listed on argcomplete's README file. The commands to activate autocompletion permanently for Bash and Zsh are not found anywhere on argcomplete's docs.
What are your opinions on replacing all the other environment activation instructions with the appropriate links to argcomplete's docs, while keeping these lines for permanent activation on Bash and Zsh?
For Bash:
register-python-argcomplete openai >> ~/.bashrc
For Zsh:
register-python-argcomplete openai >> ~/.zshrc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @kwhinnery-openai for docs review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @RobertCraigie, we have refactored our section of the readME file to utilize existing documentation from argcomplete. Let us know if anything else needs to be fixed.
Changes being requested
Contributors: @Tienbruh, @JesusG2022, @hoonman
Our team has implemented auto-completion for various shell environments (Bash, Zsh, PowerShell, and Fish) using argcomplete, a Python library that enables tab completion for argparse. We have integrated argcomplete into the
_cli.py
file, updated thepyproject.toml
file to include argcomplete, and revised theREADME.md
to provide instructions on activating the tab completion feature.Additional context & links
This addresses #843