cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature request: Ability to overload and customise the templates

Open davidyell opened this issue 1 month ago • 1 comments

Summary

Our project uses Nuxt and also Nuxt UI. We need to add a variety of Nuxt UI parts to our templates and things like Authorization from Nuxt Authorization. We use the npx nuxt add often to make our components, pages and apis and it would be super helpful for us to create our own templates in our project so we can automate much of our daily boilerplate.

This is a feature pattern that I'm familiar with from CakePHP, https://book.cakephp.org/bake/3/en/development.html#creating-a-bake-theme

Proposal

I don't think it needs to be complex, perhaps it follows the Nuxt folder organisation and there is a stubs folder in / of the project, and the code can simply look for that folder and if it exists, it tries to load the template from there, or falls back to the current functionality.

Code

https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/add.ts#L74-L75

Perhaps a resolver is needed to encapsulate the functionality, but a smell change here might work?

davidyell avatar Nov 21 '25 08:11 davidyell

it seems like a good idea to me!

danielroe avatar Nov 21 '25 12:11 danielroe