You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/skills/runly/SKILL.md
+30-11Lines changed: 30 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,17 @@ name: runly
3
3
description: >-
4
4
Runs the same Node.js command under multiple Node versions from one config file
5
5
(runly.config.mjs/js/cjs), resolving each runtime via npx and the npm `node`
6
-
package. Use when the user mentions Runly, @hamdymohamedak/runly, multi-version
7
-
Node testing, Node matrix in CI, runly.config, or running tests across Node 18/20/22.
6
+
package. Use `runly init` to scaffold config and npm script; use `loadConfig()` in code.
7
+
Use when the user mentions Runly, @hamdymohamedak/runly, multi-version Node testing,
8
+
Node matrix in CI, runly.config, or running tests across Node 18/20/22.
8
9
---
9
10
10
11
# Runly
11
12
12
13
## What it is
13
14
14
15
-**npm package**: `@hamdymohamedak/runly` (scoped; unscoped name `runly` is blocked on npm as too similar to `runjs`).
15
-
-**CLI binary name**: `runly`(after `npm install`, use `npx runly` from the project root).
16
+
-**CLI binary name**: `runly`— use **`npx runly init`** once to create config + **`npm run runly`**, or **`npx runly`** for one-off runs.
16
17
-**Purpose**: For each entry in `versions`, resolve a real `node` binary for that spec, prepend its directory to `PATH`, then spawn the configured command so that command’s default `node` is that matrix version—without requiring nvm/fnm/asdf on the machine.
17
18
18
19
## Requirements
@@ -30,8 +31,25 @@ One-off without saving to `package.json`:
30
31
31
32
```bash
32
33
npx @hamdymohamedak/runly
34
+
npx @hamdymohamedak/runly init
33
35
```
34
36
37
+
## `runly init` (scaffold)
38
+
39
+
From the **project root** (after **`npm install -D @hamdymohamedak/runly`**):
40
+
41
+
```bash
42
+
npx runly init
43
+
```
44
+
45
+
- Creates **`runly.config.js`** only if none of **`runly.config.mjs`**, **`runly.config.js`**, or **`runly.config.cjs`** exists (otherwise prints a message and exits **0**).
46
+
- Writes **`SKILL.md`** in the project root when missing (Cursor agent skill template from the package); you may move it to **`.cursor/skills/runly/SKILL.md`**.
47
+
- Uses **`export default`** when **`package.json`** has **`"type": "module"`**, else **`module.exports`**.
48
+
- Adds **`"runly": "runly"`** under **`scripts`** in **`package.json`** when the file exists and **`scripts.runly`** is not already set.
49
+
- Default **`run`** in the scaffold is a small **`node -e`** smoke command; edit to **`node --test`**, **`npm test`**, etc.
50
+
51
+
Programmatic: **`initRunlyProject(cwd)`** from **`@hamdymohamedak/runly`**.
52
+
35
53
## Config file discovery
36
54
37
55
From **current working directory**, first file that exists:
@@ -40,7 +58,7 @@ From **current working directory**, first file that exists:
40
58
2.`runly.config.js`
41
59
3.`runly.config.cjs`
42
60
43
-
Override: `runly -c /path/to/config.mjs` or `runly --config /path/to/config.mjs`.
61
+
Override: `runly -c /path/to/config.mjs` or `runly --config /path/to/runly.config.mjs`.
44
62
45
63
Config must be **JavaScript** (ESM or CJS). Runly does **not** load `.ts` configs unless the user wires a loader themselves. Export **`default`** as the config object (or the module’s default export after dynamic `import()`).
Exported types: **`RunlyConfig`**, **`RunlyRun`**. The matrix runner **`runMatrix`**lives in source but is **not** part of the published `exports`—treat**`defineConfig` + types** as the library surface for dependents.
116
+
Exported types: **`RunlyConfig`**, **`RunlyRun`**. **`loadConfig(cwd?)`**loads the default config or throws with a hint to run**`npx runly init`**. The matrix runner **`runMatrix`** is not exported—use the CLI or compose from source.
99
117
100
118
## CLI
101
119
102
-
| Flag | Meaning |
103
-
|------|---------|
120
+
| Command / flag | Meaning |
121
+
|----------------|---------|
122
+
|`runly init`| Scaffold **`runly.config.js`**, **`SKILL.md`** (if missing), and **`scripts.runly`** (see above). |
123
+
|`runly`| Run matrix using config in cwd. |
104
124
|`-c`, `--config`| Path to config file. |
105
-
106
-
No other flags in the current CLI.
125
+
|`runly help`| Usage. |
107
126
108
127
## Exit codes
109
128
@@ -118,7 +137,7 @@ No other flags in the current CLI.
118
137
119
138
## CI
120
139
121
-
Install deps, `cd` to repo root (or set `cwd` in config), run `npx runly`. No global version manager required if `npx` can fetch the `node` package.
140
+
Install deps, `cd` to repo root, run **`npx runly init`** once if the repo has no config, then **`npm run runly`** or **`npx runly`**. No global version manager required if `npx` can fetch the `node` package.
122
141
123
142
## Limitations
124
143
@@ -129,7 +148,7 @@ Install deps, `cd` to repo root (or set `cwd` in config), run `npx runly`. No gl
-Working demo: [matrix-demo/](../../../matrix-demo/) (`npm install` + `npm run matrix` from that folder; uses `file:..` to depend on the parent package).
Copy file name to clipboardExpand all lines: .cursor/skills/runly/skill/SKILL.md
+31-12Lines changed: 31 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,17 @@ name: runly
3
3
description: >-
4
4
Runs the same Node.js command under multiple Node versions from one config file
5
5
(runly.config.mjs/js/cjs), resolving each runtime via npx and the npm `node`
6
-
package. Use when the user mentions Runly, @hamdymohamedak/runly, multi-version
7
-
Node testing, Node matrix in CI, runly.config, or running tests across Node 18/20/22.
6
+
package. Use `runly init` to scaffold config and npm script; use `loadConfig()` in code.
7
+
Use when the user mentions Runly, @hamdymohamedak/runly, multi-version Node testing,
8
+
Node matrix in CI, runly.config, or running tests across Node 18/20/22.
8
9
---
9
10
10
11
# Runly
11
12
12
13
## What it is
13
14
14
15
-**npm package**: `@hamdymohamedak/runly` (scoped; unscoped name `runly` is blocked on npm as too similar to `runjs`).
15
-
-**CLI binary name**: `runly`(after `npm install`, use `npx runly` from the project root).
16
+
-**CLI binary name**: `runly`— use **`npx runly init`** once to create config + **`npm run runly`**, or **`npx runly`** for one-off runs.
16
17
-**Purpose**: For each entry in `versions`, resolve a real `node` binary for that spec, prepend its directory to `PATH`, then spawn the configured command so that command’s default `node` is that matrix version—without requiring nvm/fnm/asdf on the machine.
17
18
18
19
## Requirements
@@ -30,8 +31,25 @@ One-off without saving to `package.json`:
30
31
31
32
```bash
32
33
npx @hamdymohamedak/runly
34
+
npx @hamdymohamedak/runly init
33
35
```
34
36
37
+
## `runly init` (scaffold)
38
+
39
+
From the **project root** (after **`npm install -D @hamdymohamedak/runly`**):
40
+
41
+
```bash
42
+
npx runly init
43
+
```
44
+
45
+
- Creates **`runly.config.js`** only if none of **`runly.config.mjs`**, **`runly.config.js`**, or **`runly.config.cjs`** exists (otherwise prints a message and exits **0**).
46
+
- Writes **`SKILL.md`** in the project root when missing (Cursor agent skill template from the package); you may move it to **`.cursor/skills/runly/SKILL.md`**.
47
+
- Uses **`export default`** when **`package.json`** has **`"type": "module"`**, else **`module.exports`**.
48
+
- Adds **`"runly": "runly"`** under **`scripts`** in **`package.json`** when the file exists and **`scripts.runly`** is not already set.
49
+
- Default **`run`** in the scaffold is a small **`node -e`** smoke command; edit to **`node --test`**, **`npm test`**, etc.
50
+
51
+
Programmatic: **`initRunlyProject(cwd)`** from **`@hamdymohamedak/runly`**.
52
+
35
53
## Config file discovery
36
54
37
55
From **current working directory**, first file that exists:
@@ -40,7 +58,7 @@ From **current working directory**, first file that exists:
40
58
2.`runly.config.js`
41
59
3.`runly.config.cjs`
42
60
43
-
Override: `runly -c /path/to/config.mjs` or `runly --config /path/to/config.mjs`.
61
+
Override: `runly -c /path/to/config.mjs` or `runly --config /path/to/runly.config.mjs`.
44
62
45
63
Config must be **JavaScript** (ESM or CJS). Runly does **not** load `.ts` configs unless the user wires a loader themselves. Export **`default`** as the config object (or the module’s default export after dynamic `import()`).
Exported types: **`RunlyConfig`**, **`RunlyRun`**. The matrix runner **`runMatrix`**lives in source but is **not** part of the published `exports`—treat**`defineConfig` + types** as the library surface for dependents.
116
+
Exported types: **`RunlyConfig`**, **`RunlyRun`**. **`loadConfig(cwd?)`**loads the default config or throws with a hint to run**`npx runly init`**. The matrix runner **`runMatrix`** is not exported—use the CLI or compose from source.
99
117
100
118
## CLI
101
119
102
-
| Flag | Meaning |
103
-
|------|---------|
120
+
| Command / flag | Meaning |
121
+
|----------------|---------|
122
+
|`runly init`| Scaffold **`runly.config.js`**, **`SKILL.md`** (if missing), and **`scripts.runly`** (see above). |
123
+
|`runly`| Run matrix using config in cwd. |
104
124
|`-c`, `--config`| Path to config file. |
105
-
106
-
No other flags in the current CLI.
125
+
|`runly help`| Usage. |
107
126
108
127
## Exit codes
109
128
@@ -118,7 +137,7 @@ No other flags in the current CLI.
118
137
119
138
## CI
120
139
121
-
Install deps, `cd` to repo root (or set `cwd` in config), run `npx runly`. No global version manager required if `npx` can fetch the `node` package.
140
+
Install deps, `cd` to repo root, run **`npx runly init`** once if the repo has no config, then **`npm run runly`** or **`npx runly`**. No global version manager required if `npx` can fetch the `node` package.
122
141
123
142
## Limitations
124
143
@@ -128,8 +147,8 @@ Install deps, `cd` to repo root (or set `cwd` in config), run `npx runly`. No gl
-Working demo: [matrix-demo/](../../../matrix-demo/) (`npm install` + `npm run matrix` from that folder; uses `file:..` to depend on the parent package).
The executable name is **`runly`** (see `bin` in `package.json`).
30
30
31
+
### First-time setup (`init`)
32
+
33
+
From your project root, create a default `runly.config.js`, a **`SKILL.md`** agent-skill template (when `SKILL.md` is not already present), and add an npm script **`runly`** when `package.json` exists:
34
+
35
+
```bash
36
+
npx runly init
37
+
```
38
+
39
+
If any of `runly.config.mjs`, `runly.config.js`, or `runly.config.cjs` already exists, `init` does nothing for the config (idempotent). Existing **`SKILL.md`** is never overwritten.
40
+
41
+
### Run the matrix
42
+
31
43
From the directory that contains your config:
32
44
33
45
```bash
34
46
npx runly
35
47
```
36
48
49
+
Or, after `init`:
50
+
51
+
```bash
52
+
npm run runly
53
+
```
54
+
37
55
Without adding a dev dependency:
38
56
39
57
```bash
40
58
npx @hamdymohamedak/runly
59
+
npx @hamdymohamedak/runly init # scaffold config in cwd
Exported types include `RunlyConfig` and `RunlyRun` for use in your own tooling.
136
+
Exported types include `RunlyConfig` and `RunlyRun`. **`loadConfig(cwd?)`** loads the first config file in `cwd` (same discovery as the CLI) or throws with a hint to run **`npx runly init`**. **`initRunlyProject(cwd?)`** is the programmatic equivalent of **`runly init`**.
118
137
119
138
---
120
139
121
140
## CLI
122
141
123
-
| Flag | Description |
124
-
|------|-------------|
142
+
| Command / flag | Description |
143
+
|----------------|-------------|
144
+
|`runly init`| Create `runly.config.js` with defaults, copy **`SKILL.md`** when missing, and add `"runly": "runly"` to `package.json` when present. No-op for config if a config file already exists. |
145
+
|`runly`, `runly -c <path>`| Run the matrix (search for config in cwd, or use `-c` / `--config`). |
125
146
|`-c`, `--config`| Path to a config file. If omitted, Runly searches for `runly.config.mjs`, then `.js`, then `.cjs` in the current working directory. |
147
+
|`runly help`| Print usage. |
126
148
127
149
---
128
150
@@ -147,7 +169,7 @@ On Windows, `npx.cmd` is used for the resolution step.
147
169
148
170
## Continuous integration
149
171
150
-
Install dependencies as usual, ensure Node and npm are available, then invoke `npx runly` (or `npx @hamdymohamedak/runly`) from the repository root where the config lives. No extra global Node switcher is required on the runner image as long as `npx` can fetch the `node` package.
172
+
Install dependencies as usual, ensure Node and npm are available. If the repo has no Runly config yet, run **`npx runly init`** once at the root (or commit a config file). Then invoke **`npx runly`** (or **`npm run runly`**) from the repository root. No extra global Node switcher is required on the runner image as long as `npx` can fetch the `node` package.
0 commit comments