Skip to content

Commit 080a818

Browse files
authored
Merge pull request #3 from Tienbruh/hoonbranch
Added bash command requirement for bash in the readme file
2 parents 30f8013 + f95433c commit 080a818

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,3 +642,54 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ope
642642
## Requirements
643643

644644
Python 3.7 or higher.
645+
646+
## Activating CLI Autocomplete
647+
648+
### Using CLI Autocomplete
649+
Using the following sequence of commands for each shell will activate the autocompletion feature for the CLI.
650+
#### Bash
651+
1. Install openai if not installed yet.
652+
```shell
653+
pip install openai
654+
```
655+
656+
2. Configure your shell to support global auto completion for python scripts by running:
657+
```shell
658+
activate-global-python-argcomplete
659+
```
660+
3. Restart your terminal
661+
662+
4. Register ‘openai’ command for argument completion by running:
663+
```shell
664+
eval "$(register-python-argcomplete openai)"
665+
```
666+
667+
Alternatively, run this command to enable argcomplete persistently, eliminating the need to run the eval command every time the terminal is restarted or reloaded. Restart your terminal after using this command.
668+
```shell
669+
register-python-argcomplete openai >> ~/.bashrc
670+
```
671+
672+
5. Try on CLI
673+
```shell
674+
openai <TAB>
675+
```
676+
677+
#### Powershell
678+
1. Install openai if not installed already.
679+
```shell
680+
pip install openai
681+
```
682+
2. Create new completion file:
683+
```shell
684+
register-python-argcomplete --shell powershell openai > ~/openai.psm1
685+
```
686+
687+
3. Open the [``$PROFILE``](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.4&viewFallbackFrom=powershell-7.3#how-to-create-a-profile) by running ``notepad $PROFILE`` and add this following line:
688+
```shell
689+
Import-Module "~/openai.psm1"
690+
```
691+
692+
4. Restart the terminal and try:
693+
```shell
694+
openai <TAB>
695+
```

0 commit comments

Comments
 (0)