Files & Content
Generated automatically at build time from the madtea repository - do not edit here. Source: docs/reference/files.md.
CLI Commands
madtea dir list
List directory contents
| Flag | Type | Default | Description |
|---|---|---|---|
--ref | string | Branch, tag, or SHA |
madtea dir list-root
List root directory contents
| Flag | Type | Default | Description |
|---|---|---|---|
--ref | string | Branch, tag, or SHA |
madtea file batch
Batch file operations
madtea file contents
Get file contents via file-contents endpoint
madtea file create
Create a new file
| Flag | Type | Default | Description |
|---|---|---|---|
--author-email | string | Custom commit author email | |
--author-name | string | Custom commit author name | |
--branch | string | Branch to create file on | |
--committer-email | string | Custom committer email | |
--committer-name | string | Custom committer name | |
--date-author | string | Custom author date (ISO 8601) | |
--date-committer | string | Custom committer date (ISO 8601) | |
--message | string | Commit message (required) | |
--new-branch | string | Create file on a new branch with this name |
madtea file delete
Delete a file
| Flag | Type | Default | Description |
|---|---|---|---|
--branch | string | Branch to delete file from | |
--message | string | Commit message (required) | |
--sha | string | Current file SHA (required) |
madtea file get
Get file content
| Flag | Type | Default | Description |
|---|---|---|---|
--ref | string | Branch, tag, or SHA to get content from |
madtea file get-ext
Get extended file contents
| Flag | Type | Default | Description |
|---|---|---|---|
--ref | string | Branch, tag, or SHA |
madtea file update
Update an existing file
| Flag | Type | Default | Description |
|---|---|---|---|
--author-email | string | Custom commit author email | |
--author-name | string | Custom commit author name | |
--branch | string | Branch to update file on | |
--committer-email | string | Custom committer email | |
--committer-name | string | Custom committer name | |
--date-author | string | Custom author date (ISO 8601) | |
--date-committer | string | Custom committer date (ISO 8601) | |
--message | string | Commit message (required) | |
--new-branch | string | Create file on a new branch with this name | |
--sha | string | Current file SHA (required) |
MCP Tools
madt_files
Read, list, write, and batch-edit repository file contents.
Output schema: declared
One tool, action-dispatched. Set action to one of:
action="batch"
Batch create/update/delete files in a single commit (atomic; never loop single-file writes). Pass the payload as JSON in files (see that field for the shape). Two prereqs: unlike create/update, each entry’s content must be base64-encoded BY THE CALLER, and update/delete entries need the current per-file sha.
Required: files
action="contents"
Bulk-read multiple files in a single request. Returns a map keyed by path, each value carrying the same file metadata + base64 content as get_ext. Gitea-only. NOTE: always reads the DEFAULT branch — ref is not honored here (use get/get_ext per file for a specific ref).
Required: paths
action="create"
Create a new file. Content is base64-encoded automatically — text/string content only; for binary, large, or multi-file commits use action=batch (caller base64-encodes each entry) or the raw api passthrough. Use new_branch to commit onto a fresh branch (e.g. for a PR, or a protected target).
Required: path, content, message
Optional: branch, new_branch, author_name, author_email, committer_name, committer_email, date_author, date_committer
action="delete"
Delete a file. Requires the current file SHA.
Required: path, message, sha
Optional: branch
action="get"
Get file contents at an optional ref (branch, tag, or SHA). Text is decoded; binary content is returned base64-encoded.
Required: path
Optional: ref
action="get_ext"
Get extended file contents with richer metadata than the standard get. Content is returned base64-encoded (NOT decoded) — use action=get for decoded text.
Required: path
Optional: ref
action="list"
List directory contents. Omit path (or pass an empty string) to list the repository root.
Optional: path, ref
action="update"
Update an existing file. Requires the current file SHA (from action=get). Use new_branch to commit onto a fresh branch (e.g. for a PR, or when the target/default branch is protected).
Required: path, content, message, sha
Optional: branch, new_branch, author_name, author_email, committer_name, committer_email, date_author, date_committer
Canonical source: docs/reference/files.md in the madtea repo.