{"id":13407986,"url":"https://github.com/ad-si/cai","last_synced_at":"2025-10-23T02:42:36.891Z","repository":{"id":230295675,"uuid":"778927791","full_name":"ad-si/cai","owner":"ad-si","description":"The fastest CLI tool for prompting LLMs. Including support for prompting several LLMs at once!","archived":false,"fork":false,"pushed_at":"2025-02-25T11:34:38.000Z","size":1277,"stargazers_count":80,"open_issues_count":9,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T20:06:06.397Z","etag":null,"topics":["ai","anthropic","chatgpt","claude","cli","gpt","gpt-4","gpt-4o","groq","llama","llama3","llamafile","llm","machine-learning","mistral","ml","ollama","openai","prompt","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cai","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ad-si.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-28T17:24:35.000Z","updated_at":"2025-03-26T02:06:22.000Z","dependencies_parsed_at":"2024-07-27T19:17:24.016Z","dependency_job_id":"6348f772-e32d-4cbb-925a-ac0575def089","html_url":"https://github.com/ad-si/cai","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"d213c4de2823eaa345fd364615b2ee903b7265cb"},"previous_names":["ad-si/cai"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fcai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fcai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fcai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fcai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-si","download_url":"https://codeload.github.com/ad-si/cai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249524,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","chatgpt","claude","cli","gpt","gpt-4","gpt-4o","groq","llama","llama3","llamafile","llm","machine-learning","mistral","ml","ollama","openai","prompt","rust"],"created_at":"2024-07-30T20:00:49.993Z","updated_at":"2025-10-23T02:42:36.885Z","avatar_url":"https://github.com/ad-si.png","language":"Rust","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT","Rust"],"sub_categories":[],"readme":"# `cai` - User friendly CLI tool for AI tasks\n\n![Demo usage of cai in a terminal](demos/2025-08-15t2052.png)\n\n\n## Features\n\n- High level commands for great usability\n  - `cai value capital of Australia`\n  - `cai image photo of a banana`\n  - `cai ocr page.png`\n  - `pbpaste | cai rewrite 'more professional'`\n  - Check [usage section](./#usage) for all commands\n- Build with Rust 🦀 for supreme performance and speed! 🏎️\n- Support for models by\n  - [Anthropic]\n  - [OpenAI]\n  - [Google]\n  - [Groq]\n  - [Cerebras]\n  - [Deepseek]\n  - [xAI]\n  - Local LLMs via [Ollama] and [Llamafile]\n- Prompt several models at once. 🤼\n    ![Demo of cai's all command](screenshots/2024-04-13t1627_all.png)\n- Syntax highlighting for better readability of code snippets. 🌈\n\n[Anthropic]: https://docs.anthropic.com/en/docs/about-claude/models/all-models\n[Cerebras]: https://inference-docs.cerebras.ai/introduction\n[Deepseek]: https://api-docs.deepseek.com/quick_start/pricing\n[Google]: https://ai.google.dev/gemini-api/docs/models\n[Groq]: https://console.groq.com/docs/models\n[Llamafile]: https://github.com/Mozilla-Ocho/llamafile\n[Ollama]: https://ollama.com\n[OpenAI]: https://platform.openai.com/docs/models\n[xAI]: https://x.ai/api#pricing\n\n\n## Installation\n\n```sh\n$ cargo install cai\n```\n\nor install via [Homebrew](https://brew.sh/):\n\n```sh\n$ brew install cai\n```\n\n\n## Usage\n\nBefore using Cai, an API key must be set up.\nSimply execute `cai` in your terminal and follow the instructions.\n\nCai supports the following APIs:\n\n- **Groq** - [Create new API key](https://console.groq.com/keys).\n- **OpenAI** - [Create new API key](https://platform.openai.com/api-keys).\n- **Anthropic** -\n    [Create new API key](https://console.anthropic.com/settings/keys).\n- **Llamafile** - Local [Llamafile] server running at http://localhost:8080.\n- **Ollama** - Local [Ollama] server running at http://localhost:11434.\n\nAfterwards, you can use `cai` to run prompts directly from the terminal:\n\n```sh\ncai List 10 fast CLI tools\n```\n\nOr a specific model, like Anthropic's Claude Opus:\n\n```sh\ncai opus list 10 fast CLI tools\n```\n\nFull help output:\n\n```txt\n$ cai help\nCai 0.12.0\n\nUser friendly CLI tool for AI tasks\n\nUsage: cai [OPTIONS] [PROMPT]... [COMMAND]\n\nCommands:\n  fast        Shortcut for `groq openai/gpt-oss-20b`\n  local       Shortcut for `ollama llama3.2`\n  value       Return only the value/answer without explanations\n  rewrite     Fix spelling, grammar, and wording issues in text passed via standard input\n  reply       Reply to a conversation passed via standard input. Add additional reply instructions as the prompt\n  image       Generate an image using GPT-5 image generation [aliases: img]\n  say         Convert text to speech using OpenAI's TTS model [aliases: tts]\n  transcribe  Transcribe an audio file\n  ocr         Extract text from an image\n  rename      Analyze and rename files to timestamp + title (e.g. 2025-08-19t2041_invoice_car.pdf)\n  changelog   Generate a changelog starting from a given commit\n  svg         Generate an SVG graphic from a textual description\n  edit        Open your editor to write the prompt\n              \n              📚 MODELS                                                    \n  all         Simultaneously send prompt to each provider's default model\n  google      Google [aliases: go]\n  gemini      - Gemini Pro shortcut [aliases: ge]\n  flash       - Gemini Flash shortcut [aliases: gf]\n  groq        Groq [aliases: gr]\n  llama       - Llama 3 shortcut [aliases: ll]\n  cerebras    Cerebras [aliases: ce]\n  deepseek    DeepSeek [aliases: ds]\n  openai      OpenAI [aliases: op]\n  gpt5        - GPT-5 shortcut [aliases: gpt, gp]\n  gpt5m       - GPT-5 mini shortcut [aliases: gm]\n  gpt5n       - GPT-5 nano shortcut [aliases: gn]\n  gpt41       - gpt-4.1 shortcut\n  gpt41m      - gpt-4.1-mini shortcut\n  gpt41n      - gpt-4.1-nano shortcut\n  o1p         - o1-pro shortcut\n  anthropic   Anthropic [aliases: an]\n  opus        - Claude Opus [aliases: claude, cl]\n  sonnet      - Claude Sonnet [aliases: so]\n  haiku       - Claude Haiku [aliases: ha]\n  xai         xAI\n  grok        - Grok\n  perplexity  Perplexity [aliases: pe]\n  son         - Sonar\n  sonpro      - Sonar Pro [aliases: sp]\n  sonreas     - Sonar Reasoning [aliases: sr]\n  sonreaspro  - Sonar Reasoning Pro [aliases: srp]\n  sondeep     - Sonar Deep Research [aliases: sdr]\n  llamafile   Llamafile server hosted at http://localhost:8080 [aliases: lf]\n  ollama      Ollama server hosted at http://localhost:11434 [aliases: ol]\n              \n              💻 CODING                                                    \n  bash        Use Bash development as the prompt context\n  c           Use C development as the prompt context\n  cpp         Use C++ development as the prompt context\n  cs          Use C# development as the prompt context\n  docker      Use Docker development as the prompt context\n  elm         Use Elm development as the prompt context\n  fish        Use Fish development as the prompt context\n  fs          Use F# development as the prompt context\n  gd          Use Godot and GDScript development as the prompt context\n  git         Use Git development as the prompt context\n  gl          Use Gleam development as the prompt context\n  golang      Use Go development as the prompt context\n  hs          Use Haskell development as the prompt context\n  java        Use Java development as the prompt context\n  js          Use JavaScript development as the prompt context\n  kt          Use Kotlin development as the prompt context\n  ly          Use LilyPond development as the prompt context\n  lua         Use Lua development as the prompt context\n  nix         Use Nix development as the prompt context\n  oc          Use OCaml development as the prompt context\n  php         Use PHP development as the prompt context\n  pg          Use Postgres development as the prompt context\n  ps          Use PureScript development as the prompt context\n  py          Use Python development as the prompt context\n  rb          Use Ruby development as the prompt context\n  rs          Use Rust development as the prompt context\n  sql         Use SQLite development as the prompt context\n  sw          Use Swift development as the prompt context\n  ts          Use TypeScript development as the prompt context\n  ty          Use Typst development as the prompt context\n  wl          Use Wolfram Language and Mathematica development as the prompt context\n  zig         Use Zig development as the prompt context\n  jq          Use jq development as the prompt context\n  help        Print this message or the help of the given subcommand(s)\n\nArguments:\n  [PROMPT]...  The prompt to send to the AI model\n\nOptions:\n  -r, --raw                        Print raw response without any metadata\n  -j, --json                       Prompt LLM in JSON output mode\n      --json-schema \u003cJSON_SCHEMA\u003e  JSON schema to validate the output against\n  -h, --help                       Print help\n\n\nExamples:\n  # Send a prompt to the default model\n  cai Which year did the Titanic sink\n\n  # Send a prompt to each provider's default model\n  cai all Which year did the Titanic sink\n\n  # Send a prompt to Anthropic's Claude Opus\n  cai anthropic claude-opus Which year did the Titanic sink\n  cai an claude-opus Which year did the Titanic sink\n  cai cl Which year did the Titanic sink\n  cai anthropic claude-opus-4-1 Which year did the Titanic sink\n\n  # Send a prompt to locally running Ollama server\n  cai ollama llama3 Which year did the Titanic sink\n  cai ol ll Which year did the Titanic sink\n\n  # Use the `local` shortcut for using Ollama's default model\n  cai local Which year did the Titanic sink\n\n  # Add data via stdin\n  cat main.rs | cai Explain this code\n\n  # Get raw output without any metadata\n  cai --raw capital of Germany\n\n  # Use a JSON schema to specify the output format\n  cai --json-schema='{\"properties\":{\"age\":{\"type\":\"number\"}},\"required\":[\"age\"]}' gp Barack Obama\n  \n```\n\n\n## Related\n\n- [AI CLI] - Get answers for CLI commands from ChatGPT. (TypeScript)\n- [AIChat] - All-in-one chat and copilot CLI for 10+ AI platforms. (Rust)\n- [clai] - Command line artificial intelligence as a local LLM multi-tool (Go)\n- [Ell] - CLI tool for LLMs written in Bash.\n- [Goose] - Local AI agent.\n- [ja] - CLI / TUI app to work with AI tools. (Rust)\n- [llm] - Access large language models from the command-line. (Python)\n- [smartcat] - Integrate LLMs in the Unix command ecosystem. (Rust)\n- [tgpt] - AI chatbots for the terminal without needing API keys. (Go)\n\n[AI CLI]: https://github.com/abhagsain/ai-cli\n[AIChat]: https://github.com/sigoden/aichat\n[clai]: https://github.com/baalimago/clai\n[Ell]: https://github.com/simonmysun/ell\n[Goose]: https://block.github.io/goose/\n[ja]: https://github.com/joshka/ja\n[llm]: https://github.com/simonw/llm\n[smartcat]: https://github.com/efugier/smartcat\n[tgpt]: https://github.com/aandrew-me/tgpt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fcai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-si%2Fcai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fcai/lists"}