Skip to content

Commit 06db448

Browse files
authored
Add -h help flag support to all CLI commands (#185)
Updated each command in the CLI to support the `-h` flag for displaying usage instructions. # What does this PR do? This PR adds support for the -h help flag to all CLI commands. It enables users to view usage instructions and command options by appending -h or --help to any command in the CLI. This enhancement improves the usability of the CLI by providing a consistent and easy way for users to access command-specific help information. The help flag functionality is implemented across all commands, ensuring that every CLI command supports this feature. ## Test Plan Manual Testing: Run each CLI command with the -h or --help flag. Verify that the correct help message is displayed for each command, including the command options, arguments, and usage instructions. Signed-off-by: Alina Ryan <aliryan@redhat.com>
1 parent 9ce7520 commit 06db448

File tree

22 files changed

+43
-0
lines changed

22 files changed

+43
-0
lines changed

src/llama_stack_client/lib/cli/configure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def get_config():
2323

2424

2525
@click.command()
26+
@click.help_option("-h", "--help")
2627
@click.option("--endpoint", type=str, help="Llama Stack distribution endpoint", default="")
2728
@click.option("--api-key", type=str, help="Llama Stack distribution API key", default="")
2829
def configure(endpoint: str | None, api_key: str | None):

src/llama_stack_client/lib/cli/datasets/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
@click.group()
13+
@click.help_option("-h", "--help")
1314
def datasets():
1415
"""Manage datasets."""
1516

src/llama_stack_client/lib/cli/datasets/list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
@click.command("list")
15+
@click.help_option("-h", "--help")
1516
@click.pass_context
1617
@handle_client_errors("list datasets")
1718
def list_datasets(ctx):

src/llama_stack_client/lib/cli/datasets/register.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def data_url_from_file(file_path: str) -> str:
3030

3131

3232
@click.command("register")
33+
@click.help_option("-h", "--help")
3334
@click.option("--dataset-id", required=True, help="Id of the dataset")
3435
@click.option("--provider-id", help="Provider ID for the dataset", default=None)
3536
@click.option("--provider-dataset-id", help="Provider's dataset ID", default=None)

src/llama_stack_client/lib/cli/eval/eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
@click.group()
15+
@click.help_option("-h", "--help")
1516
def eval():
1617
"""Run evaluation tasks."""
1718

src/llama_stack_client/lib/cli/eval/run_benchmark.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
@click.command("run-benchmark")
20+
@click.help_option("-h", "--help")
2021
@click.argument("benchmark-ids", nargs=-1, required=True)
2122
@click.option(
2223
"--model-id",

src/llama_stack_client/lib/cli/eval/run_scoring.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616

1717
@click.command("run-scoring")
18+
@click.help_option("-h", "--help")
1819
@click.argument("scoring-function-ids", nargs=-1, required=True)
1920
@click.option(
2021
"--dataset-id",

src/llama_stack_client/lib/cli/eval_tasks/eval_tasks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717

1818
@click.group()
19+
@click.help_option("-h", "--help")
1920
def eval_tasks():
2021
"""Manage evaluation tasks."""
2122

2223

2324
@eval_tasks.command()
25+
@click.help_option("-h", "--help")
2426
@click.option("--eval-task-id", required=True, help="ID of the eval task")
2527
@click.option("--dataset-id", required=True, help="ID of the dataset to evaluate")
2628
@click.option("--scoring-functions", required=True, multiple=True, help="Scoring functions to use for evaluation")

src/llama_stack_client/lib/cli/eval_tasks/list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
@click.command("list")
15+
@click.help_option("-h", "--help")
1516
@click.pass_context
1617
@handle_client_errors("list eval tasks")
1718
def list_eval_tasks(ctx):

src/llama_stack_client/lib/cli/inference/inference.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616

1717
@click.group()
18+
@click.help_option("-h", "--help")
1819
def inference():
1920
"""Inference (chat)."""
2021

2122

2223
@click.command("chat-completion")
24+
@click.help_option("-h", "--help")
2325
@click.option("--message", help="Message")
2426
@click.option("--stream", is_flag=True, help="Streaming", default=False)
2527
@click.option("--session", is_flag=True, help="Start a Chat Session", default=False)

0 commit comments

Comments
 (0)