feat(profile): default profile list to table format#43
Open
guantoubaozi wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ts:profile listhandler 在未显式指定格式时默认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 passbun test/e2e-command-surface.ts— 8 passbun test/e2e.ts— profile list / 各输出格式全绿🤖 Generated with Claude Code