cli
6 modules
cli/args.ts
Shared CLI argument parsing utilities.
Provides parse_command_args for schema-validated command parsing and create_extract_global_flags as a factory for project-specific global flag extraction. Both are used identically across tx, zzz, and mageguild.
cli/config.ts
Generic CLI configuration loader.
Manages CLI-specific configuration stored at
~/.{name}/config.json. Consumers keep their project-specific Zod schemas locally and use these generic load/save functions.cli/daemon.ts
Daemon lifecycle management.
Provides daemon info schema, PID file management, and process lifecycle operations. Separates lifecycle from presentation — stop_daemon returns a result object instead of logging directly.
cli/help.ts
Schema-driven CLI help generator.
Generalized from the identical pattern in tx and zzz. Consumers configure once with create_help and get back
generate_main_help,generate_command_help, andget_help_text.cli/logger.ts
CLI logger wrapping
Loggerwith semantic output methods.Why wrapper, not subclass: Logger has variadic
...argsmethods, CLI adds single-string semantic methods. Mixing calling conventions on one class is confusing. Composition keeps both APIs clean.Why Logger prefixes for error/warn: Unifies error/warn visual style across CLI and backend. CLI-specific methods (success/skip/step/header) add their own semantic prefixes via
logger.info().cli/util.ts
CLI utilities for colors, confirmation, and command delegation.
For structured CLI logging, see create_cli_logger in
logger.ts.