commit_files
Atomically commit multiple file creates, updates, and deletes in one git commit. All operations are validated before any write; if any validation fails, no files are committed and a structured payload identifies every failing path. Each entry in ‘files’ is an object with: action (str, required) — ‘create’, ‘update’, or ‘delete’ path (str, required) — project-relative path (e.g. ‘model/revenue.py’) content (str) — file content; required for create/update, omit for delete encoding (str, default ‘text’) — ‘text’ for UTF-8 or ‘base64’ for binary; ‘auto’ is not allowed on writes expected_sha (str) — current blob SHA for optimistic concurrency; if stale, the call aborts with the current SHA so you can merge and retry Specify branch to commit to a non-default branch. Omitting branch or passing null commits to the project’s default branch. commit_message is required and should describe the change set. Requires at least Editor access to the project. Returns on success: project (str) — project name branch (str|null) — branch committed to (null = default branch) commit_sha (str) — git commit SHA for the batch files_changed (int) — number of files in the commit Returns on validation failure (no files committed): error (str) — ‘commit-validation-failed’ message (str) — human-readable summary hint (str) — suggested action failures (list) — per-path failure objects, each with: path (str) — offending file path reason (str) — error code (‘invalid-path’, ‘file-not-found’, ‘sha-mismatch’, ‘file-exists’, etc.) message (str) — human-readable description current_sha (str) — present when reason is ‘sha-mismatch’ or ‘file-exists’ your_sha (str) — present when reason is ‘sha-mismatch’ Example — atomically commit a model, run.py, and README.md: commit_files( project_name=‘q4-forecast’, commit_message=‘feat: add revenue model with drivers and entrypoint’, files=[ {‘action’:‘create’,‘path’:‘model/revenue.py’,‘content’:’…’}, {‘action’:‘create’,‘path’:‘run.py’,‘content’:’…’}, {‘action’:‘update’,‘path’:‘README.md’,‘content’:’…’,‘expected_sha’:‘abc’}, ], )
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | str | Yes | — | |
files | list[dict[str, Any]] | Yes | — | |
commit_message | str | Yes | — | |
branch | `str | None` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
project(string)branch(string)commit_sha(string)files_changed(integer)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "commit_files", "arguments": { "project_name": "forecasts", "branch": "scenario/actuals-rebase", "commit_message": "feat: update FP&A variance model and run contract", "files": [ { "action": "update", "path": "model/revenue.py", "content": "inputs = ['actuals', 'plan']\noutputs = ['variance_summary']\ndependencies = []\n\nresult = {'variance_summary': [{'month': '2026-03', 'actual': 128000, 'plan': 120000, 'variance': 8000}]}\n", "encoding": "text", "expected_sha": "0123456789abcdef0123456789abcdef01234567" }, { "action": "update", "path": "run.py", "content": "PIPELINE = ['revenue']\n", "encoding": "text", "expected_sha": "fedcba9876543210fedcba9876543210fedcba98" }, { "action": "create", "path": "README.md", "content": "# Revenue variance workflow\n\nRuns forecast versus actuals.\n", "encoding": "text" } ] }}Response
Section titled “Response”{ "project": "forecasts", "branch": "scenario/actuals-rebase", "commit_sha": "abc1234def5678901234567890abcdef12345678", "files_changed": 3}- Module:
Models - Requires authentication via API token or Auth0 JWT.