Skip to content

Commit

Permalink
Humanize CLI command group descriptions a bit (#137)
Browse files Browse the repository at this point in the history
# What does this PR do?

Descriptions were repetitive and verbose, some were truncated by click
rendering (trailing ... ellipsis). This is an attempt to simplify /
shorten / clarify the descriptions.

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

Before:

```
 llama-stack-client --help
Usage: llama-stack-client [OPTIONS] COMMAND [ARGS]...

  Welcome to the LlamaStackClient CLI

Options:
  --version        Show the version and exit.
  --endpoint TEXT  Llama Stack distribution endpoint
  --api-key TEXT   Llama Stack distribution API key
  --config TEXT    Path to config file
  --help           Show this message and exit.

Commands:
  configure          Configure Llama Stack Client CLI
  datasets           Query details about available datasets on Llama...
  eval               Run evaluation tasks
  eval_tasks         Query details about available eval tasks type on...
  inference          Query details about available inference endpoints on...
  inspect            Query details about available versions on Llama...
  models             Query details about available models on Llama Stack...
  post_training      Query details about available post_training...
  providers          Query details about available providers on Llama...
  scoring_functions  Manage scoring functions
  shields            Query details about available safety shields on...
  toolgroups         Query details about available toolgroups on Llama...
  vector_dbs         Query details about available vector dbs on...
```

After:

```
 llama-stack-client --help
Usage: llama-stack-client [OPTIONS] COMMAND [ARGS]...

  Welcome to the LlamaStackClient CLI

Options:
  --version        Show the version and exit.
  --endpoint TEXT  Llama Stack distribution endpoint
  --api-key TEXT   Llama Stack distribution API key
  --config TEXT    Path to config file
  --help           Show this message and exit.

Commands:
  configure          Configure Llama Stack Client CLI.
  datasets           Manage datasets.
  eval               Run evaluation tasks.
  eval_tasks         Manage evaluation tasks.
  inference          Inference (chat).
  inspect            Inspect server configuration.
  models             Manage GenAI models.
  post_training      Post-training.
  providers          Manage API providers.
  scoring_functions  Manage scoring functions.
  shields            Manage safety shield services.
  toolgroups         Manage available tool groups.
  vector_dbs         Manage vector databases.
```

[//]: # (## Documentation)
[//]: # (- [ ] Added a Changelog entry if the change is significant)

Signed-off-by: Ihar Hrachyshka <[email protected]>
  • Loading branch information
booxter authored Feb 11, 2025
1 parent 626805a commit b07a6a1
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/llama_stack_client/lib/cli/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_config():
@click.option("--endpoint", type=str, help="Llama Stack distribution endpoint", default="")
@click.option("--api-key", type=str, help="Llama Stack distribution API key", default="")
def configure(endpoint: str | None, api_key: str | None):
"""Configure Llama Stack Client CLI"""
"""Configure Llama Stack Client CLI."""
os.makedirs(LLAMA_STACK_CLIENT_CONFIG_DIR, exist_ok=True)
config_path = get_config_file_path()

Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/datasets/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

@click.group()
def datasets():
"""Query details about available datasets on Llama Stack distribution."""
pass
"""Manage datasets."""


# Register subcommands
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

@click.group()
def eval():
"""Run evaluation tasks"""
pass
"""Run evaluation tasks."""


# Register subcommands
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/eval_tasks/eval_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

@click.group()
def eval_tasks():
"""Query details about available eval tasks type on distribution."""
pass
"""Manage evaluation tasks."""


@eval_tasks.command()
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

@click.group()
def inference():
"""Query details about available inference endpoints on distribution."""
pass
"""Inference (chat)."""


@click.command("chat-completion")
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/inspect/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

@click.group()
def inspect():
"""Query details about available versions on Llama Stack distribution."""
pass
"""Inspect server configuration."""


# Register subcommands
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

@click.group()
def models():
"""Query details about available models on Llama Stack distribution."""
pass
"""Manage GenAI models."""


@click.command(name="list", help="Show available llama models at distribution endpoint")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

@click.group()
def post_training():
"""Query details about available post_training endpoints on distribution."""
pass
"""Post-training."""


@click.command("supervised_fine_tune")
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/providers/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

@click.group()
def providers():
"""Query details about available providers on Llama Stack distribution."""
pass
"""Manage API providers."""


# Register subcommands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

@click.group()
def scoring_functions():
"""Manage scoring functions"""
pass
"""Manage scoring functions."""


@scoring_functions.command()
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/shields/shields.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

@click.group()
def shields():
"""Query details about available safety shields on distribution."""
pass
"""Manage safety shield services."""


@click.command("list")
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/toolgroups/toolgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

@click.group()
def toolgroups():
"""Query details about available toolgroups on Llama Stack distribution."""
pass
"""Manage available tool groups."""


@click.command(name="list", help="Show available llama toolgroups at distribution endpoint")
Expand Down
3 changes: 1 addition & 2 deletions src/llama_stack_client/lib/cli/vector_dbs/vector_dbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

@click.group()
def vector_dbs():
"""Query details about available vector dbs on distribution."""
pass
"""Manage vector databases."""


@click.command("list")
Expand Down

0 comments on commit b07a6a1

Please sign in to comment.