Skip to content

Commit c65c2ce

Browse files
authored
Merge pull request #81 from afsar-dev/dev
cli readme.md docs added
2 parents 6ebe469 + bbdaf6d commit c65c2ce

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ If you find this project useful, please consider [sponsoring me](https://github.
5151
5252
[![Sponsor](https://img.shields.io/badge/Sponsor-%F0%9F%92%96-pink)](https://github.com/sponsors/your-username) -->
5353

54-
5554
## Maintainer
5655

5756
**Md Afsar Mahmud**

src/cli/ README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Nurui CLI
2+
3+
Use the Nurui CLI to list and add components to your project.
4+
5+
---
6+
7+
## list
8+
9+
Use the `list` command to view all available components.
10+
11+
```bash
12+
npx nurui list
13+
```
14+
15+
Example output:
16+
17+
```
18+
┌ Welcome to Nurui CLI
19+
20+
◇ 📦 Available components:
21+
22+
• gradient-button
23+
• border-button
24+
• shiny-card
25+
• spotlight-card
26+
• contact-form
27+
• video-modal
28+
• gradient-hero
29+
• spotlight-hero
30+
• animated-pricing
31+
• project-showcase
32+
33+
└ ✨ End of list.
34+
```
35+
36+
---
37+
38+
## add
39+
40+
Use the `add` command to add a component to your project.
41+
Downloads the component and styles, creates `lib/utils`, and installs required dependencies.
42+
43+
```bash
44+
npx nurui add <component-name>
45+
```
46+
47+
Example:
48+
49+
```bash
50+
npx nurui add gradient-button
51+
```
52+
53+
> Note: The `add` command **requires** a component name.
54+
> If you run `npx nurui add` without a name, the CLI prints usage and exits.
55+
56+
---
57+
58+
## How it works (behind the scenes)
59+
60+
When you run:
61+
62+
```bash
63+
npx nurui add gradient-button
64+
```
65+
66+
1. Fetches the component registry from GitHub (`registry-cli.json`).
67+
2. Finds `gradient-button` in the registry.
68+
3. Prompts you to choose **TypeScript (.tsx)** or **JavaScript (.jsx)**.
69+
4. Downloads files from the repo:
70+
- component files → `components/nurui/`
71+
- styles (`.css`) → `components/nurui/styles/`
72+
73+
5. Ensures `lib/utils.ts` or `lib/utils.js` exists (adds `cn` helper using `clsx` + `tailwind-merge`).
74+
6. If JavaScript selected, transpiles `.tsx``.jsx` (TypeScript + Prettier).
75+
7. Detects your package manager (`yarn` / `pnpm` / `bun` / `npm`) and installs any required dependencies for that component.
76+
8. Prints a success summary.

0 commit comments

Comments
 (0)