@naseej/blox 1.6.2 → 1.7.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/dist/run.js +318 -198
- package/package.json +5 -2
- package/readme.md +235 -178
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naseej/blox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "blox cli",
|
|
5
5
|
"bin": {
|
|
6
6
|
"blox": "./bin/run"
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"lint:stage": "yarn lint -- -c .eslintrc.staging.cjs",
|
|
29
29
|
"watch": "tsc --watch",
|
|
30
30
|
"type-check": "tsc --noEmit",
|
|
31
|
+
"generate:schema": "tsx --tsconfig tsconfig.scripts.json scripts/generate-schema.ts",
|
|
32
|
+
"check:schema": "tsx --tsconfig tsconfig.scripts.json scripts/check-schema.ts",
|
|
31
33
|
"prepare": "husky",
|
|
32
34
|
"postinstall": "patch-package"
|
|
33
35
|
},
|
|
@@ -80,6 +82,7 @@
|
|
|
80
82
|
"klaw": "^4.1.0",
|
|
81
83
|
"lodash": "^4.17.21",
|
|
82
84
|
"ms": "2.1.3",
|
|
83
|
-
"semver": "^7.7.4"
|
|
85
|
+
"semver": "^7.7.4",
|
|
86
|
+
"zod": "^4.4.3"
|
|
84
87
|
}
|
|
85
88
|
}
|
package/readme.md
CHANGED
|
@@ -1,284 +1,341 @@
|
|
|
1
1
|
# BLOX CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
BLOX CLI helps you bootstrap, manage, update, and contribute BLOX-based apps and blocks.
|
|
4
|
+
|
|
5
|
+
## Content
|
|
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)
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
Install globally with npm:
|
|
4
37
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
38
|
+
```sh
|
|
39
|
+
npm install -g patch-package @naseej/blox
|
|
40
|
+
```
|
|
8
41
|
|
|
9
|
-
|
|
42
|
+
Notes:
|
|
10
43
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```
|
|
44
|
+
- Ensure npm is available in your `PATH`.
|
|
45
|
+
- Use minimal mode (`-m`, `--minimal`) if spinners interfere with interactive input.
|
|
14
46
|
|
|
15
|
-
|
|
47
|
+
## Quick Start
|
|
16
48
|
|
|
17
|
-
|
|
49
|
+
Start with the core commands:
|
|
18
50
|
|
|
19
51
|
```sh
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
BLOX CLI
|
|
25
|
-
|
|
26
|
-
Commands:
|
|
27
|
-
blox init Init new app [alias: i]
|
|
28
|
-
blox add Add block to app [alias: a]
|
|
29
|
-
blox remove Remove block from app [alias: rm]
|
|
30
|
-
blox update Update app/block [alias: u]
|
|
31
|
-
blox contribute Contribute changes to template/base/block repos [alias: cb]
|
|
32
|
-
blox conf Set blox global config [alias: c]
|
|
33
|
-
blox upgrade Upgrade blox cli to latest version
|
|
34
|
-
blox migrate Migrate blox schema
|
|
35
|
-
blox detach Detach to base
|
|
36
|
-
blox skills Install and manage BLOX CLI skills (wraps npx skills)
|
|
37
|
-
|
|
38
|
-
Options:
|
|
39
|
-
-V, --version Show version number [boolean]
|
|
40
|
-
-h, --help Show help [boolean]
|
|
41
|
-
-d, --debug Works in debug mode [boolean]
|
|
42
|
-
-m, --minimal Works in minimal mode [boolean]
|
|
52
|
+
blox --help
|
|
53
|
+
blox init
|
|
54
|
+
blox add
|
|
55
|
+
blox update
|
|
43
56
|
```
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
## Commands
|
|
46
59
|
|
|
47
|
-
|
|
60
|
+
Other available command:
|
|
48
61
|
|
|
49
|
-
-
|
|
50
|
-
- [add](#add)
|
|
51
|
-
- [remove](#remove)
|
|
52
|
-
- [update](#update)
|
|
53
|
-
- [contribute](#contribute)
|
|
54
|
-
- [conf](#conf)
|
|
55
|
-
- [upgrade](#upgrade)
|
|
56
|
-
- [migrate](#migrate)
|
|
57
|
-
- [skills](#installing-blox-cli-skills)
|
|
62
|
+
- `blox detach`: detach to base
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
### init
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
Initialize a new app.
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
Usage:
|
|
64
69
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
"project": {
|
|
68
|
-
"ignore": ["applet-core", "dist/**", "*.generated.ts"]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
70
|
+
```sh
|
|
71
|
+
blox init
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Important options:
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
- `-n, --name`: app name
|
|
77
|
+
- `-t, --template`: template to use
|
|
78
|
+
- `--branch`: branch name to use
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
- `project.ignore`: local to your app (you control it).
|
|
80
|
+
### add
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
Add one or more blocks to an app.
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
- local project ignore (`project.ignore` in your local `.blox`)
|
|
84
|
-
- local `.gitignore`
|
|
85
|
-
- command option `--ignore` (when provided)
|
|
84
|
+
Usage:
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
```sh
|
|
87
|
+
blox add [blocks]
|
|
88
|
+
```
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Example:
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
```sh
|
|
93
|
+
blox add components applet-template
|
|
94
|
+
```
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
- each **block** (`blocks/<name>/.blox`)
|
|
96
|
+
Important options:
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
- `--branch`: branch name (applies to all selected blocks)
|
|
99
|
+
- `--dest`: destination directory (applies to all selected blocks)
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
Important notes:
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| `init` | Runs after`blox init` finishes creating the app. | Runs after a new block is cloned and initialized, before its dependencies are added. |
|
|
105
|
-
| `add` | Runs once per `blox add` command, but only if at least one new block was added (including dependencies). | Runs when the block is added , right after the `init` hook for that new block, still before dependencies. |
|
|
106
|
-
| `update` | After `blox update` when the **root template** or a **base** or a **block** remote actually advanced (new commit applied). | Only when that block’s remote actually advanced (new commit). Skipped if already up to date. |
|
|
107
|
-
| `remove` | After `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
|
|
103
|
+
- If `blocks` are omitted, BLOX prompts with a multiselect from available blocks.
|
|
104
|
+
- Blocks are processed sequentially in the order provided.
|
|
108
105
|
|
|
109
|
-
|
|
106
|
+
### remove
|
|
110
107
|
|
|
111
|
-
|
|
112
|
-
blox init --help
|
|
113
|
-
```
|
|
108
|
+
Remove one or more installed blocks.
|
|
114
109
|
|
|
115
|
-
|
|
116
|
-
blox init
|
|
110
|
+
Usage:
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Options:
|
|
121
|
-
-n, --name App name
|
|
122
|
-
-t, --template Template to use
|
|
123
|
-
--branch, branch name to use
|
|
112
|
+
```sh
|
|
113
|
+
blox remove [blocks]
|
|
124
114
|
```
|
|
125
115
|
|
|
126
|
-
|
|
116
|
+
Example:
|
|
127
117
|
|
|
128
118
|
```sh
|
|
129
|
-
|
|
119
|
+
blox remove components applet-template
|
|
130
120
|
```
|
|
131
121
|
|
|
132
|
-
|
|
133
|
-
blox add [blocks]
|
|
122
|
+
Important options:
|
|
134
123
|
|
|
135
|
-
|
|
124
|
+
- `-f, --force`: remove even when other blocks depend on them
|
|
136
125
|
|
|
137
|
-
|
|
138
|
-
blocks Block names separated by space (optional; if omitted, prompts with multiselect from available blocks)
|
|
126
|
+
Important notes:
|
|
139
127
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
- You can add multiple blocks in one command, for example: `blox add components applet-template`.
|
|
128
|
+
- If `blocks` are omitted, BLOX prompts with a multiselect from installed blocks.
|
|
129
|
+
- You can pass registry keys or installed folder names under `blocks/`.
|
|
130
|
+
- Only directories under `blocks/` containing a valid `.blox` file are treated as removable blocks.
|
|
146
131
|
- Blocks are processed sequentially in the order provided.
|
|
147
132
|
|
|
148
|
-
|
|
133
|
+
### update
|
|
134
|
+
|
|
135
|
+
Update the app, bases, or specific blocks.
|
|
136
|
+
|
|
137
|
+
Usage:
|
|
149
138
|
|
|
150
139
|
```sh
|
|
151
|
-
|
|
140
|
+
blox update
|
|
152
141
|
```
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
blox remove [blocks]
|
|
143
|
+
Important options:
|
|
156
144
|
|
|
157
|
-
|
|
145
|
+
- `-s, --scope`: `app`, `bases`, `block`, or `all` (default: `all`)
|
|
146
|
+
- `-b, --block`: block to update (valid only when `--scope block`)
|
|
158
147
|
|
|
159
|
-
|
|
160
|
-
blocks Blocks to remove separated by space — registry keys or installed folder names under blocks/ (optional; prompts with multiselect from installed blocks)
|
|
148
|
+
Important notes:
|
|
161
149
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```
|
|
150
|
+
- You may need to resolve merge conflicts.
|
|
151
|
+
- If a template, base, or block is missing from the registry, BLOX prompts you to continue or stop.
|
|
165
152
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
153
|
+
### contribute
|
|
154
|
+
|
|
155
|
+
Contribute app changes back to template/base/block repositories.
|
|
169
156
|
|
|
170
|
-
|
|
157
|
+
Usage:
|
|
171
158
|
|
|
172
159
|
```sh
|
|
173
|
-
|
|
160
|
+
blox contribute
|
|
174
161
|
```
|
|
175
162
|
|
|
176
|
-
|
|
177
|
-
blox update
|
|
163
|
+
Important options:
|
|
178
164
|
|
|
179
|
-
|
|
165
|
+
- `--existing`: add changes to an existing contribution branch
|
|
166
|
+
- `--title <title>`: contribution title
|
|
167
|
+
- `--description <text>`: contribution description
|
|
168
|
+
- `--commits <commits>`: comma-separated commit hashes from the app repo
|
|
169
|
+
- `--force`: bypass safety pre-flight checks
|
|
170
|
+
- `--type <type>`: target type (`template`, `base`, or `block`)
|
|
171
|
+
- `--name <name>`: target name (used with `--type`)
|
|
180
172
|
|
|
181
|
-
|
|
182
|
-
-s, --scope Scope of update [choices: "app", "bases", "block", "all"] [default: "all"]
|
|
183
|
-
-b, --block Block to update, valid only with scope block
|
|
184
|
-
```
|
|
173
|
+
### conf
|
|
185
174
|
|
|
186
|
-
|
|
175
|
+
Set global BLOX configuration.
|
|
187
176
|
|
|
188
|
-
|
|
177
|
+
Usage:
|
|
189
178
|
|
|
190
179
|
```sh
|
|
191
|
-
|
|
180
|
+
blox conf
|
|
192
181
|
```
|
|
193
182
|
|
|
194
|
-
|
|
195
|
-
blox contribute
|
|
183
|
+
Important options:
|
|
196
184
|
|
|
197
|
-
|
|
185
|
+
- `-r, --registries`: remote registry URLs
|
|
198
186
|
|
|
199
|
-
|
|
200
|
-
--existing Add changes to an existing contribution branch
|
|
201
|
-
--title <title> Contribution title
|
|
202
|
-
--description <text> Contribution description
|
|
203
|
-
--commits <commits> Comma-separated commit hashes from the app repo
|
|
204
|
-
--force Bypass safety pre-flight checks
|
|
205
|
-
--type <type> Target: template | base | block
|
|
206
|
-
--name <name> Target name (with --type)
|
|
207
|
-
```
|
|
187
|
+
### upgrade
|
|
208
188
|
|
|
209
|
-
|
|
189
|
+
Upgrade BLOX CLI to the latest version.
|
|
210
190
|
|
|
211
|
-
|
|
212
|
-
blox sync --help
|
|
213
|
-
```
|
|
191
|
+
Usage:
|
|
214
192
|
|
|
193
|
+
```sh
|
|
194
|
+
blox upgrade
|
|
215
195
|
```
|
|
216
|
-
blox conf
|
|
217
196
|
|
|
218
|
-
|
|
197
|
+
### migrate
|
|
219
198
|
|
|
220
|
-
|
|
221
|
-
-r, --registries Remote registries urls
|
|
222
|
-
```
|
|
199
|
+
Migrate BLOX schema.
|
|
223
200
|
|
|
224
|
-
|
|
201
|
+
Usage:
|
|
225
202
|
|
|
226
203
|
```sh
|
|
227
|
-
|
|
204
|
+
blox migrate
|
|
228
205
|
```
|
|
229
206
|
|
|
230
|
-
|
|
231
|
-
blox upgrade
|
|
207
|
+
### skills
|
|
232
208
|
|
|
233
|
-
|
|
234
|
-
```
|
|
209
|
+
Install and manage BLOX CLI skills (wraps `npx skills`).
|
|
235
210
|
|
|
236
|
-
|
|
211
|
+
Usage:
|
|
237
212
|
|
|
238
213
|
```sh
|
|
239
|
-
|
|
214
|
+
blox skills <command> [options]
|
|
240
215
|
```
|
|
241
216
|
|
|
242
|
-
|
|
243
|
-
blox migrate
|
|
217
|
+
Important notes:
|
|
244
218
|
|
|
245
|
-
|
|
246
|
-
|
|
219
|
+
- BLOX clones the BLOX CLI skills repository, runs `npx skills` with your arguments, then cleans up.
|
|
220
|
+
- No repository URL is required.
|
|
247
221
|
|
|
248
|
-
##
|
|
222
|
+
## Features
|
|
249
223
|
|
|
250
|
-
|
|
224
|
+
### Ignore Policy
|
|
251
225
|
|
|
252
|
-
|
|
226
|
+
Ignore rules tell BLOX which files or paths to skip.
|
|
253
227
|
|
|
254
|
-
|
|
228
|
+
Template-level ignore:
|
|
255
229
|
|
|
256
|
-
|
|
230
|
+
- Defined in `definition.ignore`.
|
|
231
|
+
- Comes from template/block maintainers.
|
|
257
232
|
|
|
258
|
-
|
|
233
|
+
App-level ignore:
|
|
259
234
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
```
|
|
235
|
+
- Defined in `project.ignore`.
|
|
236
|
+
- Local to your app and controlled by you.
|
|
263
237
|
|
|
264
|
-
|
|
238
|
+
Example root `.blox` configuration:
|
|
265
239
|
|
|
266
|
-
```
|
|
267
|
-
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"project": {
|
|
243
|
+
"ignore": ["applet-core", "dist/**", "*.generated.ts"]
|
|
244
|
+
}
|
|
245
|
+
}
|
|
268
246
|
```
|
|
269
247
|
|
|
270
|
-
|
|
248
|
+
How ignore sources are combined:
|
|
249
|
+
|
|
250
|
+
- `blox update` combines patterns from:
|
|
251
|
+
- remote template ignore (`definition.ignore`)
|
|
252
|
+
- local project ignore (`project.ignore` in local `.blox`)
|
|
253
|
+
- local `.gitignore`
|
|
254
|
+
- command option `--ignore` (when provided)
|
|
255
|
+
- `blox contribute` also respects local `project.ignore`.
|
|
256
|
+
- Local `project.ignore` is project-owned and is not replaced by remote template ignore during update.
|
|
257
|
+
|
|
258
|
+
### Lifecycle Hooks
|
|
259
|
+
|
|
260
|
+
Lifecycle hooks are optional shell commands defined in `.blox` files.
|
|
261
|
+
|
|
262
|
+
Where hooks can be defined:
|
|
263
|
+
|
|
264
|
+
- Root template: `.blox` at app root
|
|
265
|
+
- Each block: `blocks/<name>/.blox`
|
|
266
|
+
|
|
267
|
+
Supported hooks:
|
|
268
|
+
|
|
269
|
+
- `init`
|
|
270
|
+
- `add`
|
|
271
|
+
- `update`
|
|
272
|
+
- `remove`
|
|
273
|
+
|
|
274
|
+
When hooks run:
|
|
275
|
+
|
|
276
|
+
| Hook | Template (root `.blox`) | Block (`blocks/.../.blox`) |
|
|
277
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
|
278
|
+
| `init` | Runs after `blox init` finishes creating the app. | Runs after a new block is cloned and initialized, before its dependencies are added. |
|
|
279
|
+
| `add` | Runs once per `blox add` command, only if at least one new block was added (including dependencies). | Runs when the block is added, right after that new block's `init` hook, still before dependencies. |
|
|
280
|
+
| `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
|
+
| `remove` | Runs after `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
|
|
282
|
+
|
|
283
|
+
### Skills
|
|
284
|
+
|
|
285
|
+
#### Installing Skills
|
|
286
|
+
|
|
287
|
+
Use `blox skills` to run the Skills CLI against the BLOX CLI skills repository.
|
|
288
|
+
|
|
289
|
+
Behavior:
|
|
290
|
+
|
|
291
|
+
- BLOX executes `npx skills` with all arguments passed after `skills`.
|
|
292
|
+
- BLOX handles cloning and cleanup automatically.
|
|
293
|
+
|
|
294
|
+
#### CLI Compatibility
|
|
295
|
+
|
|
296
|
+
Skills declare a `cliCompatibility` range in `skill.json` (npm semver).
|
|
297
|
+
|
|
298
|
+
For `blox skills add` and `blox skills update`:
|
|
299
|
+
|
|
300
|
+
- BLOX checks whether your installed CLI version satisfies the required range.
|
|
301
|
+
- If not, BLOX shows the required range and your current version.
|
|
302
|
+
- You can choose to continue or exit and run `blox upgrade` first.
|
|
303
|
+
|
|
304
|
+
#### Common Commands
|
|
271
305
|
|
|
272
306
|
```bash
|
|
307
|
+
blox skills add
|
|
308
|
+
blox skills add -a cursor -y
|
|
273
309
|
blox skills add -a cursor -a claude-code -y
|
|
310
|
+
blox skills list
|
|
274
311
|
```
|
|
275
312
|
|
|
276
|
-
|
|
313
|
+
#### Compatibility
|
|
277
314
|
|
|
278
|
-
|
|
279
|
-
|
|
315
|
+
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
|
+
|
|
317
|
+
### Create new template
|
|
318
|
+
|
|
319
|
+
Create a new template by starting from an existing one, updating its metadata, then publishing it.
|
|
320
|
+
|
|
321
|
+
#### 1 - Initialize from an existing template
|
|
322
|
+
|
|
323
|
+
Create a new project using the template you want to build on.
|
|
324
|
+
|
|
325
|
+
Example:
|
|
326
|
+
|
|
327
|
+
```sh
|
|
328
|
+
blox init -n my-template -t existing-template
|
|
280
329
|
```
|
|
281
330
|
|
|
282
|
-
|
|
331
|
+
#### 2 - Update `.blox` configuration
|
|
332
|
+
|
|
333
|
+
Edit your project's `.blox` file to describe the new template.
|
|
334
|
+
|
|
335
|
+
- Set `definition.name` to your new template name.
|
|
336
|
+
- Keep the original template in the `bases` list so you can continue receiving updates from it.
|
|
337
|
+
|
|
338
|
+
#### 3 - Publish and register the template
|
|
283
339
|
|
|
284
|
-
|
|
340
|
+
- Push the template project to a remote repository.
|
|
341
|
+
- Add that repository to a BLOX registry (Or any custom registry) so BLOX CLI can discover and use your template.
|