INNER CODE UNIT · Python
main
faridrashidi/cnsplots · src/cnsplots/_cli.py:364
def main(argv: Sequence[str] | None = None) -> int:
"""Run the CLI; return 0 on success or 1 on operational errors.
Status reports succeed even for missing or differing installations. Invalid
arguments are handled by argparse with exit code 2.
"""
parser = _build_parser()
args = parser.parse_args(argv)
try:
base_dir = Path.home() if args.scope == "user" else Path.cwd()
if args.skill_command == "status":
for status in skill_status(args.agent, base_dir=base_dir):
state = (
"missing"
if status.state == "missing"
else f"installed ({status.state})"
)
content = (