| name | consult-llm |
|---|---|
| description | How to invoke the consult-llm CLI. Canonical reference for the invocation contract, flags, stdin/stdout format, and multi-turn. Load this before calling consult-llm from any workflow skill (/consult, /collab, /debate, /collab-vs, /debate-vs). |
| allowed-tools | Bash |
Reference for invoking the consult-llm CLI. Workflow skills delegate here for mechanics; they focus on orchestration.
Run consult-llm with the prompt on stdin, using a quoted heredoc.
cat <<'EOF' | consult-llm -m gemini -f src/foo.rs -f src/bar.rs
<prompt body>
EOFRules:
- ALWAYS use
<<'EOF'(quoted). The quotes prevent the shell from expanding$var, backticks, or escapes inside the prompt. Unquoted heredocs corrupt prompts. - Fallback to
--prompt-file <path>if the prompt contains the heredoc terminator, or on Windows/PowerShell. Write the prompt to a temp file, thenconsult-llm --prompt-file /tmp/prompt.txt …. - Stdout layout. First line is
[model:<id>] [thread_id:<id>], then a blank line, then the response body. In--webmode the prefix is just[model:<id>](no thread). - Multi-turn. Read
[thread_id:xxx]from line 1 and pass it back with-t <id>on the next call. Thread IDs are opaque strings — don't modify them. Not portable across backends. - Stderr carries progress/spinner output. Ignore it.
- Exit codes.
0success,1backend/network error (includes thread-not-found),2usage error,3configuration error (missing API key, unsupported backend).
Selectors and allowed models resolvable in this environment (availability depends on which API keys are configured):
!`consult-llm models`
Pass a selector or an exact model ID to -m. Selectors with -> - have no configured API key and will fail.
| Flag | Purpose |
|---|---|
-m, --model <selector|id> |
See "Models" above |
-f, --file <path> |
Repeatable. File context |
-t, --thread-id <id> |
Resume a multi-turn conversation |
--task <mode> |
general (default), review, debug, plan, create |
--web |
Copy formatted prompt to clipboard, exit 0 |
--prompt-file <path> |
Read prompt from file instead of stdin |
--diff-files <path> |
Repeatable. Include git diff for this file |
--diff-base <ref> |
Base ref for diff (default HEAD) |
--diff-repo <path> |
Repo path (default cwd) |
Run consult-llm --help for the authoritative flag list.