Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hk-gosuto/ai-cli-core
Get answers for CLI commands from GPT3 right from your terminal
https://github.com/hk-gosuto/ai-cli-core
Last synced: 8 days ago
JSON representation
Get answers for CLI commands from GPT3 right from your terminal
- Host: GitHub
- URL: https://github.com/hk-gosuto/ai-cli-core
- Owner: Hk-Gosuto
- License: gpl-3.0
- Created: 2023-02-13T14:16:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T12:58:07.000Z (almost 2 years ago)
- Last Synced: 2025-01-04T04:47:59.793Z (20 days ago)
- Language: C#
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Dotnet GPT3 Powered CLI
============![GitHub stars](https://img.shields.io/github/stars/Hk-Gosuto/ai-cli-core)
![Commit Date](https://img.shields.io/github/last-commit/Hk-Gosuto/ai-cli-core/main.svg?logo=github&logoColor=green&label=commit)
![GitHub license](https://img.shields.io/github/license/Hk-Gosuto/ai-cli-core)[![NuGet][nuget-badge] ![NuGet Downloads][nuget-download-badge]][nuget]
[nuget]: https://www.nuget.org/packages/dotnet-ai-core/
[nuget-badge]: https://img.shields.io/nuget/v/dotnet-ai-core.svg?style=flat-square
[nuget-download-badge]: https://img.shields.io/nuget/dt/dotnet-ai-core?style=flat-squareThis project is the .NET version of [ai-cli](https://github.com/abhagsain/ai-cli) project.
### Get started
[Install .NET 7 or newer](https://get.dot.net) and run this command:
```
$ dotnet tool install --global dotnet-ai-core
```Usage
```
$ dotnet-ai-core 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 `~840` tokens and the pricing for [`text-davinci-002`](https://openai.com/api/pricing/) is `$0.02` for `1K` tokens which is ~`$0.017/command`. We'll see if we can improve the response as well as reduce the per-command-cost with fine-tuning.
# Usage
```sh-session
$ dotnet tool install --global dotnet-ai-core
$ dotnet-ai-core
...
```# Commands
- [Dotnet GPT3 Powered CLI](#dotnet-gpt3-powered-cli)
- [Get started](#get-started)
- [Usage](#usage)
- [Commands](#commands)
- [`dotnet-ai-core ask [question]`](#dotnet-ai-core-ask-question)
- [`dotnet-ai-core auth`](#dotnet-ai-core-auth)
- [`dotnet-ai-core model`](#dotnet-ai-core-model)## `dotnet-ai-core ask [question]`
Ask question to GPT3 from your terminal
```
USAGE
$ dotnet-ai-core ask [question]ARGUMENTS
QUESTION Your questionDESCRIPTION
Ask question to GPT3 from your terminalEXAMPLES
$ dotnet-ai-core ask "Check running process on port 3000"
```## `dotnet-ai-core auth`
Update existing or add new OpenAI API Key
```
USAGE
$ dotnet-ai-core authDESCRIPTION
Update existing or add new OpenAI API KeyEXAMPLES
$ dotnet-ai-core auth (Follow the prompt)
```## `dotnet-ai-core model`
Change model preference (default: text-davinci-003)
```
USAGE
$ dotnet-ai-core modelDESCRIPTION
Change model preference (default: text-davinci-003)EXAMPLES
$ dotnet-ai-core model (Follow the prompt)
```