@naseej/blox 1.7.0 → 1.9.0

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
@@ -4,32 +4,7 @@ BLOX CLI helps you bootstrap, manage, update, and contribute BLOX-based apps and
4
4
 
5
5
  ## Content
6
6
 
7
- - [BLOX CLI](#blox-cli)
8
- - [Content](#content)
9
- - [Installation](#installation)
10
- - [Quick Start](#quick-start)
11
- - [Commands](#commands)
12
- - [init](#init)
13
- - [add](#add)
14
- - [remove](#remove)
15
- - [update](#update)
16
- - [contribute](#contribute)
17
- - [conf](#conf)
18
- - [upgrade](#upgrade)
19
- - [migrate](#migrate)
20
- - [skills](#skills)
21
- - [Features](#features)
22
- - [Ignore Policy](#ignore-policy)
23
- - [Lifecycle Hooks](#lifecycle-hooks)
24
- - [Skills](#skills-1)
25
- - [Installing Skills](#installing-skills)
26
- - [CLI Compatibility](#cli-compatibility)
27
- - [Common Commands](#common-commands)
28
- - [Compatibility](#compatibility)
29
- - [Create new template](#create-new-template)
30
- - [1 - Initialize from an existing template](#1---initialize-from-an-existing-template)
31
- - [2 - Update `.blox` configuration](#2---update-blox-configuration)
32
- - [3 - Publish and register the template](#3---publish-and-register-the-template)
7
+ [[_TOC_]]
33
8
 
34
9
  ## Installation
35
10
 
@@ -52,14 +27,29 @@ Start with the core commands:
52
27
  blox --help
53
28
  blox init
54
29
  blox add
30
+ blox remove
55
31
  blox update
56
32
  ```
57
33
 
34
+ Global flags:
35
+
36
+ - `-d, --debug`: enable debug mode
37
+ - `-m, --minimal`: reduce interactive or spinner-heavy output
38
+
58
39
  ## Commands
59
40
 
60
- Other available command:
41
+ Available commands:
61
42
 
62
- - `blox detach`: detach to base
43
+ - `blox init`: initialize a new app
44
+ - `blox add`: add one or more blocks
45
+ - `blox remove`: remove one or more installed blocks
46
+ - `blox update`: update the app, bases, or blocks
47
+ - `blox conf`: set global BLOX configuration
48
+ - `blox contribute`: contribute changes back to template, base, or block repositories
49
+ - `blox detach`: detach the app definition to one of its bases
50
+ - `blox migrate`: migrate BLOX schema state
51
+ - `blox upgrade`: upgrade BLOX CLI
52
+ - `blox skills`: run BLOX CLI skills commands
63
53
 
64
54
  ### init
65
55
 
@@ -101,7 +91,12 @@ Important options:
101
91
  Important notes:
102
92
 
103
93
  - If `blocks` are omitted, BLOX prompts with a multiselect from available blocks.
94
+ - Installed blocks are marked in the list and skipped if selected again, including blocks installed under a custom destination.
104
95
  - Blocks are processed sequentially in the order provided.
96
+ - A failed block does not stop the remaining selections or roll back successful additions.
97
+ - If a block hook fails, BLOX displays its error and output and asks whether to continue with a warning or abort that block (the default).
98
+ - Aborted additions remove newly created project files and restore `.blox` metadata. Pre-existing files, shared `.git` and `node_modules` directories, and completed dependencies are preserved. Other edits made by hooks to pre-existing files are not reverted; review those manually.
99
+ - A final summary lists additions, warnings, skipped blocks, and failures. Any failed block causes a non-zero exit code; accepted hook warnings alone do not.
105
100
 
106
101
  ### remove
107
102
 
@@ -144,6 +139,8 @@ Important options:
144
139
 
145
140
  - `-s, --scope`: `app`, `bases`, `block`, or `all` (default: `all`)
146
141
  - `-b, --block`: block to update (valid only when `--scope block`)
142
+ - `--ignore <list...>`: ignore patterns scoped by repo name, for example `repo:file`
143
+ - `--hard`: overwrite local changes during update
147
144
 
148
145
  Important notes:
149
146
 
@@ -170,6 +167,12 @@ Important options:
170
167
  - `--type <type>`: target type (`template`, `base`, or `block`)
171
168
  - `--name <name>`: target name (used with `--type`)
172
169
 
170
+ Important notes:
171
+
172
+ - Without a matching `--type` and `--name`, BLOX lets you select one or more available targets. Press `s` in the target list to search.
173
+ - When both flags match a discovered target, BLOX skips target selection. If the match is not found or only one flag is provided, BLOX warns and shows the available targets.
174
+ - If a selected target has no registry source, BLOX reports it as skipped and continues with the remaining targets.
175
+
173
176
  ### conf
174
177
 
175
178
  Set global BLOX configuration.
@@ -184,6 +187,20 @@ Important options:
184
187
 
185
188
  - `-r, --registries`: remote registry URLs
186
189
 
190
+ ### detach
191
+
192
+ Detach the app definition to one of its configured bases.
193
+
194
+ Usage:
195
+
196
+ ```sh
197
+ blox detach
198
+ ```
199
+
200
+ Important options:
201
+
202
+ - `--basic`: run detach only, without registry sync and migration first
203
+
187
204
  ### upgrade
188
205
 
189
206
  Upgrade BLOX CLI to the latest version.
@@ -216,8 +233,8 @@ blox skills <command> [options]
216
233
 
217
234
  Important notes:
218
235
 
219
- - BLOX clones the BLOX CLI skills repository, runs `npx skills` with your arguments, then cleans up.
220
- - No repository URL is required.
236
+ - For `blox skills add`, BLOX injects the BLOX skills repository URL when you do not provide one.
237
+ - BLOX forwards the remaining arguments to `npx skills`.
221
238
 
222
239
  ## Features
223
240
 
@@ -280,6 +297,34 @@ When hooks run:
280
297
  | `update` | Runs after `blox update` when the root template, a base, or a block remote actually advanced (new commit applied). | Runs only when that block's remote actually advanced (new commit). Skipped if already up to date. |
281
298
  | `remove` | Runs after `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
282
299
 
300
+ ### Blox SDK
301
+
302
+ Use the SDK when a template needs custom interactive behavior and you can run it inside lifecycle hooks.
303
+
304
+ Install in the template project:
305
+
306
+ ```sh
307
+ npm install -D @naseej/blox
308
+ ```
309
+
310
+ Import only from the SDK subpath:
311
+
312
+ ```ts
313
+ import { input } from '@naseej/blox/sdk';
314
+ ```
315
+
316
+ SDK API reference:
317
+
318
+ | Category | API | Notes |
319
+ | --------------- | --------------------------------------------------------- | ----------------------------------------------------- |
320
+ | Prompts | `input`, `confirm`, `select`, `multiSelect` | Interactive CLI prompts. |
321
+ | Logging | `log.info`, `log.success`, `log.warn`, `log.error` | Consistent BLOX output formatting. |
322
+ | Spinner | `spinner().start`, `spinner().message`, `spinner().stop` | Existing spinner API remains stable. |
323
+ | Spinner aliases | `spinner().success`, `spinner().fail`, `spinner().finish` | Semantic aliases for completion states. |
324
+ | Filesystem | `exists`, `mkdir`, `copy`, `move`, `remove` | Thin cross-platform file helpers. |
325
+ | JSON | `readJson`, `writeJson`, `updateJson` | Stable JSON read/write plus read-modify-write helper. |
326
+ | Process/path | `exec`, `join`, `resolve` | Shell execution and path helpers. |
327
+
283
328
  ### Skills
284
329
 
285
330
  #### Installing Skills
@@ -289,7 +334,7 @@ Use `blox skills` to run the Skills CLI against the BLOX CLI skills repository.
289
334
  Behavior:
290
335
 
291
336
  - BLOX executes `npx skills` with all arguments passed after `skills`.
292
- - BLOX handles cloning and cleanup automatically.
337
+ - For `add` commands, BLOX injects the BLOX skills repository URL when the source argument is omitted.
293
338
 
294
339
  #### CLI Compatibility
295
340
 
@@ -314,11 +359,11 @@ blox skills list
314
359
 
315
360
  Skills are not tied to a specific editor or product. They work across tools that support skill-style instructions, and metadata marks agents as `generic` for broad use.
316
361
 
317
- ### Create new template
362
+ ## Create new template
318
363
 
319
364
  Create a new template by starting from an existing one, updating its metadata, then publishing it.
320
365
 
321
- #### 1 - Initialize from an existing template
366
+ ### 1 - Initialize from an existing template
322
367
 
323
368
  Create a new project using the template you want to build on.
324
369
 
@@ -328,14 +373,14 @@ Example:
328
373
  blox init -n my-template -t existing-template
329
374
  ```
330
375
 
331
- #### 2 - Update `.blox` configuration
376
+ ### 2 - Update `.blox` configuration
332
377
 
333
378
  Edit your project's `.blox` file to describe the new template.
334
379
 
335
380
  - Set `definition.name` to your new template name.
336
381
  - Keep the original template in the `bases` list so you can continue receiving updates from it.
337
382
 
338
- #### 3 - Publish and register the template
383
+ ### 3 - Publish and register the template
339
384
 
340
385
  - Push the template project to a remote repository.
341
386
  - Add that repository to a BLOX registry (Or any custom registry) so BLOX CLI can discover and use your template.