Skip to content

feat(cli): select a backend framework at scaffold time - #964

Open
AbhinRustagi wants to merge 1 commit into
mainfrom
be-framework-select
Open

feat(cli): select a backend framework at scaffold time#964
AbhinRustagi wants to merge 1 commit into
mainfrom
be-framework-select

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What

openui create can now scaffold a LangGraph or Vercel AI SDK backend instead of the template's default SDK route.

Changes

  • New --backend-framework flag and prompt — default, langgraph, vercel-ai-sdk. default behaves exactly as before.
  • A backend is just a directory: backends/<framework>/ inside a template. Its files are copied over the scaffold, and manifest.json describes everything else.
  • The manifest is grouped by what it touches — packageJson (dependencies, devDependencies, scripts, removeDependencies), files.remove, and gettingStarted.
  • Framework scaffolds can't reuse the shipped lockfiles, so those are dropped and the install does a full resolve.
  • --immediate no longer starts the dev server when the template's API key is missing; it prints the remaining steps and exits non-zero.
  • Telemetry records the chosen framework and whether it came from a flag, a prompt, or the default.

No overlays ship here — those land later in the stack. Until then, picking a framework fails with a clear "overlay not found" error, so this is safe to merge on its own.

Test Plan

  • Verified locally

tsc, prettier and eslint clean. Built the CLI and scaffolded:

  • --template openui-self-hosted with no flag — unchanged, still uses npm ci
  • --backend-framework langgraph — fails with Backend overlay "langgraph" not found
  • --backend-framework nope — rejected, lists the valid values

Checklist

  • I updated docs/README when needed (docs follow in the next PR)
  • I considered backwards compatibility

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 14, 2026 11:19am

Request Review

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>
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.

1 participant