impr: Add non-interactive mode to CLI#2588
Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (355 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.81, 1.73, 3.64, 6.13, 6.90, 10.40, 20.33, 23.11]
line [0.91, 1.83, 3.66, 5.97, 6.83, 11.83, 20.41, 23.26]
line [0.90, 1.81, 4.13, 6.29, 6.87, 9.00, 19.71, 21.09]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.32, 0.52, 0.65, 0.80, 1.11, 1.19, 1.44, 1.52]
line [0.28, 0.51, 0.65, 0.80, 1.18, 1.16, 1.42, 1.59]
line [0.27, 0.49, 0.62, 0.78, 1.05, 1.12, 1.40, 1.54]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.82, 1.91, 3.14, 6.08, 11.44, 24.12, 50.96, 106.22]
line [0.75, 1.92, 3.21, 5.77, 11.16, 23.89, 51.55, 106.88]
line [0.94, 1.90, 3.09, 5.72, 11.12, 23.38, 51.14, 105.68]
|
There was a problem hiding this comment.
Pull request overview
Adds a non-interactive (“--yes”) mode and richer CLI options to @typegpu/cli, enabling scripted project creation/enhancement with selectable templates, packages, agent skills, and explicit package manager selection.
Changes:
- Introduces centralized CLI option parsing/validation (
options.ts) and extends CLI entrypoint flags/usage. - Updates create/enhance flows to support non-interactive execution paths (including package selection and agent skills install).
- Refactors “ask” steps into reusable “setup” helpers for non-interactive automation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typegpu-cli/src/utils/files.ts | Adds non-interactive directory preparation and supports passing explicit ecosystem packages into scaffolding. |
| packages/typegpu-cli/src/steps/webgpu-types.ts | Extracts non-interactive setupWebgpuTypes helper and reuses it from the prompt-based flow. |
| packages/typegpu-cli/src/steps/vite.ts | Adds non-interactive setupVite helper with optional config creation. |
| packages/typegpu-cli/src/steps/typegpu.ts | Adds non-interactive helpers for installing typegpu and ecosystem packages. |
| packages/typegpu-cli/src/steps/skills.ts | Extracts addAgentSkills helper for non-interactive usage. |
| packages/typegpu-cli/src/options.ts | New module for parsing/validating templates, packages, and package manager flags. |
| packages/typegpu-cli/src/index.ts | Expands CLI args/help and wires parsed options into create/enhance commands. |
| packages/typegpu-cli/src/enhance.ts | Adds non-interactive enhance flow and supports preselected packages/agent skills/package manager. |
| packages/typegpu-cli/src/create.ts | Adds non-interactive create flow (defaults, no prompts) and supports explicit template/packages/skills. |
| packages/typegpu-cli/README.md | Documents new non-interactive usage examples and flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f21ef8c to
4bf2be9
Compare
# Conflicts: # packages/typegpu-cli/src/utils/files.ts
|
Could we make |
| if (options?.nonInteractive) { | ||
| await runNonInteractiveEnhance(cwd, pmAgent, pkg, options); | ||
| p.outro('Done! Get ready for a shaderful experience.'); | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Now, this block is fine. In the future, we should add a command line argument for the project kind.
| if (!pmAgent) { | ||
| failAndExit('Could not detect package manager.'); | ||
| } |
There was a problem hiding this comment.
| if (!pmAgent) { | |
| failAndExit('Could not detect package manager.'); | |
| } |
7f71b99 to
1b5698c
Compare
closes #2585
closes #2586