Skip to content

Commit

Permalink
Add help output to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Apr 14, 2024
1 parent 4994355 commit 1d1483e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 6 deletions.
21 changes: 19 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ demo.gif: demo.tape
vhs $<


.PHONY: test
test:
source_files=$(shell find src -type f)
.INTERMEDIATE: usage.txt
usage.txt: $(source_files)
cargo run -- help > usage.txt


readme.md: usage.txt
sd --flags s \
'cai help.+\`\`\`' \
"cai help\n$$(cat $<)\n\`\`\`" \
$@


.PHONY: test-rust
test-rust:
cargo test -- --show-output


.PHONY: test
test: test-rust readme.md


.PHONY: install
install:
cargo install --path .
46 changes: 42 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# `cai` - The fastest CLI tool for prompting LLMs


## Features

- Build with Rust 🦀 for supreme performance and speed! 🏎️
Expand Down Expand Up @@ -53,10 +52,49 @@ Or a specific model, like Anthropic's Claude Opus:
cai op List 10 fast CLI tools
```

For more information, run:
Full help output:

```sh
cai help
```txt
$ cai help
Cai 0.4.0
The fastest CLI tool for prompting LLMs
Usage: cai [PROMPT]...
cai <COMMAND>
Commands:
mixtral Groq's Mixtral [aliases: mi]
gpt-turbo OpenAI's GPT 4 Turbo [aliases: tu]
gpt OpenAI's GPT 4 [aliases: gp]
claude-opus Anthropic's Claude Opus [aliases: op]
claude-sonnet Anthropic's Claude Sonnet [aliases: so]
claude-haiku 🏆 Default | Anthropic's Claude Haiku [aliases: ha]
local Local model hosted at http://localhost:8080 (e.g. Llamafile) [aliases: lo]
all Send the prompt to every provider's default model simultaneously (Claude Haiku, Groq Mixtral, GPT 4 Turbo,
Local)
help Print this message or the help of the given subcommand(s)
Arguments:
[PROMPT]... The prompt to send to the AI model
Options:
-h, --help Print help
Examples:
# Send a prompt to the default model
cai How heigh is the Eiffel Tower in meters
# Send a prompt to the default model of each provider
cai all How heigh is the Eiffel Tower in meters
# Send a prompt to Anthropic's Claude Opus (+ alias)
cai claude-opus How heigh is the Eiffel Tower in meters
cai op How heigh is the Eiffel Tower in meters
# Add data via stdin
cat main.rs | cai Explain this code
```


Expand Down

0 comments on commit 1d1483e

Please sign in to comment.