Split server CLI into focused submodules#2545
Conversation
- Extract auth, config, project, and server CLI commands - Keep `cli.ts` as the top-level command wiring entrypoint
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Pure mechanical reorganization splitting a monolithic CLI file into focused submodules. Code is moved verbatim without logic changes, and the added You can customize Macroscope's approvability policy. Learn more. |
- Split the main `t3` command setup into `apps/server/src/bin.ts` - Update tests and config imports to reference the new module
Dismissing prior approval to re-evaluate a5cb5f8
- Rename the CLI config test to `apps/server/src/cli/config.test.ts` - Update imports to match the new test location
Brings in: server CLI submodule split (pingdotgg#2545), process/trace diagnostics views (pingdotgg#2532), JetBrains editor support (pingdotgg#2475), MessagesTimeline render optimizations (pingdotgg#2527, pingdotgg#2498), git/terminal test stabilization (pingdotgg#2540), keybindings settings editor (pingdotgg#2533), and provider update advisories (pingdotgg#2312). Conflict resolutions: - packages/contracts/src/settings.ts: kept aa's diffFontFamily and terminalFontFamily alongside upstream's dismissedProviderUpdateNotificationKeys. - apps/desktop/src/clientPersistence.test.ts: same shape, fixture mirrors the schema. - apps/web/src/components/settings/SettingsPanels.tsx: kept both import groups (FontPicker from aa, ProviderUpdateLaunchNotification.logic from upstream). - apps/web/src/localApi.test.ts: extended both fixtures with diffFontFamily and terminalFontFamily so the merged ClientSettings shape typechecks against the strict desktop bridge contract. Pre-existing aa typecheck issues fixed at the root so the merge commit is green: - apps/desktop/src/electron.d.ts: declaration-merge "local-fonts" into Electron's Session.setPermissionRequestHandler permission union (the Electron 40 typings omit it even though the runtime supports it). - apps/web/src/components/DiffPanel.tsx: conditionally spread style on Virtualizer instead of passing undefined, satisfying exactOptionalPropertyTypes.
Summary
apps/server/src/cli.tsimplementation into focused submodules for config resolution, auth commands, project commands, and server commands.Testing
bun fmt)bun lint)bun typecheck)Note
Medium Risk
Mostly a structural refactor, but it changes the CLI entrypoint wiring and adds an
import.meta.mainguard, so packaging/import behavior and command routing could regress if any flags/subcommands were mis-composed.Overview
Refactors the server CLI by deleting the monolithic
cli.tsand splitting it into focused modules:cli/config.ts(flag/env/bootstrap config resolution + duration parsing),cli/server.ts(start/serve/run),cli/auth.ts(pairing/session management), andcli/project.ts(project add/rename/remove with live-server fallback).Updates
bin.tsto compose the top-levelclifrom these subcommands/flags and only executeCommand.runwhenbin.tsis the main module (import.meta.main), and adjusts tests to importclifrombin.tsand cover auth/project command behavior plus config resolution via the new modules.Reviewed by Cursor Bugbot for commit 798a769. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Split server CLI monolith into focused submodules under
cli/Breaks the monolithic cli.ts into focused modules: config.ts for flag schemas and config resolution, auth.ts for auth subcommands, server.ts for server start logic, and project.ts for project management subcommands. The bin.ts entrypoint assembles the root command from these submodules. Behavioral Change: importing
bin.tsno longer executes the CLI — execution only occurs when the module is the program entrypoint (import.meta.main).Macroscope summarized 798a769.