chatblade  by npiv

CLI tool for interacting with OpenAI's ChatGPT

created 2 years ago
2,611 stars

Top 18.4% on sourcepulse

GitHubView on GitHub
Project Summary

This tool provides a powerful command-line interface for interacting with OpenAI's ChatGPT models, designed for developers and power users who need to integrate AI into their workflows. It streamlines complex interactions by allowing piped input, session management, and flexible output formatting, significantly enhancing productivity when working with LLMs from the terminal.

How It Works

Chatblade acts as a sophisticated wrapper around the OpenAI API, accepting input via standard input, arguments, or both. It supports conversation history management through named sessions, allowing users to maintain context across multiple interactions. The tool offers granular control over model selection (including GPT-3.5, GPT-4, and GPT-4o variants) and output processing, with options to extract raw text, code blocks, or JSON directly from responses.

Quick Start & Requirements

  • Install: pip install chatblade or brew install chatblade
  • Prerequisites: OpenAI API key (set as OPENAI_API_KEY environment variable or passed via --openai-api-key).
  • Documentation: https://github.com/npiv/chatblade

Highlighted Details

  • Supports conversation history via named sessions (-S) and a default last session (-l).
  • Enables direct extraction of JSON or code blocks from responses using -e.
  • Allows custom system prompts via -p for tailored AI behavior.
  • Provides token count and estimated cost calculation with -t.

Maintenance & Community

The project is actively maintained by npiv. Further community engagement details are not explicitly provided in the README.

Licensing & Compatibility

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

Limitations & Caveats

The streaming output is noted as experimental. Configuration for Azure OpenAI requires specific environment variables (OPENAI_API_TYPE, AZURE_OPENAI_ENDPOINT, OPENAI_API_AZURE_ENGINE) which override model selection flags.

Health Check
Last commit

9 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
16 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.