Skip to content

Improve CLI help and human output UX#117

Merged
robzolkos merged 10 commits intomasterfrom
ux/cli-help-output-polish
Apr 2, 2026
Merged

Improve CLI help and human output UX#117
robzolkos merged 10 commits intomasterfrom
ux/cli-help-output-polish

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 2, 2026

Summary

This improves Fizzy’s interactive CLI experience so it feels more like a polished end-user tool instead of an API wrapper. The main goal is to make the default human experience easier to learn, easier to navigate, and more consistent, especially when compared with CLIs like gh.

What changed

  • Reworked root help to be more guided and discoverable
    • grouped command sections
    • common workflows
    • examples
    • clearer learn-more guidance
  • Improved subcommand help output
    • clearer usage lines
    • aliases shown when available
    • examples for common commands
    • related command suggestions
    • cleaner grouping of global flags
  • Improved human-facing output rendering
    • more consistent styled and markdown output
    • better rendering of structured success and mutation responses
    • next-step guidance rendered from breadcrumbs in human output
  • Improved human-facing error presentation
    • usage and typo errors now read naturally in interactive contexts
    • machine-readable output remains available for JSON/quiet modes
  • Added lightweight aliases for common command patterns
    • listls
    • showview
    • deleterm

Notes

  • These changes focus on interactive UX and help/discoverability.
  • Machine-oriented output modes remain intact.
  • No config or auth behavior changes are included in this PR.

Summary by cubic

Polished Fizzy’s interactive CLI help and human output for a guided, friendlier experience. Adds grouped help, smarter human printers (tables, summaries with data, next steps/location), clearer command‑specific error hints, and safer signup output in human modes.

  • New Features

    • Help: Root --help groups commands (Core/Collaboration/Admin/Utilities), shows USAGE/ALIASES/SEE ALSO with colored EXAMPLES, splits “GLOBAL OUTPUT FLAGS” vs “GLOBAL CONFIG FLAGS”, and lists root‑local flags like --version. Subcommands get clearer usage, aliases (listls, showview, deleterm), examples, and see‑also. fizzy commands renders a styled catalog in human modes; use --json for a structured catalog.
    • Human output: Unified styled/markdown printers; mutation summaries include data when present; auto‑infers columns and humanizes headers; appends “Next steps” and “Location”. auth list renders a table with Profile/Active/Board/Base URL. version prints fizzy version <x> in human modes.
    • Errors: Friendlier human‑mode errors with concise messages, “Hint:” guidance, and a command‑specific usage nudge (e.g., “Run fizzy <cmd> --help for usage.”).
    • Signup: Redacts pending/session/access tokens in human modes and shows only safe fields per step (e.g., code, requires_signup_completion, account). JSON/quiet/agent modes keep full data.
  • Refactors

    • Centralized help rendering via configureCLIUX and custom human help; --agent help still supported.
    • Standardized printers (printList, printDetail, printMutation*) across commands; removed deprecated title‑casing for field names.

Written for commit 799540b. Summary will update on new commits.

Copilot AI review requested due to automatic review settings April 2, 2026 16:01
@github-actions github-actions bot added enhancement New feature or request breaking labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

⚠️ Potential breaking changes detected:

  • The error-handling behavior was changed to print a human-readable error message in styled output formats. This may alter how error messages are parsed in scripts expecting unformatted JSON output.
  • Output from certain commands using JSON format has been altered to exclude some fields (e.g., secret tokens), which may break scripts relying on the previous JSON structure.
  • The --json flag is required to output a structured command catalog for the fizzy commands command, where earlier JSON output may have been the default. This change could affect scripts relying on implicit behavior.
  • The removal of the installAgentHelp function impact could potentially affect help output routing for commands.

Review carefully before merging. Consider a major version bump.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Fizzy's interactive CLI experience to feel more like a polished end-user tool. It reworks help output with guided sections and examples, improves human-facing output rendering with styled and markdown support, adds command aliases for common patterns, and enhances error presentation for interactive contexts.

Changes:

  • New help system with command grouping, common workflows, examples, and aliases
  • Improved output rendering with StyledSummary and MarkdownSummary enhancements that include structured data
  • Refactored output functions (printMutation, printDetail) for consistent format handling
  • Added breadcrumb navigation ("Next steps") for human output
  • Added lightweight aliases (list→ls, show→view, delete→rm)

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/render/render.go Modified StyledSummary to include structured data below mutation summaries
internal/render/markdown.go Modified MarkdownSummary to include structured data below mutation summaries
internal/render/render_test.go Added test for StyledSummary with data inclusion
internal/render/markdown_test.go Added test for MarkdownSummary with data inclusion
internal/commands/help.go New file with comprehensive CLI help system implementation
internal/commands/help_test.go New tests for help rendering
internal/commands/root.go Major refactoring: added output formatting functions, error handling, human output helpers, and column inference
internal/commands/version.go Updated to handle styled/markdown format output
internal/commands/auth.go Changed to use printList with authProfileColumns
internal/commands/columns.go Added authProfileColumns definition
internal/commands/column.go Changed to use printDetail instead of printSuccess
internal/commands/skill.go Changed to use printMutation for consistent output
internal/commands/signup.go Changed to use printMutation and printDetail for consistent output
internal/commands/setup_agents.go Changed to use printMutation and removed unused import
internal/commands/auth_test.go Added comprehensive test for styled output with next steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 16:13
@github-actions github-actions bot removed the breaking label Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

internal/render/render.go:169

  • StyledSummary will panic if data is nil because len() is called without a nil check. When toMap() returns nil (which it can when data cannot be converted to a map), calling len(data) on line 160 and 165 will panic. Add a nil check before calling len().
func StyledSummary(data map[string]any, summary string) string {
	if summary != "" {
		line := lipgloss.NewStyle().Bold(true).Render("✓ " + summary)
		if len(data) == 0 {
			return line + "\n"
		}
		return line + "\n\n" + StyledDetail(data, "")
	}
	if len(data) == 0 {
		return lipgloss.NewStyle().Bold(true).Render("✓ Done") + "\n"
	}
	return StyledDetail(data, "")
}

internal/render/markdown.go:84

  • MarkdownSummary will panic if data is nil because len() is called without a nil check. When toMap() returns nil (which it can when data cannot be converted to a map), calling len(data) on line 75 and 80 will panic. Add a nil check before calling len().
func MarkdownSummary(data map[string]any, summary string) string {
	if summary != "" {
		if len(data) == 0 {
			return fmt.Sprintf("> %s\n", summary)
		}
		return fmt.Sprintf("> %s\n\n%s", summary, MarkdownDetail(data, ""))
	}
	if len(data) == 0 {
		return "> Done\n"
	}
	return MarkdownDetail(data, "")
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 16:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot removed the breaking label Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 19:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robzolkos
Copy link
Copy Markdown
Collaborator Author

Followed up on the suppressed nil-map note: no code change needed there because is safe in Go, so the current summary helpers already handle nil maps correctly.

@robzolkos
Copy link
Copy Markdown
Collaborator Author

Follow-up correction: no code change needed for the nil-map note because calling len on a nil map is safe in Go, so the current summary helpers already handle nil maps correctly.

- show root-local flags like --version in custom root help
- use ExecuteC() so human usage errors know which command failed
- suggest <failed command> --help instead of always fizzy --help
- add regression tests for root help and usage hint behavior
- regenerate SURFACE.txt for Cobra default version flag
Copilot AI review requested due to automatic review settings April 2, 2026 20:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robzolkos robzolkos merged commit b18ab35 into master Apr 2, 2026
24 checks passed
@robzolkos robzolkos deleted the ux/cli-help-output-polish branch April 2, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants