Skip to content

Commit

Permalink
Merge pull request #3 from Tienbruh/hoonbranch
Browse files Browse the repository at this point in the history
Added bash command requirement for bash in the readme file
  • Loading branch information
hoonman authored Aug 2, 2024
2 parents 30f8013 + f95433c commit 080a818
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,3 +642,54 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ope
## Requirements

Python 3.7 or higher.

## Activating CLI Autocomplete

### Using CLI Autocomplete
Using the following sequence of commands for each shell will activate the autocompletion feature for the CLI.
#### Bash
1. Install openai if not installed yet.
```shell
pip install openai
```

2. Configure your shell to support global auto completion for python scripts by running:
```shell
activate-global-python-argcomplete
```
3. Restart your terminal

4. Register ‘openai’ command for argument completion by running:
```shell
eval "$(register-python-argcomplete openai)"
```

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.
```shell
register-python-argcomplete openai >> ~/.bashrc
```

5. Try on CLI
```shell
openai <TAB>
```

#### Powershell
1. Install openai if not installed already.
```shell
pip install openai
```
2. Create new completion file:
```shell
register-python-argcomplete --shell powershell openai > ~/openai.psm1
```

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:
```shell
Import-Module "~/openai.psm1"
```

4. Restart the terminal and try:
```shell
openai <TAB>
```

0 comments on commit 080a818

Please sign in to comment.