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.3.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

clai-0.3.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clai-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 3ffefda5c5b1ec25460cfcd435529653aae1d88da27e781a9de90e880e4d12a2
MD5 ba9e5ef206fdcfdced25aef321d9d61c
BLAKE2b-256 0ca40dd429ad692d09b1d01584ee53a85628529b61ee5f289b51ea8f7c8e8ac9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 635b3f797bb02b09d45826686a3e6313eca1ae2eb6d055ae74c1972b280035da
MD5 1ad6d53918d82b9efe9f1a123ede6f34
BLAKE2b-256 06b9ca8fe7b0ecaf369f1c9b5dad2baa01a9942822502f9ee14b1b237385de17

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