AI is with you.
Powered by OpenAI API
$ brew install koki-develop/tap/askai
$ go install github.com/koki-develop/askai@latest
Download the binary from the releases page.
$ 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
First, run askai
with the --configure
flag set.
$ 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.
- 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 executingaskai
, if there is no.askai
in the current directory.
By passing a question as an argument to askai
, you can obtain an answer from AI.
$ askai 'Please write a program in Go that outputs "Hello world”.'
By running askai
with the -i
or --interactive
flag set, you can ask questions to AI in an interactive manner.
$ askai -i
You can also pass questions from stdin.
# 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.
$ cat README.md | askai 'Please summarize this content'