Skip to content

feat(cli): add --sdui flag to ag init#431

Merged
roblevintennis merged 1 commit intomasterfrom
issue-423/sdui-init-flag
Mar 21, 2026
Merged

feat(cli): add --sdui flag to ag init#431
roblevintennis merged 1 commit intomasterfrom
issue-423/sdui-init-flag

Conversation

@roblevintennis
Copy link
Copy Markdown
Contributor

Summary

  • Adds --sdui flag to ag init (alongside existing -f / --framework)
  • After standard init completes, scaffolds a minimal but working SDUI app:
    • src/sdui/fixture.ts — 4-node contact form as an AgNode[]
    • src/sdui/SduiDemo.tsx / SduiDemo.vue / SduiDemo.tsAgDynamicRenderer wired to the fixture with a dark-mode toggle, for all three frameworks
  • Installs @agnosticui/render-{framework} + @agnosticui/schema (gracefully degrades with a manual-install hint if packages aren't yet on npm)
  • Prints a "SDUI Scaffold Ready" box with import/usage snippets

Test plan

  • 7 new unit tests in init.test.ts covering all three frameworks and the no-flag case (829 total passing)
  • Real ag init --framework react --sdui smoke test in /tmp with fresh agnosticui-core-2.0.0-alpha.24.tgz
  • Scaffolded React SduiDemo.tsx + fixture.ts type-checked with tsc against local @agnosticui/render-react + @agnosticui/schema — 0 errors
  • Scaffolded Lit SduiDemo.ts + fixture.ts type-checked with tsc — 0 errors
  • Scaffolded Vue SduiDemo.vue structure verified; fixture.ts type-checks clean

Notes

Full end-to-end (npx agnosticui-cli init --sdui) requires the renderer/schema packages to be published to npm. Tracked in a follow-up issue.

Closes #423

🤖 Generated with Claude Code

Adds --sdui to the init command so users can go from impressed by the
SDUI demo to a working scaffold in a single command:

  npx agnosticui-cli init -f react --sdui

When the flag is set, after standard init completes, scaffoldSdui():
- Creates src/sdui/fixture.ts with a minimal 4-node contact form
- Creates src/sdui/SduiDemo.{tsx|vue|ts} wired to AgDynamicRenderer
  and a simple dark-mode toggle, for all three frameworks
- Installs @agnosticui/render-{framework} + @agnosticui/schema
  (gracefully degrades with a manual-install hint if packages are
  not yet on npm)
- Prints a "SDUI Scaffold Ready" box with import/usage instructions

Closes #423
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for agnosticui-demo-vue ready!

Name Link
🔨 Latest commit 4e6ffc2
🔍 Latest deploy log https://app.netlify.com/projects/agnosticui-demo-vue/deploys/69be0e9ef609140008aea833
😎 Deploy Preview https://deploy-preview-431--agnosticui-demo-vue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for agnosticui-demo-react ready!

Name Link
🔨 Latest commit 4e6ffc2
🔍 Latest deploy log https://app.netlify.com/projects/agnosticui-demo-react/deploys/69be0e9e8f584c000863686e
😎 Deploy Preview https://deploy-preview-431--agnosticui-demo-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for agnosticui-demo-lit ready!

Name Link
🔨 Latest commit 4e6ffc2
🔍 Latest deploy log https://app.netlify.com/projects/agnosticui-demo-lit/deploys/69be0e9eebbd7e0008750202
😎 Deploy Preview https://deploy-preview-431--agnosticui-demo-lit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@roblevintennis roblevintennis merged commit ae2a633 into master Mar 21, 2026
17 checks passed
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.

feat(cli): npx agnosticui-cli init --sdui

1 participant