Skip to content

Conversation

@Pawandasila
Copy link

  • Add new 'generate' command to CLI with alias 'gen'
  • Support 7 types: component, hook, util, context, page, layout, api
  • Auto-format names (PascalCase for components, camelCase for hooks)
  • Generate files in appropriate default directories
  • Include comprehensive tests for command structure
  • Add documentation to cli.mdx and README.md
  • Provide helpful next-steps after generation

- Add new 'generate' command to CLI with alias 'gen'
- Support 7 types: component, hook, util, context, page, layout, api
- Auto-format names (PascalCase for components, camelCase for hooks)
- Generate files in appropriate default directories
- Include comprehensive tests for command structure
- Add documentation to cli.mdx and README.md
- Provide helpful next-steps after generation
@vercel
Copy link

vercel bot commented Nov 1, 2025

@Pawandasila is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@DimaDevelopment
Copy link
Contributor

@Pawandasila, hi.
I built something similar in my own registry.
What do you think — should we add this to the registry template?
That’s functionality that belongs to the registry itself, not to the whole shadcn project.

@Pawandasila
Copy link
Author

Hi! Thanks for the feedback, I really appreciate it. 🙏

That's a great point about registry-level vs core CLI functionality. Let me share my thinking:

My reasoning for core CLI:

  1. The generate command complements the existing workflow - after running init and add, developers often need to create custom components/hooks that follow the same patterns
  2. It ensures consistency across all shadcn-based projects, regardless of which registry they use
  3. Similar to how init sets up the project structure, generate helps maintain it
  4. The templates use the same conventions already established by shadcn (TypeScript, component patterns, etc.)

However, I see your point about registry templates:

  • Different registries might want different scaffolding templates
  • It could add unnecessary complexity if not everyone needs it
  • Registry-specific generation could be more flexible

I'm definitely open to moving this to a registry template if that aligns better with the project's vision. What do @shadcn and other maintainers think?

Also, could you share a link to your registry implementation? I'd like to see how you approached it! 👀

@DimaDevelopment
Copy link
Contributor

@Pawandasila
Yeah, I’d really like to hear @shadcn opinion on this!

Here’s how I implemented it on my side:
👉 https://github.com/WandryDev/wandry-ui/tree/main/scripts

@Pawandasila
Copy link
Author

@DimaDevelopment

Thanks for sharing! I see the difference now your scripts are for building registries, mine is for end-users scaffolding in their apps.

Valid point about architecture. Let's see what @shadcn thinks about the best place for this functionality. Open to moving it wherever makes most sense! 👍

@shadcn
Copy link
Collaborator

shadcn commented Nov 4, 2025

@Pawandasila This is something that we definitely need. I have this on the roadmap. However there's something else I need to get done first before we do this.

Let's keep this open. I'll ping you soonish and we can get this going.

Appreciate you working on this. We'll collab.

@shadcn shadcn added the area: roadmap This looks great. We'll add it to the roadmap, review and merge. label Nov 4, 2025
@Pawandasila
Copy link
Author

Thanks @shadcn ! Really appreciate the feedback.

I'm excited to collaborate on this! I'll keep the PR open and ready to iterate based on your guidance. Just ping me whenever you're ready and I'm happy to:

  • Adjust the implementation
  • Add/modify features
  • Follow any architectural decisions you have in mind

Looking forward to working together on this! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: roadmap This looks great. We'll add it to the roadmap, review and merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants