simple-claude-cli
A simple command-line interface for interacting with Claude AI models using the Anthropic API.
Overview
simple-claude-cli allows you to easily interact with Claude AI directly from your terminal. It uses the official Anthropic AI SDK to connect to Claude's API and stream responses in real-time.
Features
- Real-time streaming of Claude's responses
- Colored terminal output for better readability
- Simple, intuitive interface
- Uses Claude 3 Haiku by default
- Customizable system prompts and predefined personas
Prerequisites
- Rust and Cargo installed
- An Anthropic API key (get one from Anthropic's website)
Installation
From crates.io
Install directly from crates.io:
This will install the claude command in your PATH.
From Source
Clone the repository and build the project:
The compiled binary will be available at target/release/claude.
Usage
- Set your Anthropic API key as an environment variable:
- Run the application:
- Enter your question or prompt when prompted.
Configuration
You can customize Claude's behavior using environment variables:
Change the Claude model
By default, the application uses claude-3-haiku-20240229.
Custom system prompts
You can set a custom system prompt:
Predefined personas
Choose from several predefined personas:
# Software engineering expert
Available personas:
engineer- Software engineering expertwriter- Creative writer with excellent language skillsscientist- Scientist with expertise in various fieldsteacher- Patient teacher who explains concepts clearlychef- Professional chef with culinary knowledgetherapist- Compassionate therapist who listens carefully
You can also set a custom persona directly:
If neither CLAUDE_PERSONA nor CLAUDE_SYSTEM_PROMPT is set, Claude will use a default helpful assistant prompt.
Dependencies
anthropic-ai-sdk: Official Anthropic AI SDK for Rusttokio: Asynchronous runtime for Rusttracing: Logging and diagnosticscolored: Terminal text coloring
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.