Refactor CLI - #1174
Merged
Merged
Refactor CLI#1174
Conversation
Adding a command is now one folder plus a registry line, without changing flags, help, or telemetry.
Create, deploy, and generate keep the files only they use; shared auth moves to lib/auth.
Create is now an orchestrator over resolve, env, install, and messages. Checkout, copy, and rewrite live in lib/scaffold for a future init.
Keep PostHog event names and property keys, but stop command code from calling capture() with raw strings. Errors move out of the store; wrapCommand goes away now that context is a singleton passed from command.ts.
Importing the worker from run.ts executed its main() on every CLI process and treated the command name as an entry file.
Short names like cloud, eve, and ai-sdk no longer map. Unknown values use the existing catalog error strings. --auth manual is unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
abhithesys
previously approved these changes
Sep 18, 2026
AbhinRustagi
enabled auto-merge (squash)
September 18, 2026 09:59
abhithesys
approved these changes
Sep 18, 2026
This branch was successfully deployed
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.
What
Restructure
@openuidev/cliso a new command is a folder + one registry line. Same four commands, still Commander.Placement: one command owns it → that command’s folder. Two or more owners (or a later command will) →
src/lib/.Context: one
CliContext(cwd,argv,telemetry,verbose) is set on the program, then passed top-down into everyrun*function. Commands read process state fromctxinstead of reaching for globals.Telemetry: one
Telemetryclass owns the PostHog session (init/capture/shutdown). Each command extends it with typed methods (CreateTelemetryClient.trackStarted(...), etc.) so event names and payloads live on the subclass, not as stringly-typedcapture("cli_…")at call sites.new CreateTelemetryClient(ctx.telemetry)shares the same session.Breaking
Removed
normalizeTemplate/normalizeBackendFramework.--templateand--backend-frameworkmatch catalog keys only — short names no longer resolve.--templatecloud,self-hostedopenui-cloud,openui-self-hosted--backend-frameworkeve,none,vercel,ai-sdk,lang-graphdefault,langgraph,vercel-ai-sdk,vercel-eve--auth manualis unchanged.Other
--verboseis global (openui --verbose createandopenui create --verbose).--no-interactivestays per-command.Test Plan
pnpm --filter @openuidev/cli run ci--helpfor root + each command--verbosebefore and after the subcommandcreate --template clouderrors with the catalog key listChecklist