@kivacore/ui-cli 0.0.0-stage → 0.26.4

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.
package/README.md CHANGED
@@ -1,3 +1,340 @@
1
- # Temporary Holding Version
1
+ # Kiva UI CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official command-line interface for Kiva - authentication, project scaffolding, and code generation tools.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx @kivacore/ui-cli <command>
9
+ ```
10
+
11
+ ## Local build
12
+
13
+ Run `pnpm build` from this package with `CLI_KIVA_API_URL`, `CLI_KIVA_CLIENT_ID`, and `CLI_KIVA_OAUTH_SCOPES` set in the environment or in `.env`. The build uses tsup 9 and writes both the CLI and library to `dist/`. For local builds, tsup supports Node 22.18+, 24.11+, or 26+ on those release lines.
14
+
15
+ ## Commands
16
+
17
+ ### Authentication
18
+
19
+ #### `login`
20
+
21
+ Log in to Kiva using browser-based SSO (default).
22
+
23
+ ```bash
24
+ npx @kivacore/ui-cli login # Opens browser for SSO authentication
25
+ npx @kivacore/ui-cli login --email # Use email/password instead (prompts for credentials)
26
+ npx @kivacore/ui-cli login -e user@example.com # Pre-fill email address
27
+ ```
28
+
29
+ #### `logout`
30
+
31
+ Log out from Kiva and clear stored credentials.
32
+
33
+ ```bash
34
+ npx @kivacore/ui-cli logout
35
+ ```
36
+
37
+ #### `whoami`
38
+
39
+ Display the currently logged-in user.
40
+
41
+ ```bash
42
+ npx @kivacore/ui-cli whoami
43
+ # Output: Email: user@example.com
44
+ # Name: John Doe
45
+ ```
46
+
47
+ ### Project Creation
48
+
49
+ #### `create [name]`
50
+
51
+ Create a new Kiva project from a template.
52
+
53
+ ```bash
54
+ npx @kivacore/ui-cli create # Interactive mode - prompts for all options
55
+ npx @kivacore/ui-cli create my-app # Create project with specified name
56
+ npx @kivacore/ui-cli create my-app --nextjs # Next.js + plain Tailwind
57
+ npx @kivacore/ui-cli create my-app --nextjs --shadcn # Next.js + shadcn/ui
58
+ npx @kivacore/ui-cli create my-app --react --shadcn # React + shadcn/ui
59
+ npx @kivacore/ui-cli create my-app --vue --shadcn # Vue + shadcn-vue
60
+ npx @kivacore/ui-cli create my-app --nextjs --shadcn --zustand --eslint --pnpm # Full flags
61
+ ```
62
+
63
+ **Framework Options:**
64
+
65
+ | Flag | Description |
66
+ |------|-------------|
67
+ | `--nextjs` | Use Next.js 16+ (App Router) |
68
+ | `--react` | Use React 19+ with Vite |
69
+ | `--vue` | Use Vue 3.5+ with Vite |
70
+
71
+
72
+ **UI Library Options (optional - defaults to plain Tailwind if not specified):**
73
+
74
+ | Flag | Compatible Frameworks |
75
+ |------|----------------------|
76
+ | `--shadcn` | Next.js, React (shadcn/ui) / Vue (shadcn-vue) |
77
+
78
+ **State Management Options (optional):**
79
+
80
+ | Flag | Compatible Frameworks |
81
+ |------|----------------------|
82
+ | `--zustand` | Next.js, React |
83
+ | `--tanstack-query` | Next.js, React |
84
+ | `--tanstack-vue-query` | Vue |
85
+
86
+ **Linter Options:**
87
+
88
+ | Flag | Description |
89
+ |------|-------------|
90
+ | `--eslint` | Use ESLint for linting |
91
+ | `--biome` | Use Biome for linting |
92
+ | `--no-linter` | Skip linter configuration |
93
+
94
+ **Package Manager Options:**
95
+
96
+ | Flag | Description |
97
+ |------|-------------|
98
+ | `--pnpm` | Use pnpm (recommended) |
99
+ | `--npm` | Use npm |
100
+ | `--yarn` | Use yarn |
101
+ | `--bun` | Use bun |
102
+
103
+ **Styling Options (shadcn only):**
104
+
105
+ | Option | Description |
106
+ |--------|-------------|
107
+ | `--style <style>` | Component style (vega, nova, maia, lyra, mira) |
108
+ | `--base-color <color>` | Base color theme (zinc, slate, neutral, stone, gray) |
109
+ | `--rtl` | Enable RTL (right-to-left) support |
110
+
111
+ **Other Options:**
112
+
113
+ | Option | Description |
114
+ |--------|-------------|
115
+ | `-p, --path <path>` | Target directory path |
116
+ | `--alias <prefix>` | Custom import alias prefix (must start with @) |
117
+ | `--local` | Use local templates (development only) |
118
+
119
+ Each template includes:
120
+ - Pre-configured OAuth2 authentication via `@kivacore/signin`
121
+ - Kiva API client integration
122
+ - Modern TypeScript setup
123
+ - Linter configuration (ESLint or Biome)
124
+
125
+ ### Component Registry
126
+
127
+ Registry uç noktalarını özelleştirme:
128
+
129
+ - `KIVA_REGISTRY_URL` (varsayılan: `https://ui.kivacore.com/r`)
130
+ - `KIVA_SHADCN_REGISTRY_URL` (varsayılan: `https://ui.kivacore.com/r/shadcn`)
131
+ - `KIVA_PLATE_REGISTRY_URL` (varsayılan: `https://ui.kivacore.com/r/plate`)
132
+
133
+ #### `add [items...]`
134
+
135
+ Add Kiva UI components, hooks, or utilities to your project.
136
+
137
+ **Prerequisite:** Run `npx shadcn@latest init` first to create `components.json`.
138
+
139
+ ```bash
140
+ npx @kivacore/ui-cli add button # Add a component
141
+ npx @kivacore/ui-cli add button dialog # Add multiple components
142
+ npx @kivacore/ui-cli add --all # Install all available components
143
+ npx @kivacore/ui-cli add hooks-debounce # Add a hook
144
+ npx @kivacore/ui-cli add rn-button # Add a React Native component
145
+ npx @kivacore/ui-cli add rn-hooks-use-kiva-tenant # Add a React Native hook
146
+ npx @kivacore/ui-cli add utils-cn # Add a utility
147
+ npx @kivacore/ui-cli add button --dry-run # Preview installation
148
+ npx @kivacore/ui-cli add button -o # Overwrite existing files
149
+ npx @kivacore/ui-cli add button -p ./src/ui # Custom target path
150
+ ```
151
+
152
+ **What happens:**
153
+ 1. Resolves components and their dependencies from the Kiva registry
154
+ 2. Installs vendor primitives by fetching vendor registry items (shadcn/Plate) and writing files via `components.json` aliases
155
+ 3. Writes Kiva component files to `components/kiva/`
156
+ 4. Installs npm dependencies
157
+ 5. Bundled lib/hook files are shared across components (written once, skipped if exists)
158
+ 6. Plate installs always include core editor primitives (`editor`, `editor-kit`) for editor/static compatibility
159
+ 7. Vendor-component files (e.g. editor/) are bundled with the component
160
+
161
+ **Registry Names:**
162
+
163
+ | Input | Registry Name |
164
+ |-------|---------------|
165
+ | `button` | `@kivacore/ui-button` |
166
+ | `hooks-debounce` | `@kivacore/hooks-debounce` |
167
+ | `utils-cn` | `@kivacore/utils-cn` |
168
+ | `rn-button` | `@kivacore/rn-button` → `components/kiva-native/` |
169
+ | `rn-hooks-use-kiva-tenant` | `@kivacore/rn-hooks-use-kiva-tenant` → `hooks/kiva-native/` |
170
+
171
+ `--all react-native` / `--all-rn` installs every `@kivacore/rn-*` item — native components **and** native hooks.
172
+
173
+ **Options:**
174
+
175
+ | Option | Description |
176
+ |--------|-------------|
177
+ | `-a, --all` | Install all available components from the registry |
178
+ | `-o, --overwrite` | Overwrite existing files without prompting |
179
+ | `-d, --dry-run` | Show what would be installed without making changes |
180
+ | `-p, --path <path>` | Custom target path for files |
181
+
182
+ #### `update`
183
+
184
+ Update all installed Kiva components to the latest version from the registry. Detects and optionally removes components that were deleted from the registry.
185
+
186
+ ```bash
187
+ npx @kivacore/ui-cli update # Update all installed components
188
+ npx @kivacore/ui-cli update --prune # Update and remove stale components
189
+ npx @kivacore/ui-cli update --dry-run # Preview what would be updated
190
+ ```
191
+
192
+ Scans `components/kiva/`, `components/kiva-native/`, `hooks/kiva/` (web hooks) and `hooks/kiva-native/` (native hooks, reported as `rn-hooks-<name>`) to detect installed items, resolves latest versions from the registry, and updates all files including new vendor primitives and npm dependencies. Components that no longer exist in the registry are reported as stale — use `--prune` to remove them.
193
+
194
+ **Options:**
195
+
196
+ | Option | Description |
197
+ |--------|-------------|
198
+ | `-d, --dry-run` | Show what would be updated without making changes |
199
+ | `--prune` | Remove locally installed components that no longer exist in the registry |
200
+
201
+ #### `list`
202
+
203
+ List available Kiva UI registry items (components, hooks, utilities) or published npm packages.
204
+
205
+ ```bash
206
+ npx @kivacore/ui-cli list # List registry components
207
+ npx @kivacore/ui-cli list --packages # List published @kivacore npm packages
208
+ npx @kivacore/ui-cli list --json # Output as JSON
209
+ ```
210
+
211
+ **Options:**
212
+
213
+ | Option | Description |
214
+ |--------|-------------|
215
+ | `--packages` | List published @kivacore npm packages instead |
216
+
217
+ #### `themes`
218
+
219
+ Browse and manage Kiva UI themes.
220
+
221
+ ##### `themes list`
222
+
223
+ List all available theme presets.
224
+
225
+ ```bash
226
+ npx @kivacore/ui-cli themes list
227
+ ```
228
+
229
+ ##### `themes add [name]`
230
+
231
+ Apply a theme to your project's `globals.css`.
232
+
233
+ ```bash
234
+ npx @kivacore/ui-cli themes add midnight # Apply a theme preset by name
235
+ npx @kivacore/ui-cli themes add --url <share-url> # Apply theme from a share URL
236
+ npx @kivacore/ui-cli themes add --file ./theme.json # Apply theme from a local JSON file
237
+ ```
238
+
239
+ **Options:**
240
+
241
+ | Option | Description |
242
+ |--------|-------------|
243
+ | `--url <url>` | Apply theme from a share URL (overrides name argument) |
244
+ | `--file <path>` | Apply theme from a local JSON file (overrides name argument) |
245
+
246
+ ##### `themes current`
247
+
248
+ Display current `:root` and `.dark` CSS variables from your `globals.css`.
249
+
250
+ ```bash
251
+ npx @kivacore/ui-cli themes current
252
+ ```
253
+
254
+ ### Code Generation
255
+
256
+ #### `generate db [spec]`
257
+
258
+ Generate TanStack Query collections from an OpenAPI 3.1.0 specification.
259
+
260
+ ```bash
261
+ npx @kivacore/ui-cli generate db # Auto-detect openapi.json in current directory
262
+ npx @kivacore/ui-cli generate db ./api/openapi.json # Specify spec file path
263
+ npx @kivacore/ui-cli generate db ./spec.json -o ./src/api # Custom output directory
264
+ ```
265
+
266
+ **Options:**
267
+
268
+ | Option | Description |
269
+ |--------|-------------|
270
+ | `-o, --output <dir>` | Output directory (defaults to `src` in spec file folder) |
271
+
272
+ ### Project Setup
273
+
274
+ #### `commitlint`
275
+
276
+ Set up commitlint, husky, and lint-staged in your project.
277
+
278
+ ```bash
279
+ npx @kivacore/ui-cli commitlint
280
+ ```
281
+
282
+ ### CLI Management
283
+
284
+ #### `upgrade`
285
+
286
+ Upgrade the CLI to the latest version. Automatically detects your package manager (npm, pnpm, yarn, bun).
287
+
288
+ ```bash
289
+ npx @kivacore/ui-cli upgrade
290
+ ```
291
+
292
+ #### `info`
293
+
294
+ Display CLI version, system information, and authentication status.
295
+
296
+ ```bash
297
+ npx @kivacore/ui-cli info
298
+ ```
299
+
300
+ ## Global Options
301
+
302
+ ### `--json`
303
+
304
+ Output results in JSON format. Useful for scripting and CI/CD pipelines.
305
+
306
+ ```bash
307
+ npx @kivacore/ui-cli whoami --json
308
+ npx @kivacore/ui-cli generate db ./spec.json --json
309
+ ```
310
+
311
+ ### `-v, --version`
312
+
313
+ Display the CLI version.
314
+
315
+ ### `-h, --help`
316
+
317
+ Display help information.
318
+
319
+ ```bash
320
+ npx @kivacore/ui-cli --help
321
+ npx @kivacore/ui-cli create --help
322
+ ```
323
+
324
+ ## Environment Variables
325
+
326
+ | Variable | Description |
327
+ |----------|-------------|
328
+ | `KIVA_API_URL` | Override the API base URL |
329
+ | `KIVA_OAUTH_CLIENT_ID` | Override the OAuth2 client ID |
330
+ | `KIVA_OAUTH_SCOPES` | Override the OAuth2 scopes |
331
+
332
+ ## Token Storage
333
+
334
+ Credentials are securely stored using:
335
+ - **macOS/Linux**: System keychain (via `keytar`)
336
+ - **Fallback**: Encrypted file in `~/.docyrus/` (the name from before the Kiva rename, so existing sign-ins keep working)
337
+
338
+ ## License
339
+
340
+ MIT