Quick start
1. Install
Section titled “1. Install”npm install -g heyllm# or: pnpm add -g heyllmRequires Node.js ≥ 18 — heyllm uses the built-in global fetch, so there’s no
extra HTTP dependency to pull in.
2. Set your API key
Section titled “2. Set your API key”heyllm reads your key from the OPENAI_API_KEY environment variable. Export it
once:
export OPENAI_API_KEY="sk-..."If no key is found and --api-key isn’t passed, heyllm prints a clear error to
stderr and exits with code 2. See Configuration for
per-call overrides and other providers.
3. Ask your first question
Section titled “3. Ask your first question”heyllm "explain monads simply"A monad is a way to wrap a value along with a recipe for chainingoperations on it without unwrapping by hand...Tokens stream to your terminal as the model produces them. That’s the whole single-shot flow — no session, no history, no config file.
4. Pipe stdin in as context
Section titled “4. Pipe stdin in as context”The real power is piping. The positional prompt becomes the instruction, and whatever you pipe in becomes the context — combined into one user message, prompt first:
git diff | heyllm "write a conventional commit message"feat(parser): handle SSE frames split across network chunksAny command that writes to stdout works as context:
cat error.log | heyllm "what's the root cause here?"curl -s https://example.com | heyllm "summarize this page in 3 bullets"You can also pipe input with no prompt at all and let stdin stand on its own:
echo "translate to French: good morning" | heyllmWhere to next
Section titled “Where to next”- CLI reference — every flag, streaming vs
--no-stream,--json, and exit codes. - Configuration — point
--base-urlat OpenRouter, a local Ollama, or any OpenAI-compatible API, and pick a model. - Recipes — a handful of genuinely useful one-liners.