You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extendable nuxi add with custom templates from modules #56
Hi dear @ramsesgarate. I think that's a nice idea and can think of several ways to make it possible from modules injecting their templates. Dicussion tag means we are open to discuss about it and find possible solutions.
Reacted by Daniel Roe, Ramses Garate, Alexander Lichter and Artem Manchenkov
changed the title [-]Extendable `nuxi add` with custom templates from mudoules[/-][+]Extendable `nuxi add` with custom templates from modules[/+]on Oct 14, 2022
I understand, I think I got too complicated saying templates haha the truth is I had thought of something a little simpler, based on how it currently works creating pages with nuxi add, for content I would return something like
This would also be useful if you want to create a page with order prefixes like nuxi add content 1.about, ignore nuxi add content .1.about or partiarls nuxi add content _1.about.
Templates allows to generate extra files during development and build time.
But the initial feature request was to extend Nuxi CLI functionality to generate files from custom templates and not for build time.
For example, if I want to define a custom version of a composable or plugin with predefined functionality, there is no way to leverage those Kit templates.
Hey team! I raised two draft PRs with an example of the implementation for custom templates support, please take a look and let me know if that makes sense to go further 🙏
Activity
ramsesgarate commentedon Oct 13, 2022
What does the tag discussion mean? @danielroe
Greetings
[-]nuxi add content <name>[/-][+]Extendable `nuxi add` with custom templates from mudoules[/+]pi0 commentedon Oct 14, 2022
Hi dear @ramsesgarate. I think that's a nice idea and can think of several ways to make it possible from modules injecting their templates. Dicussion tag means we are open to discuss about it and find possible solutions.
[-]Extendable `nuxi add` with custom templates from mudoules[/-][+]Extendable `nuxi add` with custom templates from modules[/+]ramsesgarate commentedon Oct 14, 2022
I understand, I think I got too complicated saying templates haha the truth is I had thought of something a little simpler, based on how it currently works creating pages with nuxi add, for content I would return something like
This would also be useful if you want to create a page with order prefixes like
nuxi add content 1.about, ignorenuxi add content .1.aboutor partiarlsnuxi add content _1.about.manchenkoff commentedon May 13, 2023
It would be really nice to have some section like
templatesin thenuxt.config.tswhich expects an array of interfaces from the source codethen we can load it either from a layer or module, etc.
Should we expect this feature in one of the subsequent releases? 🤔
OrbisK commentedon Jun 18, 2025
I think this now part of nuxt kit: https://nuxt.com/docs/api/kit/templates
manchenkoff commentedon Jun 18, 2025
@OrbisK I don't think it is:
But the initial feature request was to extend Nuxi CLI functionality to generate files from custom templates and not for build time.
For example, if I want to define a custom version of a composable or plugin with predefined functionality, there is no way to leverage those Kit templates.
Right now, those templates are hardcoded here - https://github.com/nuxt/cli/blob/main/packages/nuxi/src/utils/templates/index.ts#L29 and later used in
addcommand - https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/add.ts#L71OrbisK commentedon Jun 18, 2025
Yeah, you are right. I misread the topic 👍🏽
manchenkoff commentedon Jun 11, 2026
Hey team! I raised two draft PRs with an example of the implementation for custom templates support, please take a look and let me know if that makes sense to go further 🙏
nuxt/schemahook: feat: add support for custom templates nuxt#35345nuxt/cliimplementation: feat: add support for custom templates #1340cc @danielroe (tagging you since you were auto-assigned to PRs)