Commit
commit
GitCommitTool — batched atomic commits with commit-hook handling.
GitCommitTool
Bases: AXMTool
Execute one or more atomic commits in a single call.
Each commit in the batch is processed sequentially: stage files,
run git commit (the repo's commit hooks fire automatically), and
capture the result. If a commit fails (e.g. a hook rejects it),
processing stops and the error is returned alongside any commits
that already succeeded.
When a commit hook auto-fixes files (e.g. ruff --fix),
the tool automatically re-stages and retries the commit once.
The hook runner is whatever the repo installs at
.git/hooks/pre-commit (pre-commit OR prek); axm-git never
invokes the runner directly — git does.
Registered as git_commit via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/commit.py
| Python | |
|---|---|
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', commits=None, profile=None, strict=False, **kwargs)
Execute batched commits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root (required). |
'.'
|
commits
|
list[dict[str, object]] | None
|
List of commit specs, each a dict with keys:
- |
None
|
profile
|
str | None
|
Optional identity profile name. Overrides
schedule-based resolution from |
None
|
strict
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with list of committed results and an |
ToolResult
|
|
Source code in packages/axm-git/src/axm_git/tools/commit.py
| Python | |
|---|---|
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |