Skip to main content

Command-line interface for OpenAI ChatGPT

Project description

CliAI

GitHub PyPI

CliAI is a user-friendly Python package that lets you interact with OpenAI's ChatGPT via a command-line interface (CLI). Easily test and prototype chatbots, language models, and innovative ideas without writing any code.

Installation

Install CliAI using pip:

pip install cliai

CliAI requires Python 3.8 or higher.

Usage and Tips

Start an interactive conversation by running:

cliai chat

The CLI will guide you through the process to create a configuration.

You can also specify an API key by setting the environment variable export OPENAI_API_KEY="your-key" or by using the --api-key <OPENAI_API_KEY> flag.

Bypass OpenAI Restrictions

In certain regions (e.g., China), connecting to OpenAI may be problematic. Bypass these restrictions by changing the official API base URL to a custom one using the --api-base flag.

cliai chat --api-base <OPENAI_API_BASE>

Make it portable

You can use Linux on your mobile device to install CliAI.

For iOS & iPadOS, use iSH.

Prompt Injection

During chat mode, you can easily modify messages. In addition to changing your own input (user), you can tweak the model's response (assistant) and system prompt (system) to guide the conversation as desired. Also you can use fine-tuning parameters to adjust the model's behaviour.

Experiment and enjoy hacking the model!

Debugging

--verbose: Enable verbose output for easier debugging. --stream: Enable stream output in the response (experimental).

License

CliAI is distributed under the MIT license. See LICENSE for more information.

To contribute to this project, feel free to raise issues or submit code.

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

cliai-0.2.9.tar.gz (22.3 kB view hashes)

Uploaded Source

Built Distribution

cliai-0.2.9-py3-none-any.whl (24.1 kB view hashes)

Uploaded Python 3

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