feat(devframe): expose createDevServer as a programmatic CLI building block#304
Merged
feat(devframe): expose createDevServer as a programmatic CLI building block#304
Conversation
… block Extract the dev-server logic out of `createCli` into a peer factory at `devframe/adapters/dev` so authors can drive it from their own CLI framework (commander, yargs, oclif). `createCli` becomes a thin cac wrapper that orchestrates `createDevServer`, `createBuild`, and `createMcpServer`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
commit: |
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.
Description
Extracts the dev-server logic out of
createCliinto a peer factory atdevframe/adapters/dev(createDevServer+resolveDevServerPort), so authors can drive it from their own CLI framework — commander, yargs, oclif, or any custom shell — instead of inheriting the cac-flavored `dev`/`build`/`mcp` triplet baked into `createCli`. `createBuild` and `createMcpServer` already shipped as standalone factories; this fills in the missing dev-server piece, and refactors `createCli` to be a thin cac wrapper that orchestrates all three.`createDevServer` returns the underlying `StartedServer` handle (`origin`, `port`, `app`, `wss`, `rpcGroup`, `close()`) so callers can wire SIGINT / hot-reload teardown into their own process lifecycle. Existing `createCli` callers see no behavior or signature change. `defineCliFlags` / `parseCliFlags` / `CliFlagsSchema` / `InferCliFlags` are re-exported from `devframe/adapters/cli` (no longer at the top-level `devframe` entry).
Includes the new `adapters/dev` docs section, a "Use your own CLI framework" guide with a commander example, refreshed tsnapi snapshots, a smoke test for the start → `.connection.json` → close round-trip, and an updated SKILL.md.
Linked Issues
Additional context
Public API is purely additive — the only breaking surface is moving `defineCliFlags` / `parseCliFlags` from `devframe` to `devframe/adapters/cli`.
🤖 Generated with Claude Code