@surreal-ui/cli 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +103 -0
  2. package/dist/index.js +1 -1
  3. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # @surreal-ui/cli 💻🎨
2
+
3
+ The official Command Line Interface for **Surreal UI** — an AI-powered cross-platform UI component library.
4
+
5
+ Directly inspect and install multi-aesthetic components into your project across Svelte 5, React TSX, and WebComponents.
6
+
7
+ ---
8
+
9
+ ## 🚀 Quick Start
10
+
11
+ Run instantly with `npx`, `pnpm dlx`, or `bunx` without prior installation:
12
+
13
+ ```bash
14
+ # List all available components and styles in the catalog
15
+ npx @surreal-ui/cli list
16
+
17
+ # Add a component with a specific aesthetic into your project
18
+ npx @surreal-ui/cli add button --aesthetic glassmorphism
19
+
20
+ # Specify target framework (defaults to svelte, options: svelte, react, web)
21
+ npx @surreal-ui/cli add card --aesthetic neubrutalism --framework react
22
+ ```
23
+
24
+ ---
25
+
26
+ ## 🌐 Public Registry Endpoints
27
+
28
+ The Surreal UI component registry is publicly accessible at **`https://ui.pixerate.com/r`** and is 100% compliant with the official [Shadcn Registry Schema](https://ui.shadcn.com/schema/registry-item.json).
29
+
30
+ | Endpoint | Description |
31
+ | ------------------------------------------------------------- | -------------------------------------------------------------------------------- |
32
+ | `https://ui.pixerate.com/r/index.json` | Catalog index listing all 60+ components, styles, and dependencies |
33
+ | `https://ui.pixerate.com/r/:component.json` | Component definition with default aesthetic |
34
+ | `https://ui.pixerate.com/r/:aesthetic/:component.json` | Component definition for a specific aesthetic (e.g. `glassmorphism/button.json`) |
35
+ | `https://ui.pixerate.com/r/styles/:aesthetic/:component.json` | Style-scoped alias endpoint |
36
+
37
+ ---
38
+
39
+ ## 🛠️ Usage with Official Shadcn CLI
40
+
41
+ Because the Surreal UI registry strictly adheres to the Shadcn JSON schema, you can also install Surreal UI components directly using the standard `shadcn` CLI:
42
+
43
+ ```bash
44
+ # Add a component using shadcn CLI
45
+ npx shadcn@latest add https://ui.pixerate.com/r/button.json
46
+
47
+ # Add an aesthetic variant using shadcn CLI
48
+ npx shadcn@latest add https://ui.pixerate.com/r/glassmorphism/button.json
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 📖 CLI Commands
54
+
55
+ ### `add <component>`
56
+
57
+ Downloads and writes the component file directly into your project's component directory (e.g. `src/lib/components/ui/` or `src/components/ui/`).
58
+
59
+ ```bash
60
+ npx @surreal-ui/cli add <component> [options]
61
+ ```
62
+
63
+ **Options:**
64
+
65
+ - `-a, --aesthetic <style>`: Aesthetic variant (`glassmorphism`, `neubrutalism`, `minimalist`, `modern`, `shadcn`, etc.).
66
+ - `-f, --framework <framework>`: Framework target (`svelte`, `react`, `web`). Default: `svelte`.
67
+ - `-p, --path <path>`: Custom destination directory for component files.
68
+ - `-o, --overwrite`: Overwrite existing files if they already exist.
69
+ - `-r, --registry <url>`: Custom registry endpoint URL (default: `https://ui.pixerate.com/r`).
70
+
71
+ ### `list`
72
+
73
+ Lists all available UI component types, descriptions, and available aesthetics.
74
+
75
+ ```bash
76
+ npx @surreal-ui/cli list [options]
77
+ ```
78
+
79
+ **Options:**
80
+
81
+ - `-r, --registry <url>`: Custom registry endpoint URL (default: `https://ui.pixerate.com/r`).
82
+
83
+ ### `init`
84
+
85
+ Initializes Surreal UI configuration and sets up the component destination folder and package manager in your project.
86
+
87
+ ```bash
88
+ npx @surreal-ui/cli init
89
+ ```
90
+
91
+ ### `diff <component>`
92
+
93
+ Compares your local component implementation against the upstream registry version.
94
+
95
+ ```bash
96
+ npx @surreal-ui/cli diff <component> [options]
97
+ ```
98
+
99
+ ---
100
+
101
+ ## ⚙️ Environment Variables
102
+
103
+ - `SURREAL_REGISTRY_URL`: Override the default registry URL (default: `https://ui.pixerate.com/r`).
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import pc from "picocolors";
11
11
  import prompts from "prompts";
12
12
 
13
13
  // src/utils/registry.ts
14
- var DEFAULT_REGISTRY_URL = "https://surreal-ui.com/r";
14
+ var DEFAULT_REGISTRY_URL = process.env.SURREAL_REGISTRY_URL || "https://ui.pixerate.com/r";
15
15
  async function fetchRegistryItem(options) {
16
16
  const { componentId, aestheticId, framework = "svelte", registryUrl } = options;
17
17
  if (registryUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surreal-ui/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Surreal UI CLI - Add multi-platform UI components directly to your codebase",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "tsup": "^8.0.2",
26
26
  "tsx": "^4.23.12",
27
27
  "typescript": "^5.5.0",
28
- "@surreal-ui/core": "0.6.1"
28
+ "@surreal-ui/core": "0.6.2"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "tsup",