← all repositories
efugier/smartcat

cat finally learns to read

A Rust CLI that pipes your text through actual language models, turning Unix pipes into LLM workflows.

566 stars Rust Coding Assistants
smartcat
Velocity · 7d
+0.6
★ / day
Trend
steady
star history

What it does

smartcat (or sc) is a Rust CLI that slots language models into standard Unix text streams. You pipe text in, it hits an LLM API, and pipes text back out. The gimmick is editor integration: select text in Vim/Helix/Kakoune, run :'<,'>!sc "your instruction", and the selection gets replaced with the model’s output. It supports Ollama for local runs, plus Anthropic, OpenAI, Mistral, Groq, and Azure for remote APIs.

The interesting bit

The whole thing hinges on a dead-simple insight: LLMs are terrible CLI citizens by default. They love markdown fences and chitchat. So smartcat leans hard on configurable system prompts that beat the model into submission—“never write ```, preserve input formatting, no explanations.” The config is just TOML files for API keys and prompt templates, with a #[<input>] placeholder that gets replaced automatically.

Key highlights

  • Template system: save recurring prompts (test generation, translation, refactoring) and invoke them by name
  • Conversation continuity: -e extends the previous chat, -r repeats input so you append rather than replace
  • Context globbing: sc "summarize" -c **/*.md slurps files into the prompt
  • Editor-native: designed for |! workflows in modal editors, not clipboard juggling
  • API key commands: can shell out to pass or env vars instead of hardcoding secrets

Caveats

  • Default Ollama setup uses phi3, which the README itself warns may be slow; they nudge you toward paid APIs for “optimal workflow”
  • The README is truncated mid-sentence in the Ollama setup section, so some installation details are literally cut off
  • No built-in streaming output mentioned; you’re waiting for the full response

Verdict

Worth a look if you live in Vim/Helix/Kakoune and want LLM assistance without leaving your keyboard or your shell. Skip it if you need a chatty GUI, real-time collaboration, or can’t stomach configuring TOML files to make an LLM behave.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.