Skip to content

fix(import): restore --json for cache status and GC - #580

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
Yong-yuan-X:fix/cache-json-cli-option
Sep 16, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
Yong-yuan-X:fix/cache-json-cli-option

Conversation

@Yong-yuan-X

@Yong-yuan-X Yong-yuan-X commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

修复 PR #71 迁移缓存命令后遗漏的 --json 选项注册,使 teamai import --cache-status --json 和 --cache-gc --json
可以正常使用已有的 JSON 输出能力。

本次修改不改变缓存状态查询或垃圾回收的实现。

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npx tsc --noEmit passes
  • npm run build passes
  • npx vitest run src/__tests__/index-import-help.test.ts src/__tests__/cache-cmd.test.ts passes(7 个测试)
  • Added/updated tests for the change
  • node dist/index.js import --help 显示 --json
  • node dist/index.js import --cache-status --json 输出可解析的 JSON
  • node dist/index.js --dry-run import --cache-gc --json 输出可解析的 JSON

Related Issues

N/A

Notes for Reviewers

PR #71 将原来的顶层缓存命令:

teamai cache --status
teamai cache --gc

迁移为:

teamai import --cache-status
teamai import --cache-gc

原命令支持 --json。迁移后,代码仍将 cmdOpts.json 传递给 cacheCmd,但 import 命令没有重新注册该选项,导致 CLI 报错:

error: unknown option '--json'

本 PR 仅补回缺失的 Commander 选项注册,并增加 CLI 帮助信息回归测试。

@jeff-r2026
jeff-r2026 merged commit 4bc8542 into Tencent:main Sep 16, 2026
7 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants