LLM exposes every capability through a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/simonw/LLM/llms.txt
Use this file to discover all available pages before exploring further.
llm entry-point. The default sub-command is llm prompt (so running llm 'some question' is identical to llm prompt 'some question'). This page documents every command, sub-command, and flag drawn directly from the CLI source.
Prompting
llm / llm prompt — Execute a prompt
llm / llm prompt — Execute a prompt
llm prompt is the core command. It is also the default, so llm 'question' is equivalent.| Flag | Description |
|---|---|
PROMPT | Positional prompt text (optional — can be piped via stdin) |
-s, --system TEXT | System prompt to use |
-m, --model TEXT | Model to use (env: LLM_MODEL) |
-d, --database FILE | Path to log database |
-q, --query TEXT | Use first model matching these strings (repeatable) |
-a, --attachment ATTACHMENT | Attachment path, URL, or - for stdin (repeatable) |
--at, --attachment-type TEXT TEXT | Attachment with explicit MIME type, e.g. --at image.jpg image/jpeg |
-T, --tool TEXT | Name of a tool to make available to the model (repeatable) |
--functions TEXT | Python code block or file path defining functions to register as tools |
--td, --tools-debug | Show full details of tool executions |
--ta, --tools-approve | Manually approve every tool execution |
--cl, --chain-limit INTEGER | How many chained tool responses to allow (default 5, set 0 for unlimited) |
-o, --option NAME VALUE | key/value options for the model (repeatable) |
--options | Show options for the selected model |
--schema TEXT | JSON schema, filepath or ID for structured output |
--schema-multi TEXT | JSON schema to use for multiple results |
-f, --fragment TEXT | Fragment (alias, URL, hash or file path) to add to the prompt (repeatable) |
--sf, --system-fragment TEXT | Fragment to add to the system prompt |
-t, --template TEXT | Template to use |
-p, --param KEY VALUE | Parameters for template (repeatable) |
--no-stream | Do not stream output |
-n, --no-log | Don’t log to database |
--log | Log prompt and response to the database |
-R, --hide-reasoning | Hide reasoning output |
-c, --continue | Continue the most recent conversation |
--cid, --conversation TEXT | Continue the conversation with the given ID |
--key TEXT | API key to use |
--save TEXT | Save prompt with this template name |
--async | Run prompt asynchronously |
-u, --usage | Show token usage |
-x, --extract | Extract first fenced code block from the response |
--xl, --extract-last | Extract last fenced code block from the response |
o3) are displayed to stderr in a dim style while the response streams. Use -R/--hide-reasoning to suppress them.llm chat — Interactive ongoing conversation
llm chat — Interactive ongoing conversation
llm chat starts an interactive session with a model. Your conversation history is maintained for the duration of the session.| Flag | Description |
|---|---|
-s, --system TEXT | System prompt to use |
-m, --model TEXT | Model to use |
-c, --continue | Continue the most recent conversation |
--cid, --conversation TEXT | Continue the conversation with the given ID |
-f, --fragment TEXT | Fragment to add to the prompt (repeatable) |
--sf, --system-fragment TEXT | Fragment to add to the system prompt |
-t, --template TEXT | Template to use |
-p, --param KEY VALUE | Parameters for template (repeatable) |
-o, --option NAME VALUE | key/value options for the model (repeatable) |
-d, --database FILE | Path to log database |
--no-stream | Do not stream output |
-R, --hide-reasoning | Hide reasoning output |
--key TEXT | API key to use |
-T, --tool TEXT | Name of a tool to make available to the model (repeatable) |
--functions TEXT | Python code block or file path defining functions to register as tools |
--td, --tools-debug | Show full details of tool executions |
--ta, --tools-approve | Manually approve every tool execution |
--cl, --chain-limit INTEGER | How many chained tool responses to allow (default 5, set 0 for unlimited) |
| Command | Description |
|---|---|
!multi | Enter multi-line input mode |
!end | End multi-line input and send |
!edit | Edit the current prompt in your $EDITOR |
!fragment <id> | Insert content from a fragment into the current prompt |
exit or quit | End the chat session |
API Keys
llm keys — Manage stored API keys
llm keys — Manage stored API keys
llm keys manages API keys stored in keys.json. Running llm keys without a sub-command is equivalent to llm keys list.llm keys set flags| Flag | Description |
|---|---|
NAME | The key name (e.g. openai, anthropic) |
--value TEXT | Value to set (prompted interactively if omitted) |
Logs
llm logs — Explore logged prompts and responses
llm logs — Explore logged prompts and responses
llm logs gives you access to the SQLite database where every prompt and response is stored. Running llm logs without a sub-command is equivalent to llm logs list.| Sub-command | Description |
|---|---|
list | Show logged prompts and responses (default) |
on | Turn on logging for all prompts |
off | Turn off logging for all prompts |
status | Show current logging status |
path | Print path to logs.db |
backup PATH | Backup your logs database to a file |
llm logs list flags| Flag | Description |
|---|---|
-n, --count INTEGER | Number of entries to show (default 3, use 0 for all) |
-d, --database FILE | Path to log database |
-m, --model TEXT | Filter by model or model alias |
-q, --query TEXT | Search for logs matching this string |
-f, --fragment TEXT | Filter for prompts using these fragments |
-T, --tool TEXT | Filter for prompts with results from these tools |
--tools | Filter for prompts that used any tool |
--schema TEXT | JSON schema, filepath or ID |
--schema-multi TEXT | JSON schema used for multiple results |
-l, --latest | Return latest results matching search query (most recent first) |
--data | Output newline-delimited JSON data for schema |
--data-array | Output JSON array of data for schema |
--data-key TEXT | Return JSON objects from array in this key |
--data-ids | Attach corresponding IDs to JSON objects |
-t, --truncate | Truncate long strings in output |
-s, --short | Shorter YAML output with truncated prompts |
-u, --usage | Include token usage |
-r, --response | Just output the last response |
-x, --extract | Extract first fenced code block |
--xl, --extract-last | Extract last fenced code block |
-c, --current | Show logs from the current conversation |
--cid, --conversation TEXT | Show logs for this conversation ID |
--id-gt TEXT | Return responses with ID greater than this value |
--id-gte TEXT | Return responses with ID greater than or equal to this value |
--json | Output logs as JSON |
-e, --expand | Expand fragments to show their full content |
Models
llm models — Manage available models
llm models — Manage available models
llm models lists and configures models. Running llm models without a sub-command is equivalent to llm models list.| Sub-command | Description |
|---|---|
list | List available models (default) |
default [MODEL] | Show or set the default model |
options | Manage default options for models |
llm models list flags| Flag | Description |
|---|---|
--options | Show options for each model, if available |
--async | List async models |
--schemas | List models that support schemas |
--tools | List models that support tools |
-q, --query TEXT | Search for models matching these strings (repeatable) |
-m, --model TEXT | Specific model IDs to display (repeatable) |
llm models options sub-commandsTemplates
llm templates — Manage stored prompt templates
llm templates — Manage stored prompt templates
llm templates without a sub-command is equivalent to llm templates list.| Sub-command | Description |
|---|---|
list | List available prompt templates (default) |
show NAME | Show the specified template |
edit NAME | Edit a template in $EDITOR |
path | Print the templates directory path |
loaders | Show template loaders registered by plugins |
$input as a variable for piped content and $varname for other parameters passed via -p.Schemas
llm schemas — Manage stored schemas
llm schemas — Manage stored schemas
llm schemas without a sub-command is equivalent to llm schemas list.| Sub-command | Description |
|---|---|
list | List stored schemas (default) |
show SCHEMA_ID | Show a stored schema |
dsl INPUT | Convert LLM’s concise schema DSL to a full JSON schema |
llm schemas list flags| Flag | Description |
|---|---|
-d, --database FILE | Path to log database |
-q, --query TEXT | Search for schemas matching this string |
--full | Output full schema contents |
--json | Output as JSON |
--nl | Output as newline-delimited JSON |
llm schemas dsl flags| Flag | Description |
|---|---|
INPUT | Concise schema definition string |
--multi | Wrap schema in an array |
Tools
llm tools — Manage available tools
llm tools — Manage available tools
--functions.| Sub-command | Description |
|---|---|
list | List available tools provided by plugins (default) |
llm tools list flags| Flag | Description |
|---|---|
[TOOL_DEFS]... | Optional tool definition arguments |
--json | Output as JSON |
--functions TEXT | Python code block or file path defining functions to register as tools |
Aliases
llm aliases — Manage model aliases
llm aliases — Manage model aliases
llm aliases without a sub-command is equivalent to llm aliases list.| Sub-command | Description |
|---|---|
list | List current aliases (default) |
set ALIAS [MODEL_ID] | Set an alias for a model |
remove ALIAS | Remove an alias |
path | Print the path to aliases.json |
llm aliases list flags| Flag | Description |
|---|---|
--json | Output as JSON |
llm aliases set flags| Flag | Description |
|---|---|
ALIAS | The alias name to create |
[MODEL_ID] | Model ID to assign to the alias |
-q, --query TEXT | Set alias for first model matching these strings (repeatable, used instead of MODEL_ID) |
Fragments
llm fragments — Manage reusable prompt fragments
llm fragments — Manage reusable prompt fragments
llm fragments without a sub-command is equivalent to llm fragments list.| Sub-command | Description |
|---|---|
list | List stored fragments (default) |
set ALIAS FRAGMENT | Set an alias for a fragment |
show ALIAS_OR_HASH | Display a stored fragment |
remove ALIAS | Remove a fragment alias |
loaders | Show fragment loaders registered by plugins |
llm fragments list flags| Flag | Description |
|---|---|
-q, --query TEXT | Search for fragments matching these strings |
--aliases | Show only fragments that have aliases |
--json | Output as JSON |
Plugins
llm plugins — List installed plugins
llm plugins — List installed plugins
| Flag | Description |
|---|---|
--all | Include built-in default plugins |
--hook TEXT | Filter for plugins that implement this hook |
Installing Packages
llm install — Install packages into the LLM environment
llm install — Install packages into the LLM environment
| Flag | Description |
|---|---|
PACKAGES | One or more package names to install |
-U, --upgrade | Upgrade packages to the latest version |
-e, --editable TEXT | Install a project in editable mode from this path |
--force-reinstall | Reinstall all packages even if they are already up-to-date |
--no-cache-dir | Disable the cache |
--pre | Include pre-release and development versions |
llm uninstall — Uninstall packages from the LLM environment
llm uninstall — Uninstall packages from the LLM environment
| Flag | Description |
|---|---|
PACKAGES | One or more package names to uninstall |
-y, --yes | Don’t ask for confirmation |
Embeddings
llm embed — Embed text and store or return the result
llm embed — Embed text and store or return the result
| Flag | Description |
|---|---|
COLLECTION | Collection name to store the embedding in |
ID | ID for this embedding within the collection |
-i, --input PATH | File to embed |
-m, --model TEXT | Embedding model to use |
--store | Store the original text in the database alongside the vector |
-d, --database FILE | Path to embeddings database |
-c, --content TEXT | Content to embed (inline) |
--binary | Treat input as binary data |
--metadata TEXT | JSON object metadata to store |
-f, --format [json|blob|base64|hex] | Output format for the embedding vector |
llm embed-multi — Batch embed multiple strings
llm embed-multi — Batch embed multiple strings
| Flag | Description |
|---|---|
COLLECTION | Collection name to store embeddings in |
[INPUT_PATH] | Path to input file (or - for stdin) |
--format [json|csv|tsv|nl] | Input file format (defaults to auto-detect) |
--files DIRECTORY TEXT | Embed files in a directory matching a glob pattern |
--encoding TEXT | Encodings to try when reading --files |
--binary | Treat --files as binary data |
--sql TEXT | Read input using this SQL query |
--attach ALIAS FILE | Additional SQLite databases to attach |
--batch-size INTEGER | Batch size to use when running embeddings |
--prefix TEXT | Prefix to add to all IDs |
--prepend TEXT | Prepend this string to all content before embedding |
-m, --model TEXT | Embedding model to use |
--store | Store the original text alongside the vector |
-d, --database FILE | Path to embeddings database |
llm similar — Find similar items by cosine similarity
llm similar — Find similar items by cosine similarity
| Flag | Description |
|---|---|
COLLECTION | Collection to search |
[ID] | ID of a stored item to find similar items for |
-i, --input PATH | File to embed for comparison |
-c, --content TEXT | Content to embed for comparison |
--binary | Treat input as binary data |
-n, --number INTEGER | Number of results to return |
-p, --plain | Output in plain text format (instead of JSON) |
-d, --database FILE | Path to embeddings database |
--prefix TEXT | Only return IDs with this prefix |
llm embed-models — Manage embedding models
llm embed-models — Manage embedding models
llm embed-models lists and configures embedding models. Running it without a sub-command is equivalent to llm embed-models list.| Sub-command | Description |
|---|---|
list | List available embedding models (default) |
default [MODEL] | Show or set the default embedding model |
llm embed-models list flags| Flag | Description |
|---|---|
-q, --query TEXT | Search for embedding models matching these strings |
llm embed-models default flags| Flag | Description |
|---|---|
[MODEL] | Model ID to set as default (omit to show current default) |
--remove-default | Reset to specifying no default model |
llm collections — View and manage embedding collections
llm collections — View and manage embedding collections
llm collections manages named collections of embedding vectors. Running it without a sub-command is equivalent to llm collections list.| Sub-command | Description |
|---|---|
list | View a list of collections (default) |
delete COLLECTION | Delete the specified collection |
path | Print the path to the embeddings database |
llm collections list flags| Flag | Description |
|---|---|
-d, --database FILE | Path to embeddings database |
--json | Output as JSON |
llm collections delete flags| Flag | Description |
|---|---|
COLLECTION | Name of the collection to delete |
-d, --database FILE | Path to embeddings database |
OpenAI-specific Commands
llm openai — Commands for the OpenAI API
llm openai — Commands for the OpenAI API
| Sub-command | Description |
|---|---|
models | List models available to you from the OpenAI API |
llm openai models flags| Flag | Description |
|---|---|
--json | Output as JSON |
--key TEXT | OpenAI API key to use |