From 11332c39b14c8c08c38b8dd9ad1c052c02ac9ffa Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Wed, 8 Jan 2025 13:59:27 -0800 Subject: [PATCH] add version to cli --- llama_stack/cli/stack/stack.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llama_stack/cli/stack/stack.py b/llama_stack/cli/stack/stack.py index c359d27ec..cde73d915 100644 --- a/llama_stack/cli/stack/stack.py +++ b/llama_stack/cli/stack/stack.py @@ -5,6 +5,7 @@ # the root directory of this source tree. import argparse +from importlib.metadata import version from llama_stack.cli.subcommand import Subcommand @@ -24,6 +25,12 @@ class StackParser(Subcommand): 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") # Add sub-commands