Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/llama_stack_client/lib/cli/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@

import yaml

from llama_stack_client.lib.cli.constants import LLAMA_STACK_CLIENT_CONFIG_DIR
from llama_stack_client.lib.cli.constants import get_config_file_path
from llama_stack_client.lib.cli.subcommand import Subcommand


def get_config_file_path():
return LLAMA_STACK_CLIENT_CONFIG_DIR / "config.yaml"


def get_config():
config_file = get_config_file_path()
if config_file.exists():
Expand Down
4 changes: 4 additions & 0 deletions src/llama_stack_client/lib/cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
from pathlib import Path

LLAMA_STACK_CLIENT_CONFIG_DIR = Path(os.path.expanduser("~/.llama/client"))


def get_config_file_path():
return LLAMA_STACK_CLIENT_CONFIG_DIR / "config.yaml"
10 changes: 9 additions & 1 deletion src/llama_stack_client/lib/cli/llama_stack_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

import argparse

from llama_stack_client.lib.cli.constants import get_config_file_path

from .configure import ConfigureParser
from .providers import ProvidersParser
from .memory_banks import MemoryBanksParser

from .models import ModelsParser
from .providers import ProvidersParser
from .shields import ShieldsParser


Expand Down Expand Up @@ -38,6 +40,12 @@ def parse_args(self) -> argparse.Namespace:
return self.parser.parse_args()

def run(self, args: argparse.Namespace) -> None:
if not get_config_file_path().exists():
print(
"Config file not found. Please run 'llama-stack-client configure' to create one."
)
return

args.func(args)


Expand Down