Add -h shortcut for --help

Closes #983, #1134
This commit is contained in:
Sukhbinder Singh 2025-06-01 16:02:34 +05:30 committed by Simon Willison
parent 94c62f45b1
commit f5a38d3342
2 changed files with 66 additions and 65 deletions

View file

@ -64,8 +64,8 @@ Usage: llm [OPTIONS] COMMAND [ARGS]...
llm prompt --help
Options:
--version Show the version and exit.
--help Show this message and exit.
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
prompt* Execute a prompt
@ -152,7 +152,7 @@ Options:
-u, --usage Show token usage
-x, --extract Extract first fenced code block
--xl, --extract-last Extract last fenced code block
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-chat)=
@ -183,7 +183,7 @@ Options:
--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
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-keys)=
@ -194,7 +194,7 @@ Usage: llm keys [OPTIONS] COMMAND [ARGS]...
Manage stored API keys for different models
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List names of all stored keys
@ -211,7 +211,7 @@ Usage: llm keys list [OPTIONS]
List names of all stored keys
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-keys-path)=
@ -222,7 +222,7 @@ Usage: llm keys path [OPTIONS]
Output the path to the keys.json file
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-keys-get)=
@ -237,7 +237,7 @@ Usage: llm keys get [OPTIONS] NAME
export OPENAI_API_KEY=$(llm keys get openai)
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-keys-set)=
@ -254,7 +254,7 @@ Usage: llm keys set [OPTIONS] NAME
Options:
--value TEXT Value to set
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs)=
@ -265,7 +265,7 @@ Usage: llm logs [OPTIONS] COMMAND [ARGS]...
Tools for exploring logged prompts and responses
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* Show logged prompts and their responses
@ -284,7 +284,7 @@ Usage: llm logs path [OPTIONS]
Output the path to the logs.db file
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs-status)=
@ -295,7 +295,7 @@ Usage: llm logs status [OPTIONS]
Show current status of database logging
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs-backup)=
@ -306,7 +306,7 @@ Usage: llm logs backup [OPTIONS] PATH
Backup your logs database to this file
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs-on)=
@ -317,7 +317,7 @@ Usage: llm logs on [OPTIONS]
Turn on logging for all prompts
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs-off)=
@ -328,7 +328,7 @@ Usage: llm logs off [OPTIONS]
Turn off logging for all prompts
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-logs-list)=
@ -365,7 +365,7 @@ Options:
--id-gte TEXT Return responses with ID >= this
--json Output logs as JSON
-e, --expand Expand fragments to show their content
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models)=
@ -376,7 +376,7 @@ Usage: llm models [OPTIONS] COMMAND [ARGS]...
Manage available models
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List available models
@ -398,7 +398,7 @@ Options:
--tools List models that support tools
-q, --query TEXT Search for models matching these strings
-m, --model TEXT Specific model IDs
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models-default)=
@ -409,7 +409,7 @@ Usage: llm models default [OPTIONS] [MODEL]
Show or set the default model
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models-options)=
@ -420,7 +420,7 @@ Usage: llm models options [OPTIONS] COMMAND [ARGS]...
Manage default options for models
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List default options for all models
@ -441,7 +441,7 @@ Usage: llm models options list [OPTIONS]
llm models options list
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models-options-show)=
@ -456,7 +456,7 @@ Usage: llm models options show [OPTIONS] MODEL
llm models options show gpt-4o
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models-options-set)=
@ -471,7 +471,7 @@ Usage: llm models options set [OPTIONS] MODEL KEY VALUE
llm models options set gpt-4o temperature 0.5
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-models-options-clear)=
@ -488,7 +488,7 @@ Usage: llm models options clear [OPTIONS] MODEL [KEY]
llm models options clear gpt-4o temperature
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-templates)=
@ -499,7 +499,7 @@ Usage: llm templates [OPTIONS] COMMAND [ARGS]...
Manage stored prompt templates
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List available prompt templates
@ -517,7 +517,7 @@ Usage: llm templates list [OPTIONS]
List available prompt templates
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-templates-show)=
@ -528,7 +528,7 @@ Usage: llm templates show [OPTIONS] NAME
Show the specified prompt template
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-templates-edit)=
@ -539,7 +539,7 @@ Usage: llm templates edit [OPTIONS] NAME
Edit the specified prompt template using the default $EDITOR
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-templates-path)=
@ -550,7 +550,7 @@ Usage: llm templates path [OPTIONS]
Output the path to the templates directory
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-templates-loaders)=
@ -561,7 +561,7 @@ Usage: llm templates loaders [OPTIONS]
Show template loaders registered by plugins
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-schemas)=
@ -572,7 +572,7 @@ Usage: llm schemas [OPTIONS] COMMAND [ARGS]...
Manage stored schemas
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List stored schemas
@ -593,7 +593,7 @@ Options:
--full Output full schema contents
--json Output as JSON
--nl Output as newline-delimited JSON
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-schemas-show)=
@ -605,7 +605,7 @@ Usage: llm schemas show [OPTIONS] SCHEMA_ID
Options:
-d, --database FILE Path to log database
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-schemas-dsl)=
@ -618,8 +618,8 @@ Usage: llm schemas dsl [OPTIONS] INPUT
llm schema dsl 'name, age int, bio: their bio'
Options:
--multi Wrap in an array
--help Show this message and exit.
--multi Wrap in an array
-h, --help Show this message and exit.
```
(help-tools)=
@ -630,7 +630,7 @@ Usage: llm tools [OPTIONS] COMMAND [ARGS]...
Manage tools that can be made available to LLMs
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List available tools that have been provided by plugins
@ -647,7 +647,7 @@ Options:
--json Output as JSON
--functions TEXT Python code block or file path defining functions to
register as tools
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-aliases)=
@ -658,7 +658,7 @@ Usage: llm aliases [OPTIONS] COMMAND [ARGS]...
Manage model aliases
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List current aliases
@ -675,8 +675,8 @@ Usage: llm aliases list [OPTIONS]
List current aliases
Options:
--json Output as JSON
--help Show this message and exit.
--json Output as JSON
-h, --help Show this message and exit.
```
(help-aliases-set)=
@ -697,7 +697,7 @@ Usage: llm aliases set [OPTIONS] ALIAS [MODEL_ID]
Options:
-q, --query TEXT Set alias for model matching these strings
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-aliases-remove)=
@ -712,7 +712,7 @@ Usage: llm aliases remove [OPTIONS] ALIAS
$ llm aliases remove turbo
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-aliases-path)=
@ -723,7 +723,7 @@ Usage: llm aliases path [OPTIONS]
Output the path to the aliases.json file
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-fragments)=
@ -737,7 +737,7 @@ Usage: llm fragments [OPTIONS] COMMAND [ARGS]...
prompts.
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List current fragments
@ -758,7 +758,7 @@ Options:
-q, --query TEXT Search for fragments matching these strings
--aliases Show only fragments with aliases
--json Output as JSON
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-fragments-set)=
@ -775,7 +775,7 @@ Usage: llm fragments set [OPTIONS] ALIAS FRAGMENT
llm fragments set mydocs ./docs.md
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-fragments-show)=
@ -788,7 +788,7 @@ Usage: llm fragments show [OPTIONS] ALIAS_OR_HASH
llm fragments show mydocs
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-fragments-remove)=
@ -803,7 +803,7 @@ Usage: llm fragments remove [OPTIONS] ALIAS
llm fragments remove docs
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-fragments-loaders)=
@ -814,7 +814,7 @@ Usage: llm fragments loaders [OPTIONS]
Show fragment loaders registered by plugins
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-plugins)=
@ -827,7 +827,7 @@ Usage: llm plugins [OPTIONS]
Options:
--all Include built-in default plugins
--hook TEXT Filter for plugins that implement this hook
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-install)=
@ -844,7 +844,7 @@ Options:
date
--no-cache-dir Disable the cache
--pre Include pre-release and development versions
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-uninstall)=
@ -855,8 +855,8 @@ Usage: llm uninstall [OPTIONS] PACKAGES...
Uninstall Python packages from the LLM environment
Options:
-y, --yes Don't ask for confirmation
--help Show this message and exit.
-y, --yes Don't ask for confirmation
-h, --help Show this message and exit.
```
(help-embed)=
@ -876,7 +876,7 @@ Options:
--metadata TEXT JSON object metadata to store
-f, --format [json|blob|base64|hex]
Output format
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-embed-multi)=
@ -931,7 +931,7 @@ Options:
embedding
--store Store the text itself in the database
-d, --database FILE
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-similar)=
@ -957,7 +957,7 @@ Options:
-p, --plain Output in plain text format
-d, --database FILE
--prefix TEXT Just IDs with this prefix
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-embed-models)=
@ -968,7 +968,7 @@ Usage: llm embed-models [OPTIONS] COMMAND [ARGS]...
Manage available embedding models
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* List available embedding models
@ -984,7 +984,7 @@ Usage: llm embed-models list [OPTIONS]
Options:
-q, --query TEXT Search for embedding models matching these strings
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-embed-models-default)=
@ -996,7 +996,7 @@ Usage: llm embed-models default [OPTIONS] [MODEL]
Options:
--remove-default Reset to specifying no default model
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-collections)=
@ -1007,7 +1007,7 @@ Usage: llm collections [OPTIONS] COMMAND [ARGS]...
View and manage collections of embeddings
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
list* View a list of collections
@ -1023,7 +1023,7 @@ Usage: llm collections path [OPTIONS]
Output the path to the embeddings database
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-collections-list)=
@ -1036,7 +1036,7 @@ Usage: llm collections list [OPTIONS]
Options:
-d, --database FILE Path to embeddings database
--json Output as JSON
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-collections-delete)=
@ -1052,7 +1052,7 @@ Usage: llm collections delete [OPTIONS] COLLECTION
Options:
-d, --database FILE Path to embeddings database
--help Show this message and exit.
-h, --help Show this message and exit.
```
(help-openai)=
@ -1063,7 +1063,7 @@ Usage: llm openai [OPTIONS] COMMAND [ARGS]...
Commands for working directly with the OpenAI API
Options:
--help Show this message and exit.
-h, --help Show this message and exit.
Commands:
models List models available to you from the OpenAI API
@ -1079,6 +1079,6 @@ Usage: llm openai models [OPTIONS]
Options:
--json Output as JSON
--key TEXT OpenAI API key
--help Show this message and exit.
-h, --help Show this message and exit.
```
<!-- [[[end]]] -->

View file

@ -307,6 +307,7 @@ def schema_option(fn):
cls=DefaultGroup,
default="prompt",
default_if_no_args=True,
context_settings={"help_option_names": ["-h", "--help"]},
)
@click.version_option()
def cli():