backlog-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebacklog-cli
backlog-cli
CLI tool for managing Backlog projects via the command.
backlog通过命令管理Backlog项目的CLI工具。
backlogAuthentication
身份验证
Run before use. Verify with .
Switch between spaces with or env var.
backlog auth loginbacklog auth status--space <hostname>BACKLOG_SPACE使用前请运行。通过验证身份。
使用或环境变量在不同空间间切换。
backlog auth loginbacklog auth status--space <主机名>BACKLOG_SPACEKey Concepts
核心概念
Avoid Interactive Prompts
避免交互式提示
Some commands prompt interactively for missing required fields. Always specify all required flags explicitly to prevent hanging.
部分命令会在缺少必填字段时以交互方式提示输入。请始终显式指定所有必填标志,以避免程序挂起。
Name Resolution
名称解析
The CLI automatically resolves human-readable names to IDs:
- Status names → status ID
- Issue type names → issue type ID
- Priority names (/
高/中) → priority ID低 - Usernames → user ID (refers to the authenticated user)
@me
Status and issue type names are project-specific. Query them first if unknown:
bash
backlog issue-type list -p PROJECT_KEY
backlog status list -p PROJECT_KEYCLI会自动将人类可读的名称解析为ID:
- 状态名称 → 状态ID
- 问题类型名称 → 问题类型ID
- 优先级名称(/
高/中)→ 优先级ID低 - 用户名 → 用户ID(指已验证身份的当前用户)
@me
状态和问题类型名称是项目特定的。如果未知,请先查询:
bash
backlog issue-type list -p PROJECT_KEY
backlog status list -p PROJECT_KEYIssue Keys
问题键
Format: (e.g., ). Since the key embeds the project, is not needed for / .
PROJECT_KEY-numberPROJ-123--projectissue viewissue edit格式:(例如:)。由于键中已包含项目信息,在执行 / 时无需指定。
PROJECT_KEY-数字PROJ-123issue viewissue edit--projectProject Key
项目键
Specify with () flag or env var.
--project-pBACKLOG_PROJECT通过()标志或环境变量指定。
--project-pBACKLOG_PROJECTEnvironment Variables
环境变量
Environment variables provide defaults that can be overridden by CLI flags:
- — Default space hostname (e.g.,
BACKLOG_SPACE)example.backlog.com - — Default project key (e.g.,
BACKLOG_PROJECT)MYAPP - — API key for CI/CD environments (requires
BACKLOG_API_KEY)BACKLOG_SPACE
Priority order: CLI flag > Environment variable > Config file ()
~/.backlogrcbash
undefined环境变量提供默认值,可通过CLI标志覆盖:
- — 默认空间主机名(例如:
BACKLOG_SPACE)example.backlog.com - — 默认项目键(例如:
BACKLOG_PROJECT)MYAPP - — CI/CD环境使用的API密钥(需要指定
BACKLOG_API_KEY)BACKLOG_SPACE
优先级顺序:CLI标志 > 环境变量 > 配置文件()
~/.backlogrcbash
undefinedSet project for session
为当前会话设置项目
export BACKLOG_PROJECT=MYAPP
export BACKLOG_PROJECT=MYAPP
Now -p flag can be omitted
现在可省略-p标志
backlog issue list
backlog milestone list
backlog issue list
backlog milestone list
CLI flag overrides environment variable
CLI标志会覆盖环境变量
backlog issue list -p OTHER_PROJECT
undefinedbacklog issue list -p OTHER_PROJECT
undefinedJSON Output
JSON输出
Most commands support flag for machine-readable output:
--json- — output all fields in JSON format
--json - — output only specified fields (e.g.,
--json field1,field2)--json issueKey,summary,status - Combine with for advanced filtering:
jq
bash
undefined大多数命令支持标志以生成机器可读的输出:
--json- — 以JSON格式输出所有字段
--json - — 仅输出指定字段(例如:
--json field1,field2)--json issueKey,summary,status - 与结合使用可实现高级过滤:
jq
bash
undefinedExtract issue keys only
仅提取问题键
backlog issue list -p PROJ --json | jq '.[].issueKey'
backlog issue list -p PROJ --json | jq '.[].issueKey'
Filter by specific status
按特定状态过滤
backlog issue list -p PROJ --json | jq '[.[] | select(.status.name == "処理中")]'
backlog issue list -p PROJ --json | jq '[.[] | select(.status.name == "処理中")]'
Combine field filtering with jq
结合字段过滤与jq
backlog issue list -p PROJ --json issueKey,summary | jq '.[].summary'
**Always use `--json` in agent workflows** to parse output reliably.backlog issue list -p PROJ --json issueKey,summary | jq '.[].summary'
**在Agent工作流中请始终使用`--json`**以确保输出可被可靠解析。Common Workflows
常见工作流
Issues
问题管理
bash
undefinedbash
undefinedList my open issues
查看我的未处理问题
backlog issue list -p PROJ -a @me -S "未対応,処理中"
backlog issue list -p PROJ -a @me -S "未対応,処理中"
View details with comments
查看问题详情及评论
backlog issue view PROJ-123 --comments
backlog issue view PROJ-123 --comments
Create (required: -p, -t, -T, -P)
创建问题(必填:-p, -t, -T, -P)
backlog issue create -p PROJ -t "Title" -T "タスク" -P "中" -a @me -d "Description"
backlog issue create -p PROJ -t "标题" -T "タスク" -P "中" -a @me -d "描述"
Update status with comment
更新状态并添加评论
backlog issue edit PROJ-123 -S "処理中" -c "Starting work"
backlog issue edit PROJ-123 -S "処理中" -c "开始工作"
Close
关闭问题
backlog issue close PROJ-123 -c "Done"
backlog issue close PROJ-123 -c "已完成"
Add comment
添加评论
backlog issue comment PROJ-123 -b "Progress update"
undefinedbacklog issue comment PROJ-123 -b "进度更新"
undefinedPull Requests
拉取请求(PR)
bash
undefinedbash
undefinedCreate (required: -p, -R, -t, -B, --branch)
创建拉取请求(必填:-p, -R, -t, -B, --branch)
backlog pr create -p PROJ -R repo -t "PR title" -B main --branch feat/xxx --issue PROJ-123
backlog pr create -p PROJ -R repo -t "PR标题" -B main --branch feat/xxx --issue PROJ-123
List open PRs
查看未合并的拉取请求
backlog pr list -p PROJ -R repo
backlog pr list -p PROJ -R repo
View with comments
查看拉取请求详情及评论
backlog pr view -p PROJ -R repo 42 --comments
backlog pr view -p PROJ -R repo 42 --comments
Merge
合并拉取请求
backlog pr merge -p PROJ -R repo 42
undefinedbacklog pr merge -p PROJ -R repo 42
undefinedProject Info
项目信息
bash
backlog project list # List projects
backlog project users PROJECT_KEY # List members
backlog category list -p PROJ # List categories
backlog milestone list -p PROJ # List milestonesbash
backlog project list # 查看项目列表
backlog project users PROJECT_KEY # 查看项目成员
backlog category list -p PROJ # 查看分类列表
backlog milestone list -p PROJ # 查看里程碑列表Wiki
Wiki管理
bash
backlog wiki list -p PROJ
backlog wiki view <wiki-id>
backlog wiki create -p PROJ -n "Page title" -b "Content"
backlog wiki edit <wiki-id> -b "Updated content"bash
backlog wiki list -p PROJ
backlog wiki view <wiki-id>
backlog wiki create -p PROJ -n "页面标题" -b "内容"
backlog wiki edit <wiki-id> -b "更新后的内容"Raw API
原始API调用
For operations not covered by CLI commands. The prefix can be omitted.
/api/v2bash
backlog api /issues -X POST -f "projectId=123" -f "summary=New issue"
backlog api /issues --paginate -f "projectId[]=123"用于CLI命令未覆盖的操作。可省略前缀。
/api/v2bash
backlog api /issues -X POST -f "projectId=123" -f "summary=New issue"
backlog api /issues --paginate -f "projectId[]=123"Common Issues
常见问题
Authentication Failed
身份验证失败
If you encounter authentication errors:
bash
undefined如果遇到身份验证错误:
bash
undefinedCheck current authentication status
检查当前身份验证状态
backlog auth status
backlog auth status
Re-authenticate
重新验证身份
backlog auth login
undefinedbacklog auth login
undefined"Status name not found" or "Issue type not found"
"未找到状态名称"或"未找到问题类型"
Status names and issue type names are project-specific. Always query them first:
bash
undefined状态名称和问题类型名称是项目特定的。请始终先查询:
bash
undefinedGet available statuses for a project
获取项目的可用状态
backlog status list -p PROJECT_KEY
backlog status list -p PROJECT_KEY
Get available issue types for a project
获取项目的可用问题类型
backlog issue-type list -p PROJECT_KEY
backlog issue-type list -p PROJECT_KEY
Get available priorities (these are global)
获取可用优先级(这些是全局的)
Built-in values: 高 (High), 中 (Normal), 低 (Low)
内置值:高 (High), 中 (Normal), 低 (Low)
**Before creating or editing issues:**
1. Query status names: `backlog status list -p PROJECT`
2. Query issue types: `backlog issue-type list -p PROJECT`
3. Use exact names from the query results
**在创建或编辑问题前:**
1. 查询状态名称:`backlog status list -p PROJECT`
2. 查询问题类型:`backlog issue-type list -p PROJECT`
3. 使用查询结果中的精确名称Missing Required Fields
缺少必填字段
If a command hangs or prompts for input:
- You're missing a required field
- Specify all required flags explicitly (see command help with )
--help - Never rely on interactive prompts in agent workflows
如果命令挂起或提示输入:
- 你遗漏了必填字段
- 显式指定所有必填标志(使用查看命令帮助)
--help - 在Agent工作流中切勿依赖交互式提示
Project Not Found
未找到项目
Ensure the project key is correct and you have access:
bash
undefined确保项目键正确且你拥有访问权限:
bash
undefinedList available projects
查看可用项目列表
backlog project list
backlog project list
Use exact project key from the list
使用列表中的精确项目键
undefinedundefinedReferences
参考资料
- Full command options: references/commands.md
- Data model schemas: references/schema.md
- 完整命令选项:references/commands.md
- 数据模型架构:references/schema.md