a0c8464e58
Build Package / build (ubuntu-latest) (push) Failing after 1s
CodeQL / Analyze (python) (push) Failing after 1s
Core Typecheck / core-typecheck (push) Failing after 1s
Linting / lint (push) Failing after 1s
llama-dev tests / test-llama-dev (push) Failing after 1s
Publish Sub-Package to PyPI if Needed / publish_subpackage_if_needed (push) Has been skipped
Sync Docs to Developer Hub / sync-docs (push) Failing after 0s
Build Package / build (windows-latest) (push) Has been cancelled
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
from pathlib import Path
|
|
|
|
import click
|
|
from rich.console import Console
|
|
from rich.theme import Theme
|
|
|
|
from .pkg import pkg
|
|
from .release import release
|
|
from .test import test
|
|
|
|
LLAMA_DEV_THEME = Theme(
|
|
{
|
|
"repr.path": "",
|
|
"repr.filename": "",
|
|
"repr.str": "",
|
|
"traceback.note": "cyan",
|
|
"info": "dim cyan",
|
|
"warning": "magenta",
|
|
"error": "bold red",
|
|
}
|
|
)
|
|
|
|
|
|
@click.group(context_settings={"help_option_names": ["-h", "--help"]})
|
|
@click.version_option()
|
|
@click.option(
|
|
"--repo-root",
|
|
default=".",
|
|
help="Path to the llama_index repository, defaults to '.'",
|
|
)
|
|
@click.option("--debug", is_flag=True, help="Enable verbose output.")
|
|
@click.pass_context
|
|
def cli(ctx, repo_root: str, debug: bool):
|
|
"""The official CLI for development, testing, and automation in the LlamaIndex monorepo."""
|
|
ctx.obj = {
|
|
"console": Console(theme=LLAMA_DEV_THEME, soft_wrap=True),
|
|
"repo_root": Path(repo_root).resolve(),
|
|
"debug": debug,
|
|
}
|
|
|
|
|
|
cli.add_command(pkg)
|
|
cli.add_command(test)
|
|
cli.add_command(release)
|