CLI
Snyth CLI to manage your UI components.
CLI Reference
The Snyth CLI is the fastest way to add, manage, and remove components in your React and React Native projects.
Installation
You don't need to install the CLI globally. You can run it directly using your preferred package manager:
npm snyth initnpx snyth initnpx snyth initbunx snyth initCommands
init
Setup snyth.config.json in your project root. This command will ask for your project type (React or React Native) and preferred directory.
snyth initlist
List all components available in the Snyth registry and check their installation status.
snyth listadd
Download components into your project. You can provide a specific component name.
snyth add buttonremove
Delete components from your project. This command supports multiple arguments to clean up several files at once.
snyth remove button card inputWorkflow
Follow these steps to integrate Snyth into a new project:
Initialize
Run snyth init to configure your environment and create the snyth.config.json file.
Browse
Use snyth list to see what components are currently available in our cloud registry.
Install
Run snyth add <name> to pull the source code into your local directory.
Configuration
The CLI uses a snyth.config.json file to track your preferences.
{
"projectType": "react-native",
"ts": true,
"dir": "./src/components/snyth",
"components": ["button"]
}| Property | Description |
|---|---|
projectType | Either react or react-native. |
ts | Boolean indicating if the project uses TypeScript. |
dir | The local path where components are saved. |
components | An array of currently installed component IDs. |