Skip to content

feat(cli): add version/list commands, shared tree renderer, async install#117

Merged
antosubash merged 2 commits intomainfrom
claude/improve-cli-FzuK8
Apr 23, 2026
Merged

feat(cli): add version/list commands, shared tree renderer, async install#117
antosubash merged 2 commits intomainfrom
claude/improve-cli-FzuK8

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

Targeted CLI improvements focused on discoverability, DRY, and correctness.

New commands

  • sm version (and sm --version) — prints the CLI version, backed by AssemblyInformationalVersion.
  • sm list — lists modules in the current project with their route prefixes and endpoint counts. Resolves RoutePrefix from both string literals (RoutePrefix = "products") and constant references (RoutePrefix = OrdersConstants.RoutePrefix).

Refactors

  • Extract FileTreeRenderer in Infrastructure/. Replaces three near-identical tree renderers in NewProjectCommand, NewModuleCommand, NewFeatureCommand (~80 lines of duplication). Supports both relative-path mode (new project) and filename-only mode (new module / new feature), plus dry-run and created variants.

Fixes

  • InstallCommand now inherits AsyncCommand and uses WaitForExitAsync + await instead of blocking with GetAwaiter().GetResult() on the process-output tasks.

UX

  • Root sm --help now includes concrete examples (sm new project MyApp, sm dev, sm list, sm doctor --fix, etc.).
  • new project/module/feature commands get targeted --help examples via WithExample.

Test plan

  • dotnet build — full solution, 0 warnings / 0 errors
  • CLI tests: 127 passed, 0 failed (added VersionCommandTests, ListCommandTests, FileTreeRendererTests)
  • Manual smoke — sm --version prints 1.0.0, sm --help shows examples
  • Manual smoke — sm list on a simulated project renders a rounded table with route prefixes and endpoint counts for both literal and constant-reference prefixes
  • Manual smoke — sm new project Acme --dry-run renders the expected tree via the shared renderer

Generated by Claude Code

…tall

- Add `sm version` command and `--version` flag backed by AssemblyInformationalVersion
- Add `sm list` command showing modules with route prefixes and endpoint counts,
  resolving RoutePrefix from string literals and from {Module}Constants.RoutePrefix
- Extract shared FileTreeRenderer helper to replace three near-identical tree
  renderers in NewProject/NewModule/NewFeature (~80 lines of duplication removed)
- Convert InstallCommand to AsyncCommand and use WaitForExitAsync instead of
  blocking GetAwaiter().GetResult()
- Wire root-level usage examples into Spectre's --help output
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 49afb71
Status: ✅  Deploy successful!
Preview URL: https://308bd35a.simplemodule-website.pages.dev
Branch Preview URL: https://claude-improve-cli-fzuk8.simplemodule-website.pages.dev

View logs

…esults

- Sort results by severity: FAIL → WARN → PASS so failures are immediately visible
- Replace flat trailing markup lines with a bordered summary Panel whose color
  matches overall status (red/yellow/green) and whose header reads "Failing",
  "Passing with warnings", or "Healthy"
- Track fixed count across the fix → recheck transition and display it in the
  summary so users can see --fix actually did something
- Add top-level Rule separator to frame the report
- Round the results table border for consistency with `sm list`
@antosubash antosubash marked this pull request as ready for review April 23, 2026 07:34
@antosubash antosubash merged commit 910b9b7 into main Apr 23, 2026
5 checks passed
@antosubash antosubash deleted the claude/improve-cli-FzuK8 branch April 23, 2026 07:34
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