Skip to content

Commit Cmd

Command for generating conventional commit messages from Git diffs.

logger module-attribute

logger = getLogger(__name__)

NonInteractiveFlag module-attribute

NonInteractiveFlag = Annotated[
	bool,
	Option(
		"--non-interactive",
		"-y",
		help="Run in non-interactive mode",
	),
]

BypassHooksFlag module-attribute

BypassHooksFlag = Annotated[
	bool,
	Option(
		"--bypass-hooks",
		"--no-verify",
		help="Bypass git hooks with --no-verify",
	),
]

register_command

register_command(app: Typer) -> None

Register the commit commands with the CLI app.

Source code in src/codemap/cli/commit_cmd.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def register_command(app: typer.Typer) -> None:
	"""Register the commit commands with the CLI app."""

	@app.command(name="commit")
	@asyncer.runnify
	async def semantic_commit_command(
		non_interactive: NonInteractiveFlag = False,
		bypass_hooks: BypassHooksFlag = False,
		pathspecs: list[str] | None = None,
	) -> None:
		"""
		Generate semantic commits by grouping related changes.

		This command analyzes your changes, groups them semantically, and
		creates multiple focused commits with AI-generated messages.

		"""
		# Defer heavy imports and logic to the implementation function
		await _semantic_commit_command_impl(
			non_interactive=non_interactive,
			bypass_hooks=bypass_hooks,
			pathspecs=pathspecs,
		)