MantisBT supports issue attachments through the REST API, but mantisbt-cli currently only supports issue CRUD and issue notes. It should be possible to attach patch files, screenshots, logs, and other local files to an existing issue from the CLI.
Proposed initial scope:
mantisbt-cli issue file add <issue_id> <path>...
mantisbt-cli issue file list <issue_id>
mantisbt-cli issue file get <issue_id> <file_id> --output <path>
A patch-specific workflow would then compose naturally with Git:
git diff > fix.patch
mantisbt-cli issue file add 1234 fix.patch
Implementation notes:
- Keep this as generic attachment support rather than a dedicated patch command.
- Preserve the standard-library-only dependency policy.
- The MantisBT REST endpoint for adding attachments is
POST /api/rest/issues/{issue_id}/files.
- The upload payload uses JSON with
files entries containing a filename and base64-encoded content, so this can fit the existing JSON request style without multipart support.
- Consider
--json behavior for raw API responses and human-readable output for add/list/get.
- Document the commands in
README.md and skills/mantisbt/SKILL.md.
Acceptance criteria:
issue file add <issue_id> <path>... uploads one or more files to an existing issue.
issue file list <issue_id> lists issue attachments with enough information to select one.
issue file get <issue_id> <file_id> --output <path> downloads an attachment to disk.
- Missing files, invalid output paths, and API errors produce clear CLI errors.
- Tests cover routing/request bodies and output behavior.
go test ./..., go vet ./..., and gofmt pass.
MantisBT supports issue attachments through the REST API, but
mantisbt-clicurrently only supports issue CRUD and issue notes. It should be possible to attach patch files, screenshots, logs, and other local files to an existing issue from the CLI.Proposed initial scope:
A patch-specific workflow would then compose naturally with Git:
git diff > fix.patch mantisbt-cli issue file add 1234 fix.patchImplementation notes:
POST /api/rest/issues/{issue_id}/files.filesentries containing a filename and base64-encoded content, so this can fit the existing JSON request style without multipart support.--jsonbehavior for raw API responses and human-readable output for add/list/get.README.mdandskills/mantisbt/SKILL.md.Acceptance criteria:
issue file add <issue_id> <path>...uploads one or more files to an existing issue.issue file list <issue_id>lists issue attachments with enough information to select one.issue file get <issue_id> <file_id> --output <path>downloads an attachment to disk.go test ./...,go vet ./..., andgofmtpass.