@cognelis/jira-cli 0.0.0-stage → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,146 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.6.0] - 2026-11-28
6
+
7
+ ### Changed
8
+
9
+ - On macOS, `init` now asks for the Jira base URL and profile name before
10
+ requesting credentials. It uses the appropriate REST version to verify login
11
+ and rejects an existing name bound to a different site. Upgrading requires
12
+ no migration or reauthentication for existing Keychain profiles.
13
+ - Public examples and validation reports use generic sites and issue keys.
14
+ Package metadata and contributor guidance omit the personal email address.
15
+
16
+ ## [0.5.1] - 2026-11-28
17
+
18
+ ### Fixed
19
+
20
+ - `npm pack` builds the Node CLI before creating the tarball, including on a
21
+ clean checkout. Package installation tests now exercise that same pack hook.
22
+ - `npm publish --dry-run` can run the installation tests: only their temporary
23
+ local pack and install operations opt out of the outer dry run.
24
+
25
+ ## [0.5.0] - 2026-11-28
26
+
27
+ ### Added
28
+
29
+ - `jira-cli profile` lists saved connections and marks the default. The
30
+ `list`, `show`, `add` and `use` subcommands share existing configuration
31
+ with `config` and support offline zsh completion.
32
+
33
+ ## [0.4.3] - 2026-11-28
34
+
35
+ ### Changed
36
+
37
+ - Search results use the same issue headings as the detail view, with compact
38
+ status, assignee and priority metadata. Doctor groups site and identity
39
+ information using the same terminal styling.
40
+
41
+ ## [0.4.2] - 2026-11-28
42
+
43
+ ### Changed
44
+
45
+ - Issue and comment views highlight the issue key and comment authors, align
46
+ metadata, and indent multiline bodies. Terminal styling respects `NO_COLOR`
47
+ and `TERM=dumb`. Exported text stays free of ANSI escapes.
48
+
49
+ ## [0.4.1] - 2026-11-28
50
+
51
+ ### Changed
52
+
53
+ - zsh completion menus describe commands, subcommands and options in Chinese.
54
+ - Terminal issue details and comment lists share a plain-text comment layout,
55
+ show readable Jira links and timestamps with offsets, and distinguish embedded
56
+ previews from a complete comment collection.
57
+
58
+ ## [0.4.0] - 2026-11-28
59
+
60
+ ### Added
61
+
62
+ - Offline zsh completions for commands, options, formats and local profile names.
63
+ - Human-readable CLI output and live-check reports in interactive terminals.
64
+ Use `--format json` to retain the previous terminal output. Pipes, redirects
65
+ and default file output continue to use JSON.
66
+
67
+ ## [0.3.0] - 2026-11-28
68
+
69
+ ### Added
70
+
71
+ - On macOS, `jira-cli init` prompts for a Jira username and a hidden API token,
72
+ verifies the account and activates a preset profile with a macOS Keychain
73
+ credential. Subsequent commands and live tests can use it without re-entry.
74
+ - Existing file and environment credentials remain supported. Re-run init to
75
+ switch a same-site file-backed profile to Keychain. Older CLI versions cannot
76
+ read profiles containing the new Keychain reference.
77
+
78
+ ## [0.2.0] - 2026-11-28
79
+
80
+ ### Added
81
+
82
+ - Repository live checks accept `--extended` to compare manual single-comment
83
+ pages with automatic pagination and validate metadata on a separate visible
84
+ issue with attachments. Existing profiles work for both modes.
85
+
86
+ ## [0.1.2] - 2026-11-28
87
+
88
+ ### Fixed
89
+
90
+ - `doctor` requires an account identifier from `/myself` before reporting an
91
+ authenticated identity. A malformed successful response returns `INVALID_RESPONSE` (exit 5).
92
+ - HTTP 401 recovery hints identify the selected authentication mode and the
93
+ corresponding configuration to check.
94
+ - The live runner marks each check successful only after validating its output.
95
+ An empty or mismatched exact-key search now fails at that step with exit 1.
96
+ Failure summaries retain the CLI code, HTTP status and recovery hints while
97
+ omitting server-supplied error messages.
98
+ - Documented one-off authentication without a profile and corrected the setup
99
+ example for a Jira Server deployment.
100
+
101
+ ### Validation
102
+
103
+ - A user-run authenticated live check on Jira Server passed all six
104
+ checks for a visible issue with a Jira username and site-issued API token via Basic auth.
105
+
106
+ ## [0.1.1] - 2026-11-28
107
+
108
+ ### Fixed
109
+
110
+ - `config set` now uses the same Cloud host inference as environment-based
111
+ connections. Explicit `--flavor` still wins; existing saved profiles are unchanged.
112
+ - Reject malformed pagination metadata instead of reporting a truncated page as
113
+ complete. Valid absent optional metadata and empty final pages remain supported.
114
+ - Reject credential FIFOs promptly instead of blocking before the regular-file check.
115
+ - Network failures retain `NETWORK_ERROR` / exit 4 and now include an optional
116
+ `error.reason` (dns, timeout, tls, connection, network) with actionable hints;
117
+ raw exception messages and credentials are never included.
118
+
119
+ ### Validation
120
+
121
+ - Reproduced failures before fixes, extended installed-package tests for Cloud
122
+ inference, malformed pagination and named-pipe credentials, and retained the
123
+ separate real HTTP and mocked transport smoke modes.
124
+
125
+ ## [0.1.0] - 2026-11-28
126
+
127
+ ### Added
128
+
129
+ - Initial read-only Jira CLI: issue URL/key/ID retrieval, JQL search, comments,
130
+ attachment metadata, projects, custom fields, transitions, whoami and doctor.
131
+ - Data Center REST v2 and Cloud REST v3 with enhanced search, query-bound cursors,
132
+ bounded pagination, JSON/NDJSON output, and a readable Markdown issue view.
133
+ - Named profiles, PAT/basic authentication from environment or restricted token
134
+ files, HTTPS checks, redirect refusal, bounded retries and redacted errors.
135
+ - TypeScript/Bun build with zero runtime dependencies, regression tests and an
136
+ npm tarball installation smoke test with HTTP and injected-transport modes.
137
+
138
+ ### Limitations
139
+
140
+ - First release does not mutate Jira or download attachment binaries. Cloud ADF
141
+ is retained in JSON; Markdown is a lossy text view. Expanded changelog and
142
+ embedded comments are not asserted to be complete.
143
+ - Tested with Data Center/Cloud fetch fixtures. Loopback HTTP listening was
144
+ denied in the implementation sandbox; the normal HTTP smoke script remains
145
+ available for a host run. The private Jira host was not reachable, so
146
+ production version, authentication and issue permissions remain unverified.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dnvyrn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,236 @@
1
- # Temporary Holding Version
1
+ # jira-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 面向人和 Coding Agent 的 Jira 只读命令行工具。TypeScript 开发,Bun 构建,
4
+ Node.js 22+ 运行,零运行时依赖。优先满足“读取 Jira 需求/缺陷并供研发使用”的场景。
5
+
6
+ 支持 Jira Server / Data Center REST v2 和 Cloud REST v3。交互终端默认显示可读文本;输出接入管道或文件时默认使用 JSON,保留原始 Jira 字段和 Cloud ADF。
7
+
8
+ ## 安装与开发
9
+
10
+ 开发、CI 和 npm 打包使用 Node.js 26(见 `.node-version`)。安装后的 CLI 支持 Node.js 22 及以上版本。
11
+
12
+ ```sh
13
+ bun install --frozen-lockfile
14
+ bun run check
15
+ bun run build
16
+ npm run test:package
17
+ # 仅在环境不允许监听 loopback 时:使用注入传输检查安装包,不能替代真实 HTTP 验证
18
+ npm run test:package -- --mock-transport
19
+ # 本地使用,无需全局安装
20
+ node bin/jira-cli.mjs --help
21
+ # 可选:安装当前目录构建的 CLI
22
+ npm install -g .
23
+ ```
24
+
25
+ 构建工具只需要开发时安装,生成的 npm 包运行时不依赖 Bun。首次发布 `@cognelis/jira-cli` 和后续标签自动发布的步骤见 [发布指南](https://github.com/cognelis/jira-cli/blob/main/CONTRIBUTING.md#github-和-npm-发布)。
26
+
27
+ ### zsh 自动补全
28
+
29
+ 在启用 zsh 补全的终端中,运行以下命令可立即启用 Tab 补全:
30
+
31
+ ```zsh
32
+ source <(jira-cli completion zsh)
33
+ ```
34
+
35
+ 若 `~/.zsh/completions` 已在 `fpath` 中,可将脚本保存到该目录,供新终端自动加载:
36
+ `jira-cli completion zsh > ~/.zsh/completions/_jira-cli`。支持命令、子命令、选项、输出格式及
37
+ `--profile` 名称。输入 `jira-cli issue ` 后按 Tab 可看到 `get`、`transitions` 和各自的中文说明。
38
+ 输入 `jira-cli comment list DEMO-101 --` 后按 Tab 可查看分页等选项的用途。
39
+ 补全只读取本地命令定义和按需读取的 profile 名称,不访问 Jira 或钥匙串。
40
+
41
+ **补全文件已安装,但按 Tab 没反应时**,先在当前 zsh 中运行一次:
42
+
43
+ ```zsh
44
+ autoload -Uz compinit && compinit
45
+ ```
46
+
47
+ 然后输入 `jira-cli ver` 并按 Tab,应补全为 `jira-cli version`。如果启动配置使用
48
+ `compinit -C`,它会沿用已有缓存,可能漏掉新安装的补全文件。一次刷新验证通过后,
49
+ 保留原有的 `~/.zshrc` 即可。若仍未生效,再运行 `print -rl -- $fpath` 检查补全目录,
50
+ 并用 `bindkey '^I'` 查看 Tab 的绑定。
51
+
52
+ ## 配置 Jira
53
+
54
+ ### macOS 首次配置
55
+
56
+ 在交互式终端运行 `jira-cli init`。依次输入 Jira 基地址(例如 `https://jira.example.com`)、
57
+ 自选的 profile 名称(例如 `work`)、用户名(Cloud 使用邮箱)和 API Token。输入 token 时隐藏回显。
58
+ CLI 通过输入站点的 `/myself` 验证 Basic 认证,通过后将 token 保存到 macOS 钥匙串,并激活该 profile。
59
+
60
+ ```sh
61
+ jira-cli --profile work doctor
62
+ ```
63
+
64
+ 已有 profile 在升级后可以直接使用。要更新 token,重新运行 `init` 并输入原站点和名称;
65
+ 要连接另一站点,请使用不同的名称。重新初始化同站点的文件凭据 profile 后,原 token 文件仍由用户管理。
66
+ 钥匙串条目与配置路径、profile、站点和账号绑定。其他操作系统可使用环境变量或受限文件。
67
+
68
+ 输入 `jira-cli profile`(等同于 `profile list`)可列出本地连接,`*` 表示默认项。
69
+ `jira-cli profile show` 显示选中的连接,`profile show NAME` 可查看指定连接。
70
+ `jira-cli profile add NAME --base-url URL` 添加连接,`jira-cli profile use NAME` 切换默认项。
71
+ 原有 `config set/use/show` 使用同一份配置。默认位置为
72
+ `~/.config/jira-cli/config.json`,可用 `--config FILE` 或 `JIRA_CONFIG` 指定。
73
+ 密码管理器可以向进程注入 `JIRA_TOKEN`。已有专属凭据文件时也可指定
74
+ `--token-file /absolute/path`,文件须归自己所有、权限为 0600,且不能是符号链接。
75
+ 配置文件只保存连接参数以及钥匙串引用或凭据文件路径。`auth status` 显示本地凭据来源,`doctor` 通过 `/myself` 的账号标识验证身份。
76
+ HTTP 401 的错误提示包含本次请求的认证模式。
77
+ 支持原生 PAT 的其他 Jira Server / Data Center 实例可使用 `--auth bearer`。
78
+ [Atlassian PAT 版本说明](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html)
79
+
80
+ ## Cloud
81
+
82
+ Cloud 使用账号邮箱和 API token:
83
+
84
+ `config set` 与环境变量连接使用相同的识别规则:`*.atlassian.net` 和
85
+ `api.atlassian.com` 默认选择 Cloud / Basic,其余地址默认 Data Center / Bearer。
86
+ 自定义域名用 `--flavor` 显式指定。旧配置保持原样;如旧版误选了类型,请检查后
87
+ 用 `config set NAME ... --flavor cloud --overwrite` 更正该配置。
88
+
89
+ ```sh
90
+ jira-cli config set cloud --base-url https://example.atlassian.net \
91
+ --flavor cloud --auth basic --username me@example.com
92
+ jira-cli --profile cloud whoami
93
+ ```
94
+
95
+ 带 scopes 的 Cloud API token 按 Atlassian 文档使用 gateway URL,并配置网页地址用于
96
+ 校验 `/browse/KEY` 链接。`CLOUD_ID` 是你的真实 Cloud ID:
97
+
98
+ ```sh
99
+ jira-cli config set cloud-scoped \
100
+ --base-url https://api.atlassian.com/ex/jira/CLOUD_ID \
101
+ --site-url https://example.atlassian.net \
102
+ --flavor cloud --auth basic --username me@example.com
103
+ ```
104
+
105
+ OAuth 交互登录、自动发现 Cloud ID 和写操作不在本版范围内。
106
+
107
+ ## 命令
108
+
109
+ | 命令 | 用途 |
110
+ | --- | --- |
111
+ | `issue get KEY\|ID\|URL` | 任务详情、描述、附件元信息、关联任务和子任务等 |
112
+ | `search 'JQL'` | JQL 查询;DC `/search`,Cloud `/search/jql` |
113
+ | `comment list KEY --all` | 读取独立评论接口的所有可见分页 |
114
+ | `attachment list KEY` | 附件元数据,不下载二进制文件 |
115
+ | `issue transitions KEY` | 列出允许的状态迁移,不执行迁移 |
116
+ | `project list` / `project get KEY` | 读取项目 |
117
+ | `field list` | 发现 `customfield_NNN` 字段 ID |
118
+ | `whoami` / `doctor` | 验证账号与连接 |
119
+ | `init` | 在 macOS 验证 Jira 登录并保存、激活自选名称的钥匙串 profile |
120
+ | `config set/use/show` | 管理本地命名配置 |
121
+ | `profile [list]` / `profile show [NAME]` / `profile add` / `profile use` | 列出、查看、添加和切换本地连接 |
122
+ | `auth status` | 查看凭据来源,不显示 secret,不发请求 |
123
+
124
+ ```sh
125
+ jira-cli search 'project = DEMO AND assignee = currentUser() ORDER BY updated DESC'
126
+ jira-cli search 'project = DEMO ORDER BY key ASC' --all --limit 50
127
+ jira-cli comment list DEMO-101 --all
128
+ jira-cli issue get DEMO-101 --fields summary,description,customfield_10001
129
+ jira-cli issue get DEMO-101 --fields '*all' --expand names
130
+ jira-cli issue get DEMO-101 --format markdown --out task.md
131
+ ```
132
+
133
+ `issue get` 的默认字段包括 summary、description、status、assignee、reporter、priority、
134
+ issuetype、project、created、updated、labels、components、attachment、issuelinks、subtasks、
135
+ duedate、comment。自定义字段按需选择或使用 `--fields '*all'`。
136
+ 默认详情里的评论可能被截断,CLI 会提示使用 `comment list --all`。
137
+ `--expand changelog` 也可能不完整,本版不承诺完整变更历史。
138
+
139
+ ## 分页与输出约定
140
+
141
+ 交互终端默认显示任务阅读视图、列表摘要或连接信息。`--format text` 可显式选择文本;
142
+ `--format json` 可在终端查看完整响应。管道、重定向及 `--out` 默认保持 JSON。
143
+ 任务详情和评论列表以相同的格式显示评论 ID、作者、带时区的时间和正文。文本视图会展开 Jira 的
144
+ `[标题|网址]` 链接;导出 Markdown 仍可使用 `issue get <KEY> --format markdown`。
145
+ 彩色终端用暖色标记任务编号和评论起点,加粗标题和作者。可用
146
+ `NO_COLOR=1 jira-cli issue get DEMO-101` 查看单色排版。文本导出不含 ANSI 样式码。
147
+ 搜索结果沿用任务标题样式,在下一行列出返回的状态、负责人和优先级。
148
+ `jira-cli doctor` 分组显示服务端连接信息与登录验证结果。
149
+
150
+ 单次列表默认读一页,`--limit` 是每页请求条数(1–100),不是总条数上限。
151
+ `--all` 持续读取,默认最多 100 页,可设置 `--max-pages 1..1000`。
152
+ 达到页数限制会报错,**不把部分结果伪装为完整结果**,也不输出部分业务数据。
153
+ 多页数据暂存在内存,较大查询应逐页消费。查询期间 Jira 内容变化可能造成分页漂移;
154
+ CLI 不提供快照一致性,也不会按 key 去重掩盖变化。
155
+
156
+ ```json
157
+ {
158
+ "schemaVersion": 1,
159
+ "ok": true,
160
+ "command": "search",
161
+ "data": { "items": [], "hasMore": false, "nextCursor": null }
162
+ }
163
+ ```
164
+
165
+ `hasMore=true` 时,将完整 `nextCursor` 作为 `--cursor` 传回,保持相同命令、服务器、
166
+ JQL 和字段选择。游标与这些参数绑定;不要传 Jira 原始的 offset/token。
167
+ Data Center 项目列表接口本身不分页,返回全部可见项目,分页大小对此接口不适用。
168
+
169
+ `--format ndjson` 仅用于列表;stdout 每行一条记录,分页提示在 stderr 的
170
+ `_notice.pagination`。它仍会在整个本次操作成功后输出,并非边取边流式输出。
171
+ `--format markdown` 仅用于 `issue get`;ADF 格式、图片和复杂节点可能丢失,JSON 保留原始字段。
172
+ `--out` 原子替换目标文件,成功后 stdout 返回保存信息;API 失败不覆盖已有文件。
173
+
174
+ 文本模式在 stderr 显示错误码和处理提示;JSON 模式的失败只在 stderr 输出 `{schemaVersion:1,ok:false,error:{code,message,hint?,status?,reason?}}`。
175
+ 退出码:0 成功,2 参数/配置/本地文件错误,3 认证或权限错误,4 网络错误,5 服务端/协议/分页错误。
176
+ 网络失败保留 `code=NETWORK_ERROR` 和退出码 4,另用 `reason` 区分 `dns`、`timeout`、
177
+ `tls`、`connection` 或无法分类的 `network`。只依据已知异常代码分类,不输出原始异常内容。
178
+
179
+ ## 环境变量与安全边界
180
+
181
+ | 变量 | 含义 |
182
+ | --- | --- |
183
+ | `JIRA_CONFIG` | 配置文件,默认 `~/.config/jira-cli/config.json` |
184
+ | `JIRA_PROFILE` | 命名配置,CLI `--profile` 优先 |
185
+ | `JIRA_BASE_URL` | 基地址,可含 `/jira` 或 Cloud gateway 路径 |
186
+ | `JIRA_FLAVOR` | `datacenter` / `cloud` |
187
+ | `JIRA_AUTH` | `bearer` / `basic` / `none`(显式匿名) |
188
+ | `JIRA_USERNAME` | Basic 用户名,Cloud 是邮箱 |
189
+ | `JIRA_TOKEN` | 当前进程凭据,优先于 token 文件 |
190
+ | `JIRA_TOKEN_FILE` | token 文件绝对路径 |
191
+ | `JIRA_TIMEOUT` | 每次请求超时秒数,默认 30 |
192
+
193
+ 连接设置优先级:命令参数 > 环境变量 > 命名配置 > 默认值。
194
+ 当前 profile 的基地址不能被改成另一个地址,需建立新 profile,防止凭据被误发。
195
+ 非 Atlassian 域名默认按 Data Center,Cloud 自定义域名应显式指定 flavor。
196
+ 拒绝非 loopback HTTP、带凭据的 URL、跨站 issue URL,拒绝跟随所有 HTTP 重定向。
197
+ 错误信息移除当前 token 和 Basic 编码;请求日志不打印 Authorization。
198
+
199
+ 429/502/503/504 最多重试 2 次,可用 `--retries 0..3` 调整。仅自动等待不超过 10 秒的
200
+ Retry-After,长等待返回错误供调用方处理。单响应上限 10 MiB,可减少字段/分页大小。
201
+ 采用 Node 原生 fetch;企业 CA 可通过 `NODE_EXTRA_CA_CERTS` 提供。环境代理是否生效
202
+ 取决于 Node 版本及启动配置,本版不自行读取浏览器代理或保证代理路由。
203
+
204
+ ## 设计与验证
205
+
206
+ - [API 调研及选型](docs/api-research.md)
207
+ - [贡献与发布约定](CONTRIBUTING.md)
208
+ - [变更记录](CHANGELOG.md)
209
+ - [首轮迭代验证](docs/iteration-1.md)
210
+
211
+ 已在真实 Jira 完成六项只读检查。回环 HTTP 和模拟 fetch 的安装测试也分别通过。[本轮实测记录](docs/iteration-2.md)
212
+
213
+ ### 在可连通 Jira 的环境实测
214
+
215
+ 以下命令使用示例站点、profile 和任务号。请替换为自己的连接和可见任务,在源码仓库构建后运行:
216
+
217
+ ```sh
218
+ npm run test:live -- --issue https://jira.example.com/browse/DEMO-101 --profile work
219
+ ```
220
+
221
+ 上面的命令运行六项基础检查。要复测逐页读取和非空附件样本,使用同一个 profile 加上 `--extended`:
222
+
223
+ ```sh
224
+ npm run test:live -- --profile work --issue DEMO-101 --extended
225
+ ```
226
+
227
+ 扩展模式先运行六项基础检查,再执行以下两项。输出 JSON 的 `commentCount` 和 `attachmentCount` 仍指主任务。
228
+
229
+ - `commentPagination` 适用于有 2–5 条可见评论的主任务。每页取 1 条,跟随游标直到末页,核对评论 ID 的唯一性,并与基础列表及 `--all --limit 1` 的顺序逐条对照。摘要包含每页条数和不同评论数。
230
+ - `attachmentSample` 优先在同项目查找另一条带附件的任务,必要时扩大到该账号可见的任务。每次搜索最多取 5 个候选,跳过重复、已不可读或附件为空的任务。检查附件 ID、文件名、MIME 类型、字节数和 HTTP(S) 内容链接,仅记录样本任务 key、附件数和已验证字段名。找不到合适样本时返回失败。
231
+
232
+ 基础检查包括 doctor、任务读取、精确 key 搜索、评论列表、附件信息和 Markdown。
233
+ 实测报告在交互终端显示逐项结果、耗时和集合计数。管道默认输出 JSON;可给实测命令传入 `--format json` 或 `--format text`。报告不包含任务正文或凭据。
234
+ 精确搜索必须只返回详情对应的任务 key。命令失败或内容校验失败时,会标记具体步骤并以非零状态退出;不因模拟测试通过而跳过真实验证。
235
+ 为了限制真实服务调用,每请求超时 10 秒、不自动重试,评论最多读取 5 页;超过页数限制
236
+ 会明确失败,可另用 `comment list --all --max-pages N` 按需检查该任务。
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../dist/cli.js';
3
+ process.stdout.on('error', (error) => {
4
+ if (error.code === 'EPIPE') process.exit(0);
5
+ throw error;
6
+ });
7
+ process.exitCode = await run(process.argv.slice(2));