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

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.

2 participants