跳转到内容

cnb-rs npc commits ​

cnb-rs npc commits [options]

查看仓库中由 NPC 触发的 push 记录。

选项 ​

  • --npc <NAME>: 按 NPC 角色名过滤
  • --npc-slug <SLUG>: 按 NPC 仓库路径过滤
  • --since <T>: 起始日期,格式为 YYYY-MM-DD
  • --until <T>: 结束日期,格式为 YYYY-MM-DD
  • --page <N>: 分页页码(默认:1)
  • --limit <N>: 每页数量(默认:20,最大:100)

--since 会转换为当天 00:00:00Z,--until 会转换为当天 23:59:59Z,再以 ISO8601 传给 API。服务端默认查询最近 7 天,时间跨度最大 90 天。

继承的全局选项:

  • --repo <REPO>: 指定仓库路径(格式:group/repo)
  • --json: 原样输出分页结果,包含 items、page、page_size 和 total
  • --domain <DOMAIN>: 指定目标域名(默认:cnb.cool)

输出列 ​

列含义
TIMEpush 记录时间
NPCNPC 角色名,缺失时显示 NPC 仓库路径
REFpush 的 Git ref
SHApush 后 commit 的 7 位 short SHA
COMMITS本次 push 的 commit 数量
PIPELINE上游 NPC 流水线 SN

JSON 的 items 字段保留 NpcCommitRow 的全部字段:before_sha、commits_count、create_time、npc_avatar、npc_name、npc_sha、npc_slug、pipeline_id、ref、sha、slug、sn、visibility。

示例 ​

bash
# 查看最近的 NPC push
$ cnb-rs npc commits --repo group/repo

# 按 NPC 和日期范围过滤
$ cnb-rs npc commits --npc reviewer --since 2026-09-01 --until 2026-09-15 --repo group/repo

# 输出完整分页 JSON
$ cnb-rs npc commits --json --repo group/repo

另请参阅 ​

Released under the MIT License.