#40

Support Vite-style custom templates

OpenOluwasetemiopened 1mo ago

Summary

It would be useful for create-gpui-app to support a modern template system similar to create-vite, where users can choose from built-in templates or bring their own local/remote templates.

Motivation

One of the strengths of tools like create-vite is that the scaffolding tool is not limited to only the templates built directly into the CLI. Users and the community can create, share, and reuse their own templates without needing every project style to be added to the generator itself.

For GPUI, this could make it easier for people to experiment with and share starter projects for different app architectures, component patterns, workspace layouts, build setups, design systems, and examples.

Possible UX

For example:

create-gpui-app my-app --template default
create-gpui-app my-app --template workspace
create-gpui-app my-app --template zed
create-gpui-app my-app --template github:user/gpui-template
create-gpui-app my-app --template ./local-template

The exact syntax could differ, but the main idea is to support both built-in and user-provided templates.

Benefits

  • Makes create-gpui-app more extensible
  • Allows the community to share GPUI starter templates
  • Reduces pressure to add every project structure directly to this repo
  • Provides a clearer model for project styles than multiple hardcoded flags
  • Makes it easier to support examples for different app patterns and levels of complexity

Open questions

  • Should existing options like --workspace and --zed become aliases for built-in templates?
  • Should templates support variable replacement beyond the project name?
  • Which remote sources should be supported initially: GitHub shorthand, full Git URL, crates.io package, or only local paths?
  • Should the template format be documented as a stable API?

Activity

0

No activity yet.