Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhagsain/ai-cli
Get answers for CLI commands from ChatGPT right from your terminal
https://github.com/abhagsain/ai-cli
ai chatgpt cli gpt3 gpt3-cli openai
Last synced: 7 days ago
JSON representation
Get answers for CLI commands from ChatGPT right from your terminal
- Host: GitHub
- URL: https://github.com/abhagsain/ai-cli
- Owner: abhagsain
- License: gpl-3.0
- Created: 2022-11-07T04:21:30.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T19:07:00.000Z (about 1 year ago)
- Last Synced: 2025-02-01T15:05:55.647Z (14 days ago)
- Topics: ai, chatgpt, cli, gpt3, gpt3-cli, openai
- Language: TypeScript
- Homepage:
- Size: 276 KB
- Stars: 1,154
- Watchers: 12
- Forks: 62
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-ChatGPT - ai-cli
- awesome-ChatGPT-repositories - ai-cli - Get answers for CLI commands from GPT3 right from your terminal (CLIs)
- awesome-chatgpt - ai-cli
- awesome-chatgpt - abhagsain/ai-cli - A command-line interface for ChatGPT, allowing users to get answers for CLI commands from GPT3 directly in their terminal. (UIs / CLI)
- project-awesome - abhagsain/ai-cli - Get answers for CLI commands from ChatGPT right from your terminal (TypeScript)
- jimsghstars - abhagsain/ai-cli - Get answers for CLI commands from ChatGPT right from your terminal (TypeScript)
README
GPT3 Powered CLI
![image](https://user-images.githubusercontent.com/36589645/202654014-c1884be3-76d5-4b64-81d1-e3f1169fcb46.png)
### Installation
You'd need to install it globally
```
npm i @abhagsain/ai-cli -g
```Usage
```
$ ai ask "Check process running on port"
```You'd need to enter your own OpenAI API key
Here's how you can get one1. Go to https://openai.com/api/login
2. Create an account or log into your existing account
3. Go to https://beta.openai.com/account/api-keys or
![]()
4. Run `ai auth`, enter your API KEY and you're good to go!Pricing
The current prompt length is `~800` tokens and average response length is `~40` tokens. The pricing for [`gpt-3.5-turbo`](https://openai.com/api/pricing/) is `$0.001` per `1K` input tokens and `$0.002` per `1K` output tokens which is ~`$0.0009/command`. We'll see if we can improve the response as well as reduce the per-command-cost with fine-tuning.
___
Add autocomplete by running `ai autocomplete` and follow the instructions. It's super easy.
__
### Liked this project? Checkout my other side project. [SlidesAI.io - AI Presentation Maker](https://slidesai.io/?ref=ai-cli)
__Auto generated documentation
* [Usage](#usage)
* [Commands](#commands)# Usage
```sh-session
$ npm install -g @abhagsain/ai-cli
$ ai COMMAND
running command...
$ ai (--version)
@abhagsain/ai-cli/1.3.0 darwin-arm64 node-v18.0.0
$ ai --help [COMMAND]
USAGE
$ ai COMMAND
...
```# Commands
* [`ai ask [question]`](#ai-ask-question)
* [`ai auth`](#ai-auth)
* [`ai autocomplete [SHELL]`](#ai-autocomplete-shell)
* [`ai help [COMMAND]`](#ai-help-command)
* [`ai model`](#ai-model)
* [`ai update [CHANNEL]`](#ai-update-channel)## `ai ask [question]`
Ask question to GPT3 from your terminal
```
USAGE
$ ai ask [question]ARGUMENTS
QUESTION Your questionDESCRIPTION
Ask question to GPT3 from your terminalEXAMPLES
$ ai ask "Check running process on port 3000"
```_See code: [dist/commands/ask.ts](https://github.com/abhagsain/ai-cli/blob/v1.3.0/dist/commands/ask.ts)_
## `ai auth`
Update existing or add new OpenAI API Key
```
USAGE
$ ai authDESCRIPTION
Update existing or add new OpenAI API KeyEXAMPLES
$ ai auth (Follow the prompt)
```_See code: [dist/commands/auth.ts](https://github.com/abhagsain/ai-cli/blob/v1.3.0/dist/commands/auth.ts)_
## `ai autocomplete [SHELL]`
display autocomplete installation instructions
```
USAGE
$ ai autocomplete [SHELL] [-r]ARGUMENTS
SHELL shell typeFLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)DESCRIPTION
display autocomplete installation instructionsEXAMPLES
$ ai autocomplete$ ai autocomplete bash
$ ai autocomplete zsh
$ ai autocomplete --refresh-cache
```_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.6/src/commands/autocomplete/index.ts)_
## `ai help [COMMAND]`
Display help for ai.
```
USAGE
$ ai help [COMMAND] [-n]ARGUMENTS
COMMAND Command to show help for.FLAGS
-n, --nested-commands Include all nested commands in the output.DESCRIPTION
Display help for ai.
```_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.17/src/commands/help.ts)_
## `ai model`
Change model preference (default: gpt-3.5-turbo)
```
USAGE
$ ai modelDESCRIPTION
Change model preference (default: gpt-3.5-turbo)EXAMPLES
$ ai model (Follow the prompt)
```_See code: [dist/commands/model.ts](https://github.com/abhagsain/ai-cli/blob/v1.3.0/dist/commands/model.ts)_
## `ai update [CHANNEL]`
update the ai CLI
```
USAGE
$ ai update [CHANNEL] [-a] [-v | -i] [--force]FLAGS
-a, --available Install a specific version.
-i, --interactive Interactively select version to install. This is ignored if a channel is provided.
-v, --version= Install a specific version.
--force Force a re-download of the requested version.DESCRIPTION
update the ai CLIEXAMPLES
Update to the stable channel:$ ai update stable
Update to a specific version:
$ ai update --version 1.0.0
Interactively select version:
$ ai update --interactive
See available versions:
$ ai update --available
```_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.7/src/commands/update.ts)_