mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-05 10:13:05 +00:00
add version to cli
This commit is contained in:
parent
7a90fc5854
commit
11332c39b1
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
# the root directory of this source tree.
|
# the root directory of this source tree.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from importlib.metadata import version
|
||||||
|
|
||||||
from llama_stack.cli.subcommand import Subcommand
|
from llama_stack.cli.subcommand import Subcommand
|
||||||
|
|
||||||
|
@ -24,6 +25,12 @@ class StackParser(Subcommand):
|
||||||
description="Operations for the Llama Stack / Distributions",
|
description="Operations for the Llama Stack / Distributions",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.parser.add_argument(
|
||||||
|
"--version",
|
||||||
|
action="version",
|
||||||
|
version=f"llama-stack {version('llama-stack')}",
|
||||||
|
)
|
||||||
|
|
||||||
subparsers = self.parser.add_subparsers(title="stack_subcommands")
|
subparsers = self.parser.add_subparsers(title="stack_subcommands")
|
||||||
|
|
||||||
# Add sub-commands
|
# Add sub-commands
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue