Skip to content

feat(profile): default profile list to table format#43

Open
guantoubaozi wants to merge 1 commit into
clickzetta:mainfrom
guantoubaozi:feat/profile-list-default-table
Open

feat(profile): default profile list to table format#43
guantoubaozi wants to merge 1 commit into
clickzetta:mainfrom
guantoubaozi:feat/profile-list-default-table

Conversation

@guantoubaozi

Copy link
Copy Markdown

Summary

  • cz-cli profile list 之前默认输出原始 JSON,交互式使用时可读性差。
  • 当用户未显式传入 --format 时,profile list 现在默认使用 table 格式,便于人工阅读。
  • 显式指定 --format(json/pretty/csv 等)以及脚本化/编程 execute() 调用行为不变。

实现上复用了 CLI 已有的隐藏标志 argv.format_explicit(记录用户是否显式传了 --format),仅在未显式指定时回退到 table,因此不影响管道/脚本消费者。

Changes

  • packages/cz-cli/src/commands/profile.tsprofile list handler 在未显式指定格式时默认 table(一行改动)。
  • openspec/specs/profile-management/spec.md:新增场景「未显式指定格式时默认表格展示」。
  • packages/cz-cli/test/profile-list-default-format.test.ts:新增测试,通过真实 CLI 入口验证「默认 table」与「显式 --format json」两种行为。
  • packages/cz-cli/test/e2e-command-surface.ts:LOCAL_COMMANDS 用例的 profile list 断言显式带上 --format json,保持意图稳定。

Test plan

  • bun test test/profile-list-default-format.test.ts — 2 pass
  • 相关单元测试(profile-store / output / formatter / execute 等)— 32 pass
  • bun test/e2e-command-surface.ts — 8 pass
  • bun test/e2e.ts — profile list / 各输出格式全绿
  • pre-push typecheck 通过

🤖 Generated with Claude Code

profile list previously defaulted to raw JSON, which is hard to read
interactively. When --format is not explicitly provided, default to the
table format for human readability. Explicit --format (json/pretty/etc.)
and scripted/programmatic execute() callers are unaffected.

Co-Authored-By: cz-cli <noreply@clickzetta.com>
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.

1 participant