@splice-tools/cli
v0.1.0
Published
Install Splice components from the Splice registry into your project.
Maintainers
Readme
@splice-tools/cli
Install components from the Splice registry into
your project. Reads a registry-item JSON, drops files in the right
place, runs npm/pnpm/yarn/bun install for any required packages, and
recurses into other registry items it depends on.
Install
You don't install this — you run it. Pick the runner that matches your project's package manager:
# npm
npx @splice-tools/cli add button-progress
# pnpm
pnpm dlx @splice-tools/cli add button-progress
# yarn (v2+)
yarn dlx @splice-tools/cli add button-progress
# bun
bunx @splice-tools/cli add button-progressThe CLI auto-detects your project's package manager from its lockfile.
Usage
splice add <id|url> [options]
Options:
--cwd <path> Project root to install into (default: current dir)
--no-install Skip the dependency install step (still writes files)
--base-url <url> Override the default registry base URL
(Or set SPLICE_REGISTRY_URL.)
-h, --help Show help
-v, --version Show versionBy id
npx @splice-tools/cli add button-progressResolves to https://splice.tools/r/button-progress.json and installs
the React bundle into components/ui/.
By full URL
npx @splice-tools/cli add https://splice.tools/r/button-progress.vue.jsonUse the framework-specific URL to install the Vue, Svelte, or Angular bundle (when available). The discovery list lives at https://splice.tools/r/index.json.
What it does, step by step
- Fetches the registry-item JSON from the resolved URL.
- Validates a few required fields (
name,type,files[]). - Recursively
adds anyregistryDependenciesfirst. - Writes each
files[].contenttofiles[].pathrelative to your project root, creating folders as needed. - If the item lists
dependencies[], runs your project's package manager to install them.
That's it. No prompts, no project mutation beyond what's listed in the JSON. Re-run any time to re-install (it will overwrite the files).
Safety
- Refuses to write to absolute paths or anything outside
--cwd. - Validates required fields before touching the filesystem.
- Skips the install step entirely with
--no-installif you want to diff before installing deps.
Roadmap
See ROADMAP.md at the repository root. Phase 4 will add Tailwind
config merging when the first Tailwind component lands in the registry.
License
MIT
