Project

clai

0.0
No release in over a year
Your personal AI for the terminal
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 5.1, >= 5.1.1
~> 1.2, >= 1.2.2
~> 2.6, >= 2.6.8
 Project Readme

CLAI - CLI + AI in your terminal

MIT Ruby ChatGPT

Demo

CLAI (CLI + AI = CLAI) allows you to interact with the OpenAI API in your terminal.

Installation

First, ensure that you have Ruby installed on your system. Then, you can install the gem by running:

gem install clai

Configuration

Before using the CLI tool, you need to configure it with your OpenAI API key. You can obtain an API key from the OpenAI website. Once you have your API key, run the following command and provide your key when prompted:

clai setup

This will create a configuration file (~/.config/clai/clai.yml) on your system.

Read more about the setup command here.

Usage

You can chat with ChatGPT with:

// Basic single command
clai chat "Tell me a funny joke"

// Use a preconfigured persona
clai chat "Count to 10" --persona ruby

This will send the given prompt to the API and display the generated completion.

Read more about the chat command here.

Starting a session

You can start an interactive session with clai session command.

clai session
Your prompt: <Enter your prompt here><Enter>

This will start a REPL like process to interact with the OpenAI api.

Read more about the session command here.

Help

To view the available commands and options, you can use the help command:

clai help

This will display a list of supported commands and their descriptions.

Examples

Here are a few examples to get you started:

# Setup clai on your machine
clai setup

# Start an interactive chat session
clai session

# Get help about the available commands and options
clai help

# Send a single prompt
clai chat "Hello World"

Contributing

Please read CONTRIBUTING.md for more information.

Disclaimer

This is alpha software. Make sure to set a billing limit for your api key or unexpected costs will occur.

License

This project is licensed under the MIT License.