Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicolodiamante/zchat
Elevate your Terminal's efficiency: harness the unbeatable auto-complete power through seamless ChatGPT integration!
https://github.com/nicolodiamante/zchat
ai auto-complete auto-completion chat-completion chatgpt command-line copilot-chat ohmyzsh ohmyzsh-customize ohmyzsh-plugin openai openai-api openai-chatgpt terminal terminal-ai terminal-chatgpt zsh zsh-plugin
Last synced: 3 days ago
JSON representation
Elevate your Terminal's efficiency: harness the unbeatable auto-complete power through seamless ChatGPT integration!
- Host: GitHub
- URL: https://github.com/nicolodiamante/zchat
- Owner: nicolodiamante
- License: other
- Created: 2023-05-29T09:19:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-17T08:25:19.000Z (11 months ago)
- Last Synced: 2024-11-20T15:02:38.883Z (2 months ago)
- Topics: ai, auto-complete, auto-completion, chat-completion, chatgpt, command-line, copilot-chat, ohmyzsh, ohmyzsh-customize, ohmyzsh-plugin, openai, openai-api, openai-chatgpt, terminal, terminal-ai, terminal-chatgpt, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 50.8 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Boost your productivity and enhance your terminal experience using Zchat (zch). This command-line productivity tool is powered by OpenAI's ChatGPT models. With Zchat, you don't need to scour the web for Linux commands and code snippets. Simply type in comprehensive language queries and let the system generate the results for you. Zchat's AI capabilities provide precise responses directly in your terminal, saving your time and effort. Additionally, Zchat's intuitive Git integration simplifies your version control processes – bidding farewell to cheat sheets and notes. With Zchat, complete tasks quickly and conveniently.
## Create your OpenAI API Key
To utilise Zchat, you initially need to procure the API key. You can generate this key from your OpenAI account, which will subsequently be used for authentication. Here's how to get your API key:
1. Sign in to your [OpenAI account][open-ai-account].
2. Search for the "Create new secret key" option and select it.This API key serves as your passport to access and engage with Zchat.
Once you have obtained your [API Key][open-ai-API], integrating ChatGPT's services with Zchat is straightforward. Note that once you have copied the API Key and closed the pop-up window, you will no longer be able to access and view the key, making it essential that you store it in a secure and safe place.
## Getting Started
Here are the two methods you can choose from:
**Automatic Download via `curl`:** Simply execute the following command in your terminal to quickly download and seamlessly install the utility:
```shell
zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nicolodiamante/zchat/HEAD/bootstrap.zsh)"
```**Manual Cloning:** For those who prefer a hands-on approach, you can manually clone the repository:
```shell
git clone https://github.com/nicolodiamante/zchat.git ~/zchat
```
### Post-Download Steps
**Directory Navigation & Script Execution:** Navigate to the root directory of the repository, and then execute the installation script using the following command:
```shell
source utils/install.zsh
```**Zchat Configuration:** This script aims to locate the `zshrc` file, then appends the path `zchat/script` to the `fpath` variable, and sets the `OPENAI_API_KEY` variable.
```shell
# Zchat path.
fpath=(~/zchat/script $fpath)
autoload -Uz zchat
```
### Install via [Oh My Zsh][ohmyzsh]
```shell
git clone https://github.com/nicolodiamante/zchat.git $ZSH_CUSTOM/plugins/zchat
```- Add to your zshrc plugins array `plugins=(... zchat)`
- Paste your API Key at the `OPENAI_API_KEY` variable in your zshrc.
- Restart the shell to activate.
### Setting up dependencies
After completing the installation process, configuration of the Zchat application is required. This step involves inserting the OpenAI API Key into the OPENAI_API_KEY variable located in the .zshrc file. By default, the script uses the GPT-4 Turbo model. However, access to GPT-4 APIs, including both GPT-4 and GPT-4 Turbo, may be limited and generally requires a proven history of successful transactions with OpenAI. If the necessary criteria for accessing GPT-4 or GPT-4 Turbo are not met, or if an alternative model is desired, the script can be adapted to utilise other models, such as GPT-3.5-Turbo. In instances where neither GPT-4 Turbo nor GPT-4 is accessible, opting for GPT-3.5-Turbo is advised.
```shell
# Zchat dependencies.
export OPENAI_API_KEY=
```> For Zchat to function properly, jq must be installed on your operating system. The script will automatically check for this software. If it isn't detected, the script will proceed with the necessary installation.
## How to use Zchat
```shell
zch
```### Completion
1. To initiate the completion, simply type 'zch' followed by the command that you want to use for your query.
2. After formulating your query in natural language, press the 'Enter' key to execute it.
## Notes
Upon launching Zchat, the script automatically checks whether you're in a Git repository. If it determines that you are, Zchat will present relevant Git commands and provide guidance. If you're not in a Git repository, Zchat assists you in accessing the appropriate command line tools to find the most effective solution for your task.
### Resources
#### OpenAI
- [OpenAI Documentation][intro]
- [OpenAI Models][open-ai-models]
- [OpenAI Chat][chat-completions]#### Zsh Documentations
- [Documentation Index][zsh-docs]
- [User Guide][zsh-docs-guide]### Contribution
Thank you for considering using Zchat. Any suggestions or feedback you may have for improvement are welcome. If you encounter any issues or bugs, please report them on the [issues page][issues].
>
[open-ai-account]: https://chat.openai.com/auth/login
[open-ai-API]: https://beta.openai.com/account/api-keys
[open-ai-models]: https://platform.openai.com/docs/models
[intro]: https://platform.openai.com/docs/introduction
[chat-completions]: https://platform.openai.com/docs/guides/chat
[ohmyzsh]: https://github.com/robbyrussell/oh-my-zsh/
[zsh-docs]: http://zsh.sourceforge.net/Doc
[zsh-docs-guide]: http://zsh.sourceforge.net/Guide/zshguide.html
[issues]: https://github.com/nicolodiamante/zchat/issues