원클릭으로
add-cli-command
Step-by-step procedure to create a new CLI command group in a genai-tk project and register it in configuration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Step-by-step procedure to create a new CLI command group in a genai-tk project and register it in configuration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Build or modify LangChain, DeepAgent, DeerFlow profiles, agent tools, middleware, checkpointing, skills wiring, and the shared harness layer in genai-tk.
Work on BAML structured extraction, BAML CLI commands, processors, utilities, and Prefect BAML workflow integration in genai-tk.
Work on browser automation, sandbox browser tools, direct Playwright tools, AioSandbox backend, and sandbox CLI support in genai-tk.
Add or modify genai-tk Typer CLI commands, dynamic command registration, project scaffolding, and generated Copilot/agent support files.
Work on genai-tk OmegaConf configuration, profiles, overrides, env substitution, and config discovery. Use when editing config/*.yaml or genai_tk.config_mgmt.config_mngr.
Work on core LLM, embeddings, vector store, provider, cache, prompt, and retriever factories in genai-tk. Use when editing genai_tk/core or provider configuration.
| name | add-cli-command |
| description | Step-by-step procedure to create a new CLI command group in a genai-tk project and register it in configuration. |
Follow these steps to add a new CLI command group to a genai-tk project.
cli init (has config/app_conf.yaml)commands/ sub-directoryCreate a new file in <package>/commands/my_commands.py:
"""My custom CLI commands."""
from __future__ import annotations
from typing import Annotated
import typer
from rich.console import Console
from genai_tk.cli.base import CliTopCommand
console = Console()
class MyCommands(CliTopCommand):
"""Description of what these commands do."""
description: str = "Short description for --help output"
def get_description(self) -> tuple[str, str]:
# First element is the command group name (used as: cli <name> <subcommand>)
return "mygroup", self.description
def register_sub_commands(self, cli_app: typer.Typer) -> None:
@cli_app.command()
def subcommand_one(
arg: Annotated[str, typer.Argument(help="Positional argument")],
flag: Annotated[bool, typer.Option("--flag", "-f", help="Optional flag")] = False,
) -> None:
"""One-line description of the subcommand."""
console.print(f"Running with {arg}, flag={flag}")
Add the fully-qualified class path to config/app_conf.yaml under cli.commands:
cli:
commands:
# ... existing commands ...
- <package_name>.commands.my_commands.MyCommands
uv run cli mygroup --help
uv run cli mygroup subcommand-one "test"
get_description() becomes the CLI sub-command: cli <name>Annotated[type, typer.Argument(...)] for positional argsAnnotated[type, typer.Option(...)] for flags/optionsrich.console.Console for formatted outputfrom genai_tk.config_mgmt.config_mngr import global_configfrom genai_tk.core.factories.llm_factory import get_llm