Elffuss BraidHub

kikocis/llama-stack public

6513a722f4e4 · 1.1 KiBRawPermalink
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2# All rights reserved.
3#
4# This source code is licensed under the terms described in the LICENSE file in
5# the root directory of this source tree.
6
7import argparse
8
9from llama_toolchain.cli.subcommand import Subcommand
10
11from .build import StackBuild
12from .configure import StackConfigure
13from .list_apis import StackListApis
14from .list_distributions import StackListDistributions
15from .list_providers import StackListProviders
16from .run import StackRun
17
18
19class StackParser(Subcommand):
20 def __init__(self, subparsers: argparse._SubParsersAction):
21 super().__init__()
22 self.parser = subparsers.add_parser(
23 "stack",
24 prog="llama stack",
25 description="Operations for the Llama Stack / Distributions",
26 )
27
28 subparsers = self.parser.add_subparsers(title="stack_subcommands")
29
30 # Add sub-commands
31 StackBuild.create(subparsers)
32 StackConfigure.create(subparsers)
33 StackListApis.create(subparsers)
34 StackListDistributions.create(subparsers)
35 StackListProviders.create(subparsers)
36 StackRun.create(subparsers)