@sonacode/sonaui-cli
v1.3.0
Published
A CLI to download SonarUI components
Downloads
3
Readme
sonaui-cli
sonaui-cli is a command-line interface (CLI) tool designed to manage and download components from the Sona UI library. It provides commands to list available components, view details of a specific component, and download components along with their dependencies.
Installation
To install the dependencies required for the CLI, run:
bun installUsage
To execute the CLI, use the following command:
bun run index.tsAlternatively, if the CLI is installed globally, you can use:
sona-cli <command>Commands
list
Lists all available components in the Sona UI library.
Usage
sona-cli listExample Output
📦 Available Components:
- Accordion (general)
- AnimatedPlusMinusButton (general)
- ExpandableTabs (general)
- LinkPreview (general)
- MagneticButton (general)
- RippleButton (general)
- SpinningText (general)
- VerticalTab (general)show
Displays details of a specific component, including its description and dependencies.
Usage
sona-cli show <component>Arguments
<component>: The name of the component to display details for.
Example
sona-cli show AccordionExample Output
🔍 Component: Accordion
📄 Description: [Component description here]
🔗 Depends on: AnimatedPlusMinusButtondownload
Downloads a specific component and its dependencies to the local components/ directory.
Usage
sona-cli download <component>Arguments
<component>: The name of the component to download.
Example
sona-cli download AccordionExample Output
✅ Accordion.tsx downloaded.
✅ AnimatedPlusMinusButton.tsx downloaded.
📥 All components downloaded to: components/Accordion/Project Structure
The project is organized as follows:
sonaui-cli/
├── src/
│ ├── index.ts # Entry point of the CLI
│ ├── commands/
│ │ ├── list.ts # Implementation of the `list` command
│ │ ├── show.ts # Implementation of the `show` command
│ │ └── download.ts # Implementation of the `download` command
├── components.json # Metadata for available components
├── package.json # Project configuration and dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentationDevelopment
Build
To build the project, run:
bun run buildRelease
To release a new version, run:
bun run releaseWorkflow
The project uses a GitHub Actions workflow for semantic release. The workflow is triggered on:
- Pushes to the
mainbranch - Pull requests to the
mainordevbranches - Manual dispatch
License
This project is licensed under the MIT License.
