Skip to content

Added activation instructions for zsh and fish to readme #6

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

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 30 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,69 +627,62 @@ In addition to the options provided in the base `OpenAI` client, the following o

An example of using the client with Microsoft Entra ID (formerly known as Azure Active Directory) can be found [here](https://github.com/openai/openai-python/blob/main/examples/azure_ad.py).

## Versioning

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
3. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/openai/openai-python/issues) with questions, bugs, or suggestions.

## 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.
1. Register ‘openai’ command for argument completion by running:
```shell
pip install openai
register-python-argcomplete openai >> ~/.bashrc
```

2. Configure your shell to support global auto completion for python scripts by running:
#### Zsh
1. Register ‘openai’ command for argument completion by running:
```shell
activate-global-python-argcomplete
register-python-argcomplete openai >> ~/.zshrc
```
3. Restart your terminal

4. Register ‘openai’ command for argument completion by running:
#### Fish
1. Register ‘openai’ command for argument completion by running:
```shell
register-python-argcomplete openai >> ~/.bashrc
```

5. Try on CLI
```shell
openai <TAB>
register-python-argcomplete --shell fish openai > ~/.config/fish/config.fish
```

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

3. If you don't already have a ``$PROFILE`` you can add this by running:
2. If you don't already have a ``$PROFILE`` you can add this by running:
```shell
New-Item -ItemType File -Path $PROFILE -Force
```

4. 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:
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"
```

5. Restart the terminal and try:
#### Usage
After completing the appropriate steps for your shell, restart the terminal and try:
```shell
openai <TAB>
```
```

## Versioning

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
3. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/openai/openai-python/issues) with questions, bugs, or suggestions.

## Requirements

Python 3.7 or higher.