Skip to content

Commit

Permalink
Better --help for llm keys get, refs #623
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 11, 2024
1 parent 561784d commit dff53a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ Usage: llm keys get [OPTIONS] NAME
Return the value of a stored key
Example usage:
export OPENAI_API_KEY=$(llm keys get openai)
Options:
--help Show this message and exit.
```
Expand Down
9 changes: 8 additions & 1 deletion llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,14 @@ def keys_path_command():
@keys.command(name="get")
@click.argument("name")
def keys_get(name):
"Return the value of a stored key"
"""
Return the value of a stored key
Example usage:
\b
export OPENAI_API_KEY=$(llm keys get openai)
"""
path = user_dir() / "keys.json"
if not path.exists():
raise click.ClickException("No keys found")
Expand Down

0 comments on commit dff53a9

Please sign in to comment.