https://github.com/koki-develop/askai
🤖 AI is with you.
https://github.com/koki-develop/askai
chatgpt cli openai
Last synced: 3 months ago
JSON representation
🤖 AI is with you.
- Host: GitHub
- URL: https://github.com/koki-develop/askai
- Owner: koki-develop
- License: mit
- Created: 2023-09-16T02:46:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T22:27:11.000Z (over 1 year ago)
- Last Synced: 2024-09-28T13:44:46.031Z (over 1 year ago)
- Topics: chatgpt, cli, openai
- Language: Go
- Homepage:
- Size: 2.63 MB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
askai
AI is with you.
Powered by OpenAI API
## Contents
- [Installation](#installation)
- [Usage](#usage)
- [Getting Started](#getting-started)
- [LICENSE](#license)
## Installation
### Homebrew Tap
```console
$ brew install koki-develop/tap/askai
```
### `go install`
```console
$ go install github.com/koki-develop/askai@latest
```
### Releases
Download the binary from the [releases page](https://github.com/koki-develop/askai/releases/latest).
## Usage
```console
$ askai --help
AI is with you.
Usage:
askai [flags] [question]
Flags:
-k, --api-key string the OpenAI API key
--configure configure askai
-g, --global configure askai globally (only for --configure)
-h, --help help for askai
-i, --interactive interactive mode
-m, --model string the chat completion model to use (default "gpt-3.5-turbo")
-v, --version version for askai
```
## Getting Started
### Setup
First, run `askai` with the `--configure` flag set.
```console
$ askai --configure
```
Upon doing this, an interactive setup session will be initiated.
Input the following items:
- OpenAI API Key: API key created on [the OpenAI platform](https://platform.openai.com).
- Model: The chat completion model to use. (Available: `gpt-4`, `gpt-4-0613`, `gpt-4-32k`, `gpt-4-32k-0613`, `gpt-3.5-turbo`, `gpt-3.5-turbo-0613`, `gpt-3.5-turbo-16k`, `gpt-3.5-turbo-16k-0613`)
Once the setup is completed, a configuration file named `.askai` will be created.
Now, you are all set.
> [!NOTE]
> If you run `askai --configure` with the `--global` flag set, the configuration file will be created as `$HOME/.askai`.
> This file is referred to when executing `askai`, if there is no `.askai` in the current directory.
### Ask a question to AI
By passing a question as an argument to `askai`, you can obtain an answer from AI.
```console
$ askai 'Please write a program in Go that outputs "Hello world”.'
```

### Ask a question to AI interactively
By running `askai` with the `-i` or `--interactive` flag set, you can ask questions to AI in an interactive manner.
```console
$ askai -i
```

### Pass a question from stdin
You can also pass questions from stdin.
```sh
# pipe
$ echo 'QUESTION' | askai
# file
$ askai < question.txt
```
You can pass both input from stdin and arguments at the same time.
By utilizing this, for example, you can also summarize the contents of a specific file.
```console
$ cat README.md | askai 'Please summarize this content'
```

## LICENSE
[MIT](./LICENSE)