chatgpt-cli  by kardolus

CLI tool for interacting with LLMs like OpenAI, Azure, Perplexity, and Llama

created 2 years ago
749 stars

Top 47.3% on sourcepulse

GitHubView on GitHub
Project Summary

This CLI tool provides a powerful command-line interface for interacting with large language models from providers like OpenAI, Azure, and Perplexity AI. It is designed for both casual users and developers who need a flexible and feature-rich way to leverage LLMs, offering features like streaming, prompt management, and multimedia support.

How It Works

The tool operates via a command-line interface, supporting various interaction modes: streaming for real-time responses, query mode for single input-output, and interactive mode for conversational exchanges. It manages conversation history using a thread-based system with a sliding window to maintain context within token limits. The CLI also supports piping data from any source, including files and other programs, and can process image and audio inputs, as well as generate speech outputs.

Quick Start & Requirements

  • Installation: Homebrew (brew install kardolus/chatgpt-cli), or direct binary download for macOS, Linux, and Windows.
  • Prerequisites: An API key for the chosen LLM provider (OpenAI, Azure, Perplexity AI).
  • Configuration: Set OPENAI_API_KEY environment variable or configure via config.yaml.
  • Docs: https://github.com/kardolus/chatgpt-cli

Highlighted Details

  • Supports OpenAI, Azure OpenAI, Perplexity AI, and Llama models.
  • Features real-time streaming, interactive modes, and thread-based context management.
  • Enables image and audio input/output, plus text-to-speech capabilities.
  • Allows custom context injection from any source via piping.
  • Offers command-line autocompletion for Bash, Zsh, Fish, and PowerShell.

Maintenance & Community

The project is actively maintained, with contributions encouraged via GitHub issues. Community discussions can be found on Reddit.

Licensing & Compatibility

The project is licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

Image and audio support are model-dependent and may not be available for all LLM versions. The text-to-speech feature requires afplay on macOS for chained playback.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
3
Star History
72 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.