Skip to content

ilyichv/shadcn-registry

Repository files navigation

shadcn-registry

CLI tool to generate shadcn compatible registries.

Installation

npm install shadcn-registry

Building The Registry

  1. Create a registry file. Registry files should be in JSON format and validate against the registry schema. You can find examples in the examples directory. You can also use the generate command to generate a new registry (currently experimental).

  2. Build the registry:

    npx shadcn-registry build <path-to-registry>

    Options

    • -p, --path <path>: The path to output the registry files.
    • -i, --index <path>: The path to output the registry index file.
    • --index-include <types...>: The types to include in the registry index file. Can be one or more of ui, hook, lib.
  3. Et voilà! Your registry files are now ready to be used with shadcn CLI.

CI/CD

You can use shadcn-registry in your CI/CD pipeline to automatically generate your registry files.

"scripts": {
    "build:registry": "npx shadcn-registry@latest build <path-to-registry>"
}

Generate registry

The generate command is currently experimental.

To generate a new registry, run the generate command with the path to the folder containing your components.

npx shadcn-registry@latest generate <path-to-components>

This will generate a new registry file in the same folder as your components, under a file called index.json. So if you run npx shadcn-registry@latest generate ./components, you will find the generated registry file at ./components/index.json.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please see the CONTRIBUTING file for details.

About

A CLI tool to generate shadcn registry files.

Resources

Stars

Watchers

Forks

Packages

No packages published