redmine-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRedmine CLI
Redmine CLI
A CLI for the Redmine REST API. Use for detailed flags and examples — this skill only covers what cannot tell you.
redmine <command> --help--help这是一款基于Redmine REST API的CLI工具。使用可查看详细的参数和示例——本技能仅涵盖未提及的内容。
redmine <command> --help--helpAvailable Commands
可用命令
Only these top-level commands exist. Do NOT invent subcommands that aren't listed here — run to discover subcommands.
redmine <command> --help| Command | Purpose |
|---|---|
| Create, list, get, update, close, reopen, assign, comment, delete, search, browse issues |
| List, get, create, update, delete projects; list project members |
| Log, list, get, update, delete, summarize time entries |
| Create, list, get, update, delete project versions (milestones) |
| List, get, create, update, delete project memberships |
| List, get, create, update, delete users |
| List, get, create, update, delete groups; add/remove users |
| List issue categories |
| List trackers |
| List issue statuses |
| Search issues, wiki, news, messages, or browse results |
| Login, logout, list, switch, and check status of authentication profiles |
| List, get, create, update, delete wiki pages |
| Make raw authenticated API requests |
仅存在以下顶级命令。请勿自行发明未列出的子命令——运行以查看子命令。
redmine <command> --help| 命令 | 用途 |
|---|---|
| 创建、列出、获取、更新、关闭、重新打开、分配、评论、删除、搜索、浏览问题 |
| 列出、获取、创建、更新、删除项目;列出项目成员 |
| 记录、列出、获取、更新、删除、汇总工时条目 |
| 创建、列出、获取、更新、删除项目版本(里程碑) |
| 列出、获取、创建、更新、删除项目成员关系 |
| 列出、获取、创建、更新、删除用户 |
| 列出、获取、创建、更新、删除组;添加/移除用户 |
| 列出问题分类 |
| 列出追踪器 |
| 列出问题状态 |
| 搜索问题、维基、新闻、消息,或浏览结果 |
| 登录、登出、列出、切换及检查认证配置文件状态 |
| 列出、获取、创建、更新、删除维基页面 |
| 发起已认证的原始API请求 |
Setup
设置
If the command is not found, install it:
redminebash
curl -fsSL https://raw.githubusercontent.com/aarondpn/redmine-cli/main/install.sh | bashThen run for interactive configuration. Use to verify an existing setup.
redmine auth loginredmine config如果未找到命令,请进行安装:
redminebash
curl -fsSL https://raw.githubusercontent.com/aarondpn/redmine-cli/main/install.sh | bash然后运行进行交互式配置。使用验证现有配置。
redmine auth loginredmine configCritical Rules
重要规则
- Always use when you need to parse output programmatically. JSON goes to stdout only; stderr is separate.
-o json - Use to fetch ALL results. The default limit is 100.
--limit 0 - All name-accepting flags (--project, --tracker, --status, --priority, --assignee, --category, --version, --activity) resolve human-readable names automatically. You don't need to look up IDs first.
- refers to the current API user.
--assignee me - shows all issues regardless of status (default is
--status "*").open
- 当需要以编程方式解析输出时,务必使用。JSON仅输出到stdout;stderr是单独的输出流。
-o json - **使用**以获取所有结果。默认限制为100条。
--limit 0 - 所有接受名称的参数(--project、--tracker、--status、--priority、--assignee、--category、--version、--activity)会自动解析人类可读的名称。无需预先查找ID。
- ****指代当前API用户。
--assignee me - ****显示所有状态的问题(默认是
--status "*")。open
When Something Doesn't Work: Stop and Use --help
--help遇到问题时:停止操作并使用--help
--helpDo NOT guess, loop, or retry with invented flags/subcommands. If a command fails or you're unsure about the correct syntax:
- Run (or
redmine <command> --help) to see the actual available options, flags, and subcommands.redmine <command> <subcommand> --help - Read the help output carefully — it is authoritative and always up to date. Trust it over your own assumptions.
- Never invent flags or subcommands that aren't shown in . If you think an option should exist but it doesn't appear in the help, it doesn't exist.
--help - Do not loop — if the same command fails twice, stop and re-read the help output. Do not keep retrying with slight variations hoping one will work.
- Parse output with and standard JSON tools (jq) — never use Python scripts, awk hacks, or regex to parse CLI output. The CLI's JSON output is well-structured; use it.
-o json - Ask the user if the help output doesn't clarify things — that's better than spiraling through failed attempts.
请勿猜测、循环或使用自行发明的参数/子命令重试。如果命令执行失败或不确定正确语法:
- 运行(或
redmine <command> --help)查看实际可用的选项、参数和子命令。redmine <command> <subcommand> --help - 仔细阅读帮助输出——它是权威且始终最新的。请相信帮助内容而非自身假设。
- 绝不要发明未在中显示的参数或子命令。如果认为某个选项应该存在但未在帮助中显示,那它实际上并不存在。
--help - 不要循环重试——如果同一命令失败两次,请停止操作并重新阅读帮助输出。不要不断尝试微小的变体以期成功。
- 使用和标准JSON工具(如jq)解析输出——绝不要使用Python脚本、awk技巧或正则表达式解析CLI输出。CLI的JSON输出结构清晰,请直接使用。
-o json - 如果帮助输出未明确说明,请询问用户——这比不断尝试失败的操作更好。
Permission Gotcha: Users & Groups
权限陷阱:用户与组
Resolving users and groups by name requires admin privileges. If you get a permission error:
- Do NOT retry with the same name
- Use for the current user
me - To discover user IDs without admin access, extract them from other sources:
- — the
redmine issues list --project <project> -o jsonandassigned_tofields contain user IDs and namesauthor - — lists all project members with their IDs
redmine memberships list --project <project> -o json - — journal entries contain user references
redmine issues get <id> --journals -o json
通过名称解析用户和组需要管理员权限。如果遇到权限错误:
- 请勿使用相同名称重试
- 对当前用户使用
me - 若没有管理员权限,可从其他来源获取用户ID:
- ——
redmine issues list --project <project> -o json和assigned_to字段包含用户ID和名称author - ——列出所有项目成员及其ID
redmine memberships list --project <project> -o json - ——日志条目包含用户引用
redmine issues get <id> --journals -o json
Workflow: Resolving Ambiguous Values
工作流:解析模糊值
When a command needs a value from a fixed set (tracker, status, priority, category, version, assignee) and you're not sure of the exact name:
- Query options first: ,
redmine trackers list -o json, etc.redmine statuses list -o json - Present choices to the user via AskUserQuestion with a formatted list
- Use the confirmed value in the command
For users/groups, if the list endpoint fails with a permission error, use the workarounds from the section above instead.
当命令需要从固定集合(追踪器、状态、优先级、分类、版本、经办人)中取值且不确定确切名称时:
- 先查询选项:、
redmine trackers list -o json等。redmine statuses list -o json - 通过AskUserQuestion向用户展示可选列表
- 在命令中使用用户确认的值
对于用户/组,如果列表端点因权限错误无法访问,请使用上述部分的解决方法。
After Creating Resources
创建资源后
When you create an issue, project, user, or other resource, the CLI returns the new ID. Offer the user a clickable URL so they can open it in the browser:
- Issues: opens the issue directly. You can also provide the URL:
redmine issues open <id><server>/issues/<id> - Projects:
<server>/projects/<identifier> - Users:
<server>/users/<id> - Time entries:
<server>/time_entries/<id>/edit
Get the server URL from (or from the JSON output's hints). Always mention the URL or the command after a successful create so the user can quickly navigate to the new resource.
redmine configopen当创建问题、项目、用户或其他资源时,CLI会返回新资源的ID。请为用户提供可点击的URL,以便他们在浏览器中打开:
- 问题:可直接打开问题。也可提供URL:
redmine issues open <id><server>/issues/<id> - 项目:
<server>/projects/<identifier> - 用户:
<server>/users/<id> - 工时条目:
<server>/time_entries/<id>/edit
从(或JSON输出的提示)中获取服务器URL。成功创建资源后,务必告知用户URL或命令,以便他们快速访问新资源。
redmine configopenNon-Obvious Behaviors
非直观行为
- defaults to
redmine issues list. Use--status open,--status closed, or a specific status name.--status "*" - includes comments/history. Also available:
redmine issues get <id> --journals,--children.--relations - only sends flags you explicitly pass — omitted flags are not changed.
redmine issues update - If is omitted, the configured default project is used (set via
--project).redmine auth login - Projects can accumulate hundreds of versions, most of them closed or locked. When you need a version for a new issue, time entry, or similar workflow, always start from so the shortlist stays small and you don't pick a version that can no longer accept work.
redmine versions list --open - Any date flag (,
--due-date,--date,--from) accepts the literal keyword--toas a shortcut for the current date.today
- 默认使用
redmine issues list。可使用--status open、--status closed或特定状态名称。--status "*" - 包含评论/历史记录。还可使用
redmine issues get <id> --journals、--children参数。--relations - 仅发送你明确传入的参数——未传入的参数不会被修改。
redmine issues update - 如果省略,将使用配置的默认项目(通过
--project设置)。redmine auth login - 项目可能累积数百个版本,其中大多数已关闭或锁定。当需要为新问题、工时条目或类似工作流选择版本时,请始终从开始,这样候选列表会更小,且不会选择无法再接受工作的版本。
redmine versions list --open - 任何日期参数(、
--due-date、--date、--from)都接受字面关键字--to作为当前日期的快捷方式。today