Overview of the czsc CLI Architecture
masterThe czsc CLI is a unified command-line interface built with typer designed for both human and LLM use. It exposes capabilities for signal directories, Chan-theory analysis, strategy backtesting, research, visualization, and performance benchmarking.
Key Design Principles:
- Command Structure: Organized into sub-command groups (e.g.,
signals,data,plot). - LLM-Friendly: Commands support a
--jsonflag for machine-readable output. Unlike global callbacks, this flag is implemented per-command to ensure better compatibility with LLM prompting (e.g.,czsc signals list --json). - Separation of Concerns: CLI modules follow a pattern of
Parse arguments$\rightarrow$Call czsc.* public API$\rightarrow$Render via _io.py. They do not contain business or algorithmic logic. - Entry Point: Registered via
pyproject.tomlasczsc = "czsc.cli:app".