Redmine Tools Skill
This skill provides a Node.js CLI to fetch, update, and summarize Redmine issues.
Command
CODEBLOCK0
Supported Flags
- -
--id <issueId>: Required Redmine issue ID. - INLINECODE1 : Optional include fields. Defaults to
attachments,journals. - INLINECODE3 : Optional for
update. New Redmine status ID. - INLINECODE5 : Optional for
update. Journal note content. - At least one of
--status_id or --notes must be provided for update.
Environment Variables
- -
REDMINE_BASE_URL: Redmine base URL, for example https://redmine.example.com. - INLINECODE12 : Redmine API key.
- INLINECODE13 : OpenAI-compatible API base URL or full
/chat/completions URL. - INLINECODE15 : OpenAI-compatible API key.
- INLINECODE16 : Model name used for image summarization.
- INLINECODE17 : Prompt used to summarize each image attachment.
Behavior
- -
get uses endpoint: /issues/:id.json with include=attachments,journals by default. - INLINECODE21 uses endpoint:
/issues/:id.json (HTTP PUT) and sends only the provided status_id and/or notes fields. - INLINECODE26 fetches issue attachments, keeps supported image files, and summarizes each image through an OpenAI-compatible
chat/completions API. - Reads base URL and API key from environment variables only.
- Reads model URL, key, model name, and image summary prompt from environment variables.
- Prints JSON output to stdout.
- Returns non-zero exit code on errors.
Image Command Notes
- - Supported image types:
png, jpg, jpeg, webp, gif. - Non-image or unsupported attachments are skipped and reported in the output.
- The command downloads each image attachment and sends it as a data URL to the model.
- The model prompt can include your own formatting, tone, or output constraints.
Examples
CODEBLOCK1
Redmine 工具技能
该技能提供了一个 Node.js 命令行工具,用于获取、更新和总结 Redmine 问题。
命令
bash
node scripts/redmine.js get --id <问题ID>
node scripts/redmine.js update --id <问题ID> [--status_id <状态ID>] [--notes <文本>]
node scripts/redmine.js image --id <问题ID>
支持的标志
- - --id <问题ID>:必填的 Redmine 问题 ID。
- --include <字段>:可选的包含字段。默认为 attachments,journals。
- --statusid <状态ID>:update 命令的可选参数。新的 Redmine 状态 ID。
- --notes <文本>:update 命令的可选参数。日志备注内容。
- update 命令必须至少提供 --statusid 或 --notes 中的一个。
环境变量
- - REDMINEBASEURL:Redmine 基础 URL,例如 https://redmine.example.com。
- REDMINEAPIKEY:Redmine API 密钥。
- OPENAIAPIURL:兼容 OpenAI 的 API 基础 URL 或完整的 /chat/completions URL。
- OPENAIAPIKEY:兼容 OpenAI 的 API 密钥。
- OPENAIMODEL:用于图片总结的模型名称。
- OPENAIIMAGESUMMARYPROMPT:用于总结每张图片附件的提示词。
行为说明
- - get 命令默认使用端点:/issues/:id.json,并包含 include=attachments,journals。
- update 命令使用端点:/issues/:id.json(HTTP PUT),仅发送提供的 status_id 和/或 notes 字段。
- image 命令获取问题附件,保留支持的图片文件,并通过兼容 OpenAI 的 chat/completions API 总结每张图片。
- 仅从环境变量读取基础 URL 和 API 密钥。
- 从环境变量读取模型 URL、密钥、模型名称和图片总结提示词。
- 将 JSON 输出打印到标准输出。
- 出错时返回非零退出码。
图片命令说明
- - 支持的图片类型:png、jpg、jpeg、webp、gif。
- 非图片或不支持的附件将被跳过,并在输出中报告。
- 该命令会下载每张图片附件,并将其作为数据 URL 发送给模型。
- 模型提示词可以包含您自己的格式、语气或输出约束。
示例
bash
export REDMINEBASEURL=https://redmine.example.com
export REDMINEAPIKEY=xxxx
export OPENAIAPIURL=https://api.openai.com/v1
export OPENAIAPIKEY=xxxx
export OPENAI_MODEL=gpt-4.1-mini
export OPENAIIMAGESUMMARY_PROMPT=总结这张图片显示的内容,解释其与问题的可能关联,并保持回答简洁。
node scripts/redmine.js get --id 123
node scripts/redmine.js get --id 123 --include attachments,journals,watchers
node scripts/redmine.js update --id 123 --status_id 3 --notes 问题已修复并验证
node scripts/redmine.js update --id 123 --status_id 3
node scripts/redmine.js update --id 123 --notes 需要QA提供更多日志
node scripts/redmine.js image --id 123