Rename project to klod, remove duplicate answers

This commit is contained in:
Leo 2026-01-13 11:49:29 +02:00
parent 80002ea195
commit 9fc42f9e3c
2 changed files with 14 additions and 18 deletions

View file

@ -1,4 +1,4 @@
# prompt # klod
A simple, fast CLI tool for chatting with Claude using the Anthropic API with real-time streaming responses. A simple, fast CLI tool for chatting with Claude using the Anthropic API with real-time streaming responses.
@ -21,12 +21,12 @@ A simple, fast CLI tool for chatting with Claude using the Anthropic API with re
```bash ```bash
git clone <your-repo-url> git clone <your-repo-url>
cd anthropic-cli cd anthropic-cli
go build -o prompt go build -o klod
``` ```
2. Create a symlink for global access: 2. Create a symlink for global access:
```bash ```bash
sudo ln -s $(pwd)/prompt /usr/local/bin/prompt sudo ln -s $(pwd)/klod /usr/local/bin/klod
``` ```
Or install via Go: Or install via Go:
@ -37,18 +37,18 @@ go install
## Configuration ## Configuration
The tool looks for configuration files in the following order: The tool looks for configuration files in the following order:
1. `~/.config/prompt/config` (XDG standard location) 1. `~/.config/klod/config` (XDG standard location)
2. `~/.prompt.env` (home directory) 2. `~/.klod.env` (home directory)
3. `.env` in the current directory (for project-specific overrides) 3. `.env` in the current directory (for project-specific overrides)
### Setup your config: ### Setup your config:
```bash ```bash
# Create the config directory # Create the config directory
mkdir -p ~/.config/prompt mkdir -p ~/.config/klod
# Create config file # Create config file
cat > ~/.config/prompt/config << EOF cat > ~/.config/klod/config << EOF
ANTHROPIC_API_KEY=your-api-key-here ANTHROPIC_API_KEY=your-api-key-here
MODEL=claude-sonnet-4-5-20250929 MODEL=claude-sonnet-4-5-20250929
SYSTEM_PROMPT= SYSTEM_PROMPT=
@ -65,7 +65,7 @@ EOF
Start a conversation: Start a conversation:
```bash ```bash
prompt "Hello, how are you?" klod "Hello, how are you?"
``` ```
This will: This will:
@ -79,14 +79,14 @@ Type `exit` or `quit` to end the conversation.
```bash ```bash
# Ask a quick question # Ask a quick question
prompt "What is the capital of France?" klod "What is the capital of France?"
# Start a coding session # Start a coding session
prompt "Help me write a Python function to calculate fibonacci numbers" klod "Help me write a Python function to calculate fibonacci numbers"
# Use a different model (set in config) # Use a different model (set in config)
# Edit your config file and change MODEL=claude-opus-4-5-20251101 # Edit your config file and change MODEL=claude-opus-4-5-20251101
prompt "Explain quantum computing" klod "Explain quantum computing"
``` ```
## Development ## Development

10
main.go
View file

@ -66,8 +66,8 @@ func loadConfig() error {
} }
configPaths := []string{ configPaths := []string{
filepath.Join(homeDir, ".config", "prompt", "config"), // XDG standard filepath.Join(homeDir, ".config", "klod", "config"), // XDG standard
filepath.Join(homeDir, ".prompt.env"), // Home directory filepath.Join(homeDir, ".klod.env"), // Home directory
".env", // Current directory (for project-specific overrides) ".env", // Current directory (for project-specific overrides)
} }
@ -106,7 +106,7 @@ func main() {
// Get initial prompt from command-line arguments // Get initial prompt from command-line arguments
if len(os.Args) < 2 { if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "Usage: prompt <your prompt>") fmt.Fprintln(os.Stderr, "Usage: klod <your prompt>")
os.Exit(1) os.Exit(1)
} }
@ -125,8 +125,6 @@ func main() {
os.Exit(1) os.Exit(1)
} }
fmt.Println(response)
// Add assistant's response to conversation history // Add assistant's response to conversation history
conversationHistory = append(conversationHistory, Message{ conversationHistory = append(conversationHistory, Message{
Role: "assistant", Role: "assistant",
@ -165,8 +163,6 @@ func main() {
continue continue
} }
fmt.Println(response)
// Add assistant's response to conversation history // Add assistant's response to conversation history
conversationHistory = append(conversationHistory, Message{ conversationHistory = append(conversationHistory, Message{
Role: "assistant", Role: "assistant",