@naseej/blox 1.5.0 → 1.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naseej/blox",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "blox cli",
5
5
  "bin": {
6
6
  "blox": "./bin/run"
@@ -21,8 +21,8 @@
21
21
  "compile": "tsc",
22
22
  "start": "tsx ./bin/run.ts",
23
23
  "start:node": "node ./bin/run",
24
- "test": "vitest run",
25
- "test:watch": "vitest",
24
+ "test": "playwright test",
25
+ "test:watch": "playwright test --ui",
26
26
  "lint": "eslint \"*/**/*.{js,ts,tsx}\" --quiet --fix",
27
27
  "lint:fix": "eslint \"*/**/*.{js,ts,tsx}\" --fix",
28
28
  "lint:stage": "yarn lint -- -c .eslintrc.staging.cjs",
@@ -32,6 +32,7 @@
32
32
  "postinstall": "patch-package"
33
33
  },
34
34
  "devDependencies": {
35
+ "@playwright/test": "^1.59.1",
35
36
  "@tsconfig/node20": "^20.1.4",
36
37
  "@types/cross-spawn": "^6.0.6",
37
38
  "@types/ejs": "3.1.5",
@@ -41,6 +42,7 @@
41
42
  "@types/ms": "0.7.34",
42
43
  "@types/node": "^20.12.12",
43
44
  "@types/prompts": "^2.4.9",
45
+ "@types/semver": "^7.7.1",
44
46
  "@types/signale": "^1.4.7",
45
47
  "@types/yargs": "^17.0.32",
46
48
  "@typescript-eslint/eslint-plugin": "^8.17.0",
@@ -52,8 +54,10 @@
52
54
  "eslint-plugin-import": "^2.29.1",
53
55
  "eslint-plugin-prettier": "^5.1.3",
54
56
  "eslint-plugin-react": "^7.34.1",
55
- "eslint-plugin-unused-imports": "^3.2.0",
57
+ "eslint-plugin-unused-imports": "^4.1.4",
58
+ "execa": "^9.6.1",
56
59
  "husky": "^9.1.7",
60
+ "node-pty": "^1.1.0",
57
61
  "patch-package": "^8.0.0",
58
62
  "prettier": "^3.2.5",
59
63
  "tsup": "^8.0.2",
@@ -75,6 +79,7 @@
75
79
  "ignore": "^7.0.5",
76
80
  "klaw": "^4.1.0",
77
81
  "lodash": "^4.17.21",
78
- "ms": "2.1.3"
82
+ "ms": "2.1.3",
83
+ "semver": "^7.7.4"
79
84
  }
80
85
  }
package/readme.md CHANGED
@@ -1,9 +1,4 @@
1
- #
2
- ![logo](./assets/blox.png)
3
-
4
- ### Introduction and Goals
5
-
6
- BLOX is started kit built to speed Medad Product development by providing prebuild blocks of code that can be added with all its provided functionalities in one cli command.
1
+ # BLOX CLI
7
2
 
8
3
  ### Prerequisites
9
4
 
@@ -17,7 +12,7 @@ It can have many way to be installed, mainly as global npm package
17
12
  npm install -g patch-package @naseej/blox
18
13
  ```
19
14
 
20
- * make sure npm is already in you $Path to be able to use blox globally
15
+ - make sure npm is already in you $Path to be able to use blox globally
21
16
 
22
17
  ### Usage
23
18
 
@@ -31,11 +26,14 @@ BLOX CLI
31
26
  Commands:
32
27
  blox init Init new app [alias: i]
33
28
  blox add Add block to app [alias: a]
29
+ blox remove Remove block from app [alias: rm]
34
30
  blox update Update app/block [alias: u]
31
+ blox contribute Contribute changes to template/base/block repos [alias: cb]
35
32
  blox conf Set blox global config [alias: c]
36
33
  blox upgrade Upgrade blox cli to latest version
37
34
  blox migrate Migrate blox schema
38
35
  blox detach Detach to base
36
+ blox skills Install and manage BLOX CLI skills (wraps npx skills)
39
37
 
40
38
  Options:
41
39
  -V, --version Show version number [boolean]
@@ -44,16 +42,38 @@ Options:
44
42
  -m, --minimal Works in minimal mode [boolean]
45
43
  ```
46
44
 
47
- * Use minimal mode if spinners are getting in the way of needed input for example.
45
+ - Use minimal mode if spinners are getting in the way of needed input for example.
48
46
 
49
47
  ### Available commands
50
48
 
51
- * [init](#init)
52
- * [add](#add)
53
- * [update](#update)
54
- * [conf](#conf)
55
- * [upgrade](#upgrade)
56
- * [migrate](#migrate)
49
+ - [init](#init)
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)
58
+
59
+ ## Lifecycle hooks
60
+
61
+ Lifecycle hooks are **optional shell commands** defined in `.blox` files.
62
+ They can exist in:
63
+
64
+ - the **root template** (`.blox` at app root)
65
+ - each **block** (`blocks/<name>/.blox`)
66
+
67
+ hooks names: `init`, `add`, `update`, `remove`.
68
+
69
+ **When they run**
70
+
71
+ | Hook | Template (root `.blox`) | Block (`blocks/.../.blox`) |
72
+ | -------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
73
+ | `init` | Runs after`blox init` finishes creating the app. | Runs after a new block is cloned and initialized, before its dependencies are added. |
74
+ | `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. |
75
+ | `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. |
76
+ | `remove` | After `blox remove` actually removed a block in that run. | Runs before the block is deleted, while its files still exist. |
57
77
 
58
78
  #### init
59
79
 
@@ -66,7 +86,7 @@ blox init
66
86
 
67
87
  Init new app
68
88
 
69
- Options:
89
+ Options:
70
90
  -n, --name App name
71
91
  -t, --template Template to use
72
92
  --branch, branch name to use
@@ -79,18 +99,43 @@ Options:
79
99
  ```
80
100
 
81
101
  ```
82
- blox add [block]
102
+ blox add [blocks]
83
103
 
84
104
  Add block to app
85
105
 
86
106
  Params:
87
- block Block name (Optional)
88
-
89
- Options:
90
- --branch, branch name to use
91
- --dest, destination dir
107
+ blocks Block names separated by space (optional; if omitted, prompts with multiselect from available blocks)
108
+
109
+ Options:
110
+ --branch, branch name to use (applies to all selected blocks)
111
+ --dest, destination dir (applies to all selected blocks)
92
112
  ```
93
113
 
114
+ - You can add multiple blocks in one command, for example: `blox add components applet-template`.
115
+ - Blocks are processed sequentially in the order provided.
116
+
117
+ #### remove
118
+
119
+ ```sh
120
+ blox remove --help
121
+ ```
122
+
123
+ ```
124
+ blox remove [blocks]
125
+
126
+ Remove block from app
127
+
128
+ Params:
129
+ blocks Blocks to remove separated by space — registry keys or installed folder names under blocks/ (optional; prompts with multiselect from installed blocks)
130
+
131
+ Options:
132
+ -f, --force Remove even if other blocks declare a dependency on them (global for all selected blocks; skips dependency guard and post-remove version compatibility check)
133
+ ```
134
+
135
+ - Only directories under `blocks/` that contain a valid `.blox` file are treated as removable blocks; other folders are ignored for selection and removal.
136
+ - You can remove multiple blocks in one command, for example: `blox remove components applet-template`.
137
+ - Blocks are processed sequentially in the order provided.
138
+
94
139
  #### update
95
140
 
96
141
  ```sh
@@ -107,7 +152,28 @@ Options:
107
152
  -b, --block Block to update, valid only with scope block
108
153
  ```
109
154
 
110
- * Note: you may need to resolve merge conflicts if found
155
+ - Note: you may need to resolve merge conflicts if found
156
+
157
+ #### contribute
158
+
159
+ ```sh
160
+ blox contribute --help
161
+ ```
162
+
163
+ ```
164
+ blox contribute
165
+
166
+ Contribute changes back to template/base/block repositories
167
+
168
+ Options:
169
+ --existing Add changes to an existing contribution branch
170
+ --title <title> Contribution title
171
+ --description <text> Contribution description
172
+ --commits <commits> Comma-separated commit hashes from the app repo
173
+ --force Bypass safety pre-flight checks
174
+ --type <type> Target: template | base | block
175
+ --name <name> Target name (with --type)
176
+ ```
111
177
 
112
178
  #### conf
113
179
 
@@ -135,6 +201,7 @@ blox upgrade
135
201
 
136
202
  Upgrade blox cli to latest version
137
203
  ```
204
+
138
205
  #### migrate
139
206
 
140
207
  ```sh
@@ -147,6 +214,40 @@ blox migrate
147
214
  Migrate blox schema
148
215
  ```
149
216
 
150
- ### Docs
217
+ ## Installing Blox CLI Skills
218
+
219
+ Use **`blox skills`** to run the [Skills CLI](https://github.com/vercel-labs/skills) against the **BLOX CLI skills repository**. No repo URL needed, BLOX clones the repo, executes `npx skills` with your arguments, then cleans up. Anything you pass after `skills` works the same as with `npx skills`.
220
+
221
+ ### CLI version compatibility
222
+
223
+ Skills declare a **`cliCompatibility`** range in `skill.json` (npm semver range). For **`blox skills add`** and **`blox skills update`**, BLOX checks that your installed CLI version satisfies that range before running `npx skills`. If it does not, you’ll see a warning with the required range and your current version, then a **Yes / No** prompt: continue anyway, or exit and run **`blox upgrade`** first.
224
+
225
+ ### Common commands
226
+
227
+ Add skills :
228
+
229
+ ```bash
230
+ blox skills add
231
+ ```
232
+
233
+ Install to **Cursor** only, skipping prompts where supported:
234
+
235
+ ```bash
236
+ blox skills add -a cursor -y
237
+ ```
238
+
239
+ Install to **several** agents at once:
240
+
241
+ ```bash
242
+ blox skills add -a cursor -a claude-code -y
243
+ ```
244
+
245
+ List skills already installed (project and global):
246
+
247
+ ```bash
248
+ blox skills list
249
+ ```
250
+
251
+ ## Compatibility
151
252
 
152
- - [Design](./docs/design.md)
253
+ These skills are **not tied to a specific editor or product**. They work across tools that support skill-style instructions. Metadata marks agents as `generic` for broad use.