Crates.io | simple-claude-cli |
lib.rs | simple-claude-cli |
version | |
source | src |
created_at | 2025-03-07 11:44:39.661709+00 |
updated_at | 2025-03-07 22:29:17.635955+00 |
description | A simple command-line interface for interacting with Claude AI models |
homepage | |
repository | https://github.com/katsuhirohonda/claude-cli |
max_upload_size | |
id | 1582811 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A simple command-line interface for interacting with Claude AI models using the Anthropic API.
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.
Install directly from crates.io:
cargo install simple-claude-cli
This will install the claude
command in your PATH.
Clone the repository and build the project:
git clone https://github.com/katsuhirohonda/simple-claude-cli.git
cd simple-claude-cli
cargo build --release
The compiled binary will be available at target/release/claude
.
export ANTHROPIC_API_KEY=your_api_key_here
claude
Enter your questions or prompts. For multi-line input:
///
on a new line to submit your full messageType exit
, quit
, or press Enter on an empty line to end the conversation.
You can customize Claude's behavior using environment variables:
export CLAUDE_MODEL="claude-3-7-sonnet-20250219"
By default, the application uses claude-3-5-haiku-latest
.
Control the maximum length of Claude's responses:
export CLAUDE_MAX_TOKENS=4000
By default, responses are limited to 1024 tokens.
You can set a custom system prompt:
export CLAUDE_SYSTEM_PROMPT="You are a cybersecurity expert focused on threat analysis."
Choose from several predefined personas:
export CLAUDE_PERSONA="engineer" # 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 carefullyYou can also set a custom persona directly:
export CLAUDE_PERSONA="You are a financial advisor specializing in retirement planning."
When configuring Claude's behavior:
CLAUDE_SYSTEM_PROMPT
is set, it will be used as the system prompt.CLAUDE_PERSONA
is set, it will be used as the system prompt.CLAUDE_PERSONA
and CLAUDE_SYSTEM_PROMPT
are set, CLAUDE_PERSONA
takes precedence and CLAUDE_SYSTEM_PROMPT
is ignored.For example, if you set:
export CLAUDE_SYSTEM_PROMPT="You are a cybersecurity expert."
export CLAUDE_PERSONA="engineer"
Claude will use "You are an excellent software engineer." as the system prompt, ignoring the cybersecurity expert setting.
anthropic-ai-sdk
: Official Anthropic AI SDK for Rusttokio
: Asynchronous runtime for Rusttracing
: Logging and diagnosticscolored
: Terminal text coloringContributions are welcome! Please feel free to submit a Pull Request.