feat(cli): select a backend framework at scaffold time - #964
Open
AbhinRustagi wants to merge 11 commits into
Open
feat(cli): select a backend framework at scaffold time#964AbhinRustagi wants to merge 11 commits into
AbhinRustagi wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 13, 2026 11:52
cbc3eb0 to
c0368f8
Compare
3 tasks
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 13, 2026 11:57
c0368f8 to
d4b5e4d
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 13, 2026 12:21
d4b5e4d to
b86c11d
Compare
2 tasks
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 14, 2026 06:17
b86c11d to
f8cfcec
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 14, 2026 10:25
09a3a42 to
a1f41f5
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 14, 2026 11:17
a1f41f5 to
027d4a1
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
3 times, most recently
from
August 17, 2026 08:06
a1f41f5 to
c13ac70
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 17, 2026 08:30
c13ac70 to
a1f41f5
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 17, 2026 08:35
e00d1a2 to
dfcfe58
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 17, 2026 09:56
dfcfe58 to
df5beb1
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 17, 2026 18:53
df5beb1 to
ed1d2ed
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 19, 2026 10:02
ed1d2ed to
cc2940a
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 11:48
075f1ef to
5b41afe
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 11:50
5b41afe to
7a0fed5
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 14:33
7a0fed5 to
b27d24d
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 16:31
b27d24d to
662b8b4
Compare
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 16:57
662b8b4 to
ecdb86e
Compare
Add a `--backend-framework` flag and matching interactive prompt to `openui create`, plus the machinery that applies a framework overlay on top of a base template. - `BackendFramework` type and `normalizeBackendFramework()` accept `default`, `langgraph` and `vercel-ai-sdk` (with `none`/`no-framework`, `lang-graph`, `vercel`/`ai-sdk` aliases) and reject anything else. - `resolveBackendOverlay()` reads `backends/<framework>/manifest.json` from the template; `applyBackendOverlay()` copies the overlay files over the scaffolded project and honours `removeFiles`. - `rewritePackageJson()` merges the manifest's `dependencies`, `devDependencies` and `scripts`, and applies `removeDependencies`. - `backends/` is excluded from the base template copy so only the selected overlay lands in the generated project. - Framework scaffolds cannot reuse the shipped lockfiles, so those are dropped and the install switches to `npm install` / `pnpm install --no-frozen-lockfile`. - The dev server no longer starts when the required API key (`THESYS_API_KEY` or `OPENAI_API_KEY`) is missing; the CLI prints the remaining steps and exits non-zero instead. - Telemetry gains a `backend_framework_selected` funnel step recording whether the value came from a flag, a prompt, or the default. `default` keeps the existing behaviour. Selecting a framework before its overlay ships fails with a clear `template_missing` error. Squashed from 14 commits by Visharad Kashyap: dcbc7d3 feat(cli): scaffold selected backend framework 63d4869 fix(cli): keep cloud transport for framework tools ef5a812 feat(cli): add backend diagnostic tool c2b54e8 fix(cli): restore weather tool and AI SDK name be3a53e fix(cli): block dev start without api key 534e108 fix(cli): use native framework streams 9dc595c fix(cli): use packaged Vercel AI SDK adapter a4b47c6 Add OSS framework tool loops ddd5961 chore(cli): update template package versions 6daa3d3 feat(cli): use native cloud framework streams a075d0c feat(cli): scaffold deployable cloud framework backends c5f55d0 fix(cli): use published langchain package ead198c fix(cli): track latest langchain release c157f92 refactor(cli): compose backend template overlays Co-Authored-By: Visharad Kashyap <154831195+vishxrad@users.noreply.github.com>
Self-hosted scaffolds could finish with no `.env` at all — in non-interactive runs, and interactively when the key prompt was left blank. `writeEnv` bails on empty content, and unlike the Cloud template there is no `APP_ID` to make it non-empty. The closing message then said "Add your API key to .env", pointing at a file that did not exist, and no `.env.example` ships either. Always build content, commented out when no key was supplied, so there is a file to edit. Commented rather than an empty `OPENAI_API_KEY=`, which would shadow a key already exported in the shell. `resolveChatEnv` now mirrors `resolveCloudEnv`: prompt (extracted to `promptForProviderKey`), assemble `lines`, and return once with `envWritten: apiKey != null`. That flag stays false without a key, so the telemetry `env_written` property stays accurate and the immediate dev-server gate still refuses to start.
AbhinRustagi
force-pushed
the
be-framework-select
branch
from
August 24, 2026 16:59
ecdb86e to
044dcc1
Compare
Object.assign was appending overlay packages at the bottom; re-sort dependencies and devDependencies alphabetically like npm/pnpm install.
Backend overlays can ship package-lock.json; stop deleting it and use npm ci when the lock is present instead of always falling back to install.
Drop the missing-key block so --immediate still launches the server; the .env warning already tells the user to add a key.
This reverts commit 2ea2e35.
Spell out where to put the key (and Cloud key URL) instead of a bare error.
Keep --backend-framework as the public CLI surface; rename the on-disk module and types to overlays/ for the internal implementation.
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
openui createcan now scaffold a LangGraph or Vercel AI SDK backend instead of the template's default SDK route.Changes
--backend-frameworkflag and prompt —default,langgraph,vercel-ai-sdk.defaultbehaves exactly as before.overlays/<framework>/inside a template. Its files are copied over the scaffold, andmanifest.jsondescribes everything else.packageJson(dependencies, devDependencies, scripts, removeDependencies),files.remove, andgettingStarted.--immediateno longer starts the dev server when the template's API key is missing; it prints the remaining steps and exits non-zero.Public CLI copy stays "backend framework". Overlay naming is internal only. No framework overlays ship in this PR — those land later in the stack. Until then, picking a framework fails with a clear "backend framework not found" error, so this is safe to merge on its own.
Test Plan
tsc,prettierandeslintclean. Built the CLI and scaffolded:--template openui-self-hostedwith no flag — unchanged, still usesnpm ci--backend-framework langgraph— fails withBackend framework "langgraph" not found--backend-framework nope— rejected, lists the valid valuesChecklist