1.8 KiB
1.8 KiB
Klod
Klod (pronounced \klod\), a simple Go-based CLI tool for interacting with the Anthropic API
Motivation
Sometimes you just need to quickly check/ask an LLM something. I basically live in the terminal so I want to avoid the context switch to a browser. Claude code on the other hand is a bit too eager to help (which has its benefits but no necessarily for your quick short messages). Therefore I quickly stiched together klod, originally in bash, still living as ./main.sh at the root of the project.
Features
- Maintains conversation history within a session
- Configurable model and system prompts
Requirements
- Go 1.21 or higher
- Anthropic API key (get one here)
Installation
- Clone and build:
git clone https://github.com/leoalho/klod.git
cd anthropic-cli
go build
- Create a symlink for global access:
sudo ln -s $(pwd)/klod /usr/local/bin/klod
Or install via Go:
go install
Configuration
The tool looks for configuration files in the following order:
~/.config/klod/config(XDG standard location)~/.klod.env(home directory).envin the current directory (for project-specific overrides)
Configuration options:
ANTHROPIC_API_KEY(required): Your Anthropic API keyMODEL(optional): Model to use (default: claude-sonnet-4-5-20250929)SYSTEM_PROMPT(optional): Custom system prompt for Claude
Usage
Start a conversation:
klod Hello, how are you?
This will:
- Send your initial message to Claude
- Stream the response in real-time
- Enter an interactive chat mode where you can continue the conversation
Type exit or quit to end the conversation.
Development
Run without building:
go run main.go your message here