"""CLI 入口 - fix-bugs 命令"""
import argparse
import sys


def main():
    parser = argparse.ArgumentParser(
        prog="fix-bugs",
        description="AI-powered parallel bug fixer using Claude CLI and VS Code",
    )
    sub = parser.add_subparsers(dest="command")
    sub.add_parser("run", help="解析 bugs.md 并触发修复（默认行为）")
    sub.add_parser("install", help="安装 VS Code 扩展到当前项目")

    args = parser.parse_args()

    if args.command == "install":
        from claude_fix_bugs.installer import install
        install()
    else:
        from claude_fix_bugs.fixer import run
        run()


if __name__ == "__main__":
    main()
