Skip to content

chore(x): improve developer CLI with help, structure, and test filters#32665

Merged
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:improve/x-cli-help
Mar 12, 2026
Merged

chore(x): improve developer CLI with help, structure, and test filters#32665
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:improve/x-cli-help

Conversation

@bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Mar 12, 2026

Summary

  • Add per-command --help/-h with thorough descriptions (useful for LLMs and AI agents)
  • Extract CLI logic from ./x into tools/x/main.ts for maintainability
  • Replace manual ANSI escapes with @std/fmt/colors
  • Merge duplicate command/registry structures into a single buildCommands()
  • Test commands (test-unit, test-node, test-compat, test-spec) now require a filter argument and support --list to discover available tests

bartlomieju and others added 3 commits March 12, 2026 16:00
Add thorough help text to each `./x` subcommand so that running
`./x <command> --help` prints a detailed explanation of what the
command does, when to use it, and what it runs under the hood.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all command definitions, help rendering, and CLI dispatch from
the top-level `./x` script into `tools/x/main.ts`. The entrypoint
is now a thin wrapper that passes `import.meta.dirname` to `main()`.

Also consolidate the two-object pattern (separate functions + registry)
into a single `buildCommands()` function, and replace manual ANSI
escape codes with `@std/fmt/colors`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test commands (test-unit, test-node, test-compat, test-spec) now require
a filter argument to select which tests to run, and support --list to
print all available tests. This makes the commands more explicit and
discoverable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Member

@dsherret dsherret Mar 12, 2026

Choose a reason for hiding this comment

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

Maybe it would be good to name this file tools/x.ts and just have it run the main? The ./x file is not very good for windows and this might be a good backup. Also instructing AI agents to use tools/x.ts would be better so they don't try ./x on Windows.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 9eed28a into denoland:main Mar 12, 2026
214 of 216 checks passed
@bartlomieju bartlomieju deleted the improve/x-cli-help branch March 12, 2026 16:17
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