• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Chungzter / CommiZard / 20504362644

25 Dec 2025 11:28AM UTC coverage: 86.425% (-1.9%) from 88.305%
20504362644

push

github

Chungzter
fix CI checks

2 of 5 new or added lines in 3 files covered. (40.0%)

33 existing lines in 4 files now uncovered.

382 of 442 relevant lines covered (86.43%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.28
/src/commizard/cli.py
1
from __future__ import annotations
1✔
2

3
import concurrent.futures
1✔
4
import sys
1✔
5

6
from . import __version__ as version
1✔
7
from . import commands, config, output, start
1✔
8

9
help_msg = """
1✔
10
Commit writing wizard
11

12
Usage:
13
  commizard [-v | --version] [-h | --help] [--no-color] [--no-banner]
14

15
Options:
16
  -h, --help       Show help for commizard
17
  -v, --version    Show version information
18
  --no-color       Don't colorize output
19
  --no-banner      Disable the ASCII welcome banner
20
  --stream         Stream generated prompt to stdout
21
"""
22

23

24
def handle_args():
1✔
25
    if len(sys.argv) < 2:
1✔
26
        return
1✔
27
    supported_args = [
1✔
28
        "-v",
29
        "--version",
30
        "-h",
31
        "--help",
32
        "--no-banner",
33
        "--no-color",
34
        "--stream",
35
    ]
36
    if sys.argv[1] not in supported_args:
1✔
37
        print(f"Unknown option: {sys.argv[1]}")
1✔
38
        print("try 'commizard -h' for more information.")
1✔
39
        sys.exit(2)
1✔
40
    if sys.argv[1] in ("-v", "--version"):
1✔
41
        print(f"CommiZard {version}")
1✔
42
        sys.exit(0)
1✔
43
    elif sys.argv[1] in ("-h", "--help"):
1✔
44
        print(help_msg.strip(), end="\n")
1✔
45
        sys.exit(0)
1✔
46
    elif sys.argv[1] == "--no-banner":
1✔
47
        config.SHOW_BANNER = False
1✔
48
    elif sys.argv[1] == "--no-color":
1✔
49
        config.USE_COLOR = False
1✔
50
    elif sys.argv[1] == "--stream":
1✔
UNCOV
51
        config.STREAM = True
×
52

53

54
def main() -> int:
1✔
55
    """
56
    This is the entry point of the program. calls some functions at the start,
57
    then jumps into an infinite loop.
58

59
    Returns:
60
        int: Exit code (0 for success, non-zero for errors)
61
    """
62
    handle_args()
1✔
63
    with concurrent.futures.ThreadPoolExecutor() as executor:
1✔
64
        fut_git = executor.submit(start.check_git_installed)
1✔
65
        fut_ai = executor.submit(start.local_ai_available)
1✔
66
        fut_worktree = executor.submit(start.is_inside_working_tree)
1✔
67
        git_ok = fut_git.result()
1✔
68
        ai_ok = fut_ai.result()
1✔
69
        worktree_ok = fut_worktree.result()
1✔
70

71
    if not git_ok:
1✔
72
        output.print_error("git not installed")
1✔
73
        return 1
1✔
74

75
    if not worktree_ok:
1✔
76
        output.print_error("not inside work tree")
1✔
77
        return 1
1✔
78

79
    output.init_console(config.USE_COLOR)
1✔
80

81
    if config.SHOW_BANNER:
1✔
82
        start.print_welcome(config.USE_COLOR)
1✔
83

84
    if not ai_ok:
1✔
85
        output.print_warning("local AI not available")
1✔
86

87
    try:
1✔
88
        while True:
1✔
89
            user_input = input("CommiZard> ").strip()
1✔
90
            if user_input in ("exit", "quit"):
1✔
91
                print("Goodbye!")
1✔
92
                break
1✔
93
            elif user_input == "":
1✔
94
                continue
1✔
95
            commands.parser(user_input)
1✔
96
    except (EOFError, KeyboardInterrupt):
1✔
97
        print("\nGoodbye!")
1✔
98

99
    return 0
1✔
100

101

102
if __name__ == "__main__":  # pragma: no cover
103
    main()
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc