The CLI installs the Go way and updates itself the same way:
init
Use the init command to initialize configuration and dependencies for an existing project.
The init command writes components.json, adds the shared utils package, merges the theme CSS variables into your Tailwind entry file and vendors the shared stylesheets next to it. A go.mod is required.
Pick a design on shadcn-templ.com/create and pass its preset code or URL, or use one of the named presets (nova, vega, maia, lyra, mira, luma, sera, rhea):
Options
add
Use the add command to add components and dependencies to your project.
The CLI resolves registry dependencies recursively (for example alert-dialog pulls in button and dialog) and rewrites all imports to your module. After adding, run templ generate and go mod tidy to complete the install.
Existing files are never overwritten silently; re-run with --overwrite to update.
Options
apply
Use the apply command to apply a preset to an existing project.
Without --only this rewrites your components.json, your CSS variables and re-installs every installed component in the new style. You can apply only the theme or fonts from a preset without reinstalling components:
Supported values for --only are theme and font, also combined as --only theme,font.
Options
preset
Use the preset command to inspect preset codes and resolve the preset for an existing project.
preset decode
Use preset decode to decode a preset code and print the design it encodes.
Options
preset resolve
Use preset resolve to resolve the preset from the current project, reconstructed from components.json and your Tailwind entry file.
The preset info command is an alias for preset resolve:
Options
preset url
Use preset url to print the create URL for a preset code.
upgrade
The CLI updates itself the Go way: