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

FlagTypeDefaultDescription
--refstringBranch, tag, or SHA

madtea dir list-root

List root directory contents

FlagTypeDefaultDescription
--refstringBranch, 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

FlagTypeDefaultDescription
--author-emailstringCustom commit author email
--author-namestringCustom commit author name
--branchstringBranch to create file on
--committer-emailstringCustom committer email
--committer-namestringCustom committer name
--date-authorstringCustom author date (ISO 8601)
--date-committerstringCustom committer date (ISO 8601)
--messagestringCommit message (required)
--new-branchstringCreate file on a new branch with this name

madtea file delete

Delete a file

FlagTypeDefaultDescription
--branchstringBranch to delete file from
--messagestringCommit message (required)
--shastringCurrent file SHA (required)

madtea file get

Get file content

FlagTypeDefaultDescription
--refstringBranch, tag, or SHA to get content from

madtea file get-ext

Get extended file contents

FlagTypeDefaultDescription
--refstringBranch, tag, or SHA

madtea file update

Update an existing file

FlagTypeDefaultDescription
--author-emailstringCustom commit author email
--author-namestringCustom commit author name
--branchstringBranch to update file on
--committer-emailstringCustom committer email
--committer-namestringCustom committer name
--date-authorstringCustom author date (ISO 8601)
--date-committerstringCustom committer date (ISO 8601)
--messagestringCommit message (required)
--new-branchstringCreate file on a new branch with this name
--shastringCurrent 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.