Command Line AI- this tool lets you call ChatGPT from a CLI.
I'm designing this to be used in conjunction with a fork of shin, which will allow you
to call clai
from any textbox in your computer. Finally, ChatGPT everywhere!
The long-term vision for this project is to add support for extracting context. For example, it would read the current text on a window and be able to add to it, or answer questions about it.
Read Latest Documentation - Browse GitHub Code Repository
The recommended installation method is to use pipx
, via
pipx install clai
Optionally, install tesseract
so that clai
can read the screen context and send that along with requests:
sudo apt install tesseract-ocr scrot python3-tk python3-dev
Then go to OpenAI and create an API Key. Once it's generated, add the following to
your ~/.profile
:
export OPENAI_API_TOKEN=<paste here>
The best way to use this tool is in conjunction with the tool shin, which allows you
to run arbitrary bash commands in any textbox in a linux computer, using ibus. To use
that, install 'shin' via the fork above, then configure
it in your ~/.profile
to call clai
by default:
export SHIN_DEFAULT_COMMAND="clai"
Log out then log back in for the changes to take effect!
Invoke the assistant with the format clai <your prompt>
. For example:
clai Write an email saying I'll be late to work because I'm working on commandline AIs
poetry install
pytest .
bash .github/format.sh
bash .github/check_lint.sh