Skip to main content

Command Line AI- this tool lets you call ChatGPT from a CLI

Project description

clai

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.


PyPI version Test Status Lint Status codecov Code style: black Imports: isort


Read Latest Documentation - Browse GitHub Code Repository


Installation

  1. 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
    
  2. 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>
    
  3. 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"
    
  4. Log out then log back in for the changes to take effect!

Usage

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

Development

Installing python dependencies

poetry install

Running Tests

pytest .

Formatting Code

bash .github/format.sh

Linting

bash .github/check_lint.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clai-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

clai-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file clai-0.2.0.tar.gz.

File metadata

  • Download URL: clai-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.19.0-35-generic

File hashes

Hashes for clai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 52f60507d4756502aaaea64c69568859a6802709e4566aa57abb781b217db5a6
MD5 3e9b255f82d1942e5b4c5d37b72648e4
BLAKE2b-256 9a45d9f561509ec487024e520204c8f6ab36976bf886ce569ba137e933d30b00

See more details on using hashes here.

File details

Details for the file clai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: clai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.19.0-35-generic

File hashes

Hashes for clai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2857796c3f69047d4dc46a5a1ea10bd21831f3b93b6f531585141ccb1168e98c
MD5 77c26ad0117f3f34dbb49223ed7544dd
BLAKE2b-256 2d9033a69b42a966f3a2b6b0d26a73a0af3edb7dec9e16ebafaa56f828d29450

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page