runset 0.0.0 → 0.0.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/README.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # runset
2
2
 
3
- Run npm scripts in sequence or in parallel. Based on ideas from
4
- [`npm-run-all`](https://github.com/mysticatea/npm-run-all), with reusable
5
- pipelines, colored labels, and grouped output.
6
-
7
- Requires Node.js 24.2 or later. No runtime dependencies.
3
+ Run npm scripts and shell commands in parallel or sequence, with glob matching,
4
+ reusable pipelines, colored labels, and grouped output. Inspired by
5
+ `npm-run-all`, with more control over execution and output.
6
+
7
+ - **Flexible execution** — mix parallel and sequential steps, with concurrency
8
+ limits
9
+ - **Readable output** — colored labels, grouped logs, and output redirection
10
+ - **Process control** — stop, continue, or restart on exit, clean up process
11
+ trees on interruption
12
+ - **Workspace support**
13
+ - **Zero dependencies**
8
14
 
9
15
  ```sh
10
16
  npm install --save-dev runset
@@ -22,6 +28,9 @@ npx runset -p "watch:**" # all watch scripts together
22
28
  Each `-p` or `-s` starts a new group. Groups run in order, so in the mixed
23
29
  example above, build waits for both lint and test to finish.
24
30
 
31
+ Use `-j 2` to limit concurrency. Commands in a group run in batches of at most
32
+ two, with each batch waiting for all its commands before the next starts.
33
+
25
34
  By default, a failed command stops the run. Ctrl+C stops all running commands
26
35
  and their child processes.
27
36
 
@@ -48,26 +57,21 @@ npx runset "serve --port {1}" -- 8080
48
57
  npx runset "test {@}" -- --watch --verbose
49
58
  ```
50
59
 
51
- `{1}`, `{2}`, etc. insert individual arguments. `{@}` inserts all arguments.
52
- Placeholder values are quoted automatically for the shell.
60
+ `{1}`, `{2}`, etc. insert individual arguments. `{@}` inserts all arguments
61
+ separately; `{*}` joins them into one argument. Placeholder values in command
62
+ arguments are quoted automatically for the shell.
53
63
 
54
- ## Options
64
+ Named placeholders read options after `--`: `{port}` takes its value from
65
+ `--port 8080` or `--port=8080`. A bare option supplies `true`, which is useful
66
+ for conditional commands:
55
67
 
56
- | Option | What it does |
57
- | ----------------------- | --------------------------------------------- |
58
- | `-p, --parallel` | Run the following commands together |
59
- | `-s, --serial` | Run the following commands one after another |
60
- | `-j, --jobs <n>` | Limit how many commands run at once |
61
- | `--on-failure <action>` | `stop` (default), `continue`, or `restart` |
62
- | `--on-success <action>` | `continue` (default), `stop`, or `restart` |
63
- | `-o, --output grouped` | Buffer each command's output until it exits |
64
- | `--stdout <file>` | Write stdout to a file |
65
- | `--labels <mode>` | `auto` (default), `all`, `custom`, or `none` |
66
- | `--cwd <dir>` | Set the working directory |
67
- | `--dry-run` | Show what would run without starting anything |
68
- | `-c, --config <path>` | Use a specific config file |
68
+ ```sh
69
+ npx runset "serve --port {port}" -- --port=8080
70
+ npx runset lint "test::disabled={noTest}" -- --no-test
71
+ ```
69
72
 
70
- Use `--help` for all options.
73
+ Without `--no-test`, the missing value makes `disabled` false. Placeholders work
74
+ in command arguments and `::` option values, not command names.
71
75
 
72
76
  Add `::` to set options for one command:
73
77
 
@@ -76,14 +80,83 @@ npx runset -p "api::label=server,color=cyan" web
76
80
  npx runset "lint::on-failure=continue" build
77
81
  ```
78
82
 
83
+ See the [command options](#command-options) and [CLI flags](#cli-flags) at the
84
+ bottom for the full reference.
85
+
86
+ ## Workspaces
87
+
88
+ Use `-r, --recursive` to run a script in every workspace package that has it:
89
+
90
+ ```sh
91
+ npx runset -r build # packages in sequence
92
+ npx runset -rp "test:*" -j 4 # workspace tests, up to four at once
93
+ npx runset clean "build::recursive" # only build expands across packages
94
+ ```
95
+
96
+ runset finds the nearest `pnpm-workspace.yaml` or `package.json` with
97
+ `workspaces`, starting at the working directory. Workspace patterns support `!`
98
+ exclusions. The root package is excluded; packages run in path order, from their
99
+ own directories, with package names used for automatic labels. Packages without
100
+ the script are skipped. If no workspace package matches, the command resolves
101
+ normally as a local script, glob, or shell command.
102
+
103
+ ## Exit behavior
104
+
79
105
  `stop` ends the whole run. `continue` lets it carry on. `restart` runs the
80
106
  command again without a delay or retry limit.
81
107
 
108
+ `--on-failure continue` runs the remaining commands but still exits non-zero if
109
+ any command fails. `--on-success stop` ends the run when a command succeeds,
110
+ stopping any others still running. Failures produce a summary identifying the
111
+ failed commands.
112
+
113
+ Ctrl+C and SIGTERM stop the command process trees. `--kill-timeout` sets the
114
+ grace period before forceful termination (5000 ms by default); a second Ctrl+C
115
+ forces termination immediately. A run interrupted by SIGINT exits with 130, or
116
+ 143 for SIGTERM, unless it was already ending with another result.
117
+
82
118
  ## Output
83
119
 
84
120
  Commands running together get colored labels automatically, so you can tell
85
- which command wrote each line. Set your own with `::label=api,color=cyan`. Use
86
- `--no-color` for plain text or `--labels none` to hide labels.
121
+ which command wrote each line. Automatic labels use the script, program, or
122
+ workspace package name; repeated names get suffixes such as `#1` and `#2`. Set
123
+ your own with `::label=api,color=cyan`. Use `--color none` for plain text or
124
+ `--labels none` to hide labels.
125
+
126
+ | Label mode | What gets a label |
127
+ | ---------- | ------------------------------------------------------------------------------- |
128
+ | `auto` | Commands sharing a parallel stage, plus any custom labels (default) |
129
+ | `all` | Every command, including sequential commands |
130
+ | `custom` | Only custom labels; other commands in the same stage leave a blank label column |
131
+ | `none` | Nothing, including commands with custom labels |
132
+
133
+ runset has 36 label backgrounds for 256-color terminals: 24 soft, vivid shades
134
+ with charcoal text and 12 deeper shades with off-white text. `--color <mode>`
135
+ (or `color` in a config file) picks how many of them automatic labels use:
136
+
137
+ | Mode | Automatic labels |
138
+ | ------- | ------------------------------------------------------------------------------------------- |
139
+ | `auto` | `soft` on 256-color terminals, `basic` on other color terminals, otherwise `none` (default) |
140
+ | `none` | no color, `[label]` |
141
+ | `basic` | the terminal's 16 theme colors |
142
+ | `soft` | the 24 soft shades |
143
+ | `all` | the soft and the deeper shades |
144
+
145
+ `auto` reads the terminal environment, so `FORCE_COLOR` and `NO_COLOR` apply.
146
+ Without an environment override, both stdout and stderr must be terminals for
147
+ color to be enabled. Explicit modes override detection. Label colors are chosen
148
+ from the label text, with collisions adjusted to distinguish commands.
149
+
150
+ You can also choose a shade: `"api::label=server,color=ink,bg-color=bgCoral"`.
151
+ Available shades are `mint`, `sky`, `rose`, `amber`, `lavender`, `aqua`,
152
+ `coral`, `sage`, `periwinkle`, `peach`, `teal`, `lilac`, `lime`, `steel`,
153
+ `pink`, `seafoam`, `apricot`, `mauve`, `jade`, `sand`, `iris`, `ice`, `salmon`,
154
+ `olive`, `navy`, `plum`, `forest`, `wine`, `ocean`, `indigo`, `copper`, `pine`,
155
+ `violet`, `brick`, `slate`, `cocoa`, `ink`, and `paper`. Pair the deeper shades
156
+ with `paper`, as in `"api::label=server,color=paper,bg-color=bgNavy"`. For
157
+ backgrounds, capitalize the shade and prefix it with `bg`, as in `bgMint`.
158
+ Existing names such as `cyan` and `bgBlue` still use your terminal's theme. From
159
+ a checkout, run `npm run preview:colors` to see all 36 label pairs.
87
160
 
88
161
  To keep each command's output together, use grouped output:
89
162
 
@@ -93,6 +166,35 @@ npx runset -p lint test -o grouped
93
166
 
94
167
  Each command's output is buffered and printed when it exits.
95
168
 
169
+ `--stdout` and `--stderr` configure streams separately; `-o, --output` sets
170
+ both. A value can name a timing (`realtime` or `grouped`), a destination
171
+ (`stdout`, `stderr`, `none`, or a file path), or both joined with `+`:
172
+
173
+ ```sh
174
+ npx runset -p lint test --stdout grouped+./checks.log
175
+ npx runset build --stderr stdout
176
+ npx runset "lint::output=none" build
177
+ ```
178
+
179
+ The default is realtime output to each stream's usual destination. A value that
180
+ sets only timing preserves the destination, and vice versa. Stream-specific
181
+ options override `output` in the same scope, regardless of flag order. File
182
+ paths resolve against the run's working directory. Each file is overwritten once
183
+ per run, and commands writing to the same file share it.
184
+
185
+ In a config, write `output: 'grouped'` or
186
+ `output: { timing: 'grouped', destination: './checks.log' }` — for the whole
187
+ run, in a settings entry, or on a single command.
188
+
189
+ Use `--show-command` to print commands when they start and `--show-exit-code` to
190
+ show their status and duration: `✓ 2.1s`, `✗ code 1 · 2.1s`, or
191
+ `– stopped · 2.1s`. Failure and stop lines also name the command. These lines
192
+ follow the command's stdout settings, including grouping and redirection.
193
+
194
+ `-w, --wrap` wraps long labelled lines and repeats the label on every line. It
195
+ uses the terminal width, or `COLUMNS` when no terminal width is available;
196
+ without either, lines stay whole. Wrapping is off by default.
197
+
96
198
  ## Config
97
199
 
98
200
  Save a pipeline in `runset.config.ts`, then run `npx runset`:
@@ -115,26 +217,46 @@ export default {
115
217
  This runs clean, then lint and test together, then build. Settings entries apply
116
218
  to the commands that follow them.
117
219
 
118
- Use `commandDictionary` to give a command or pipeline a reusable name:
220
+ The same object may live in a `runset` section of `package.json` instead; a
221
+ `runset.config.*` file in the same directory wins over it.
222
+
223
+ Use `scripts` to give a command or pipeline a reusable name:
119
224
 
120
225
  ```ts
121
226
  import type { ConfigJs } from 'runset';
122
227
 
123
228
  export default {
124
- commandDictionary: {
229
+ scripts: {
125
230
  check: ['lint', 'test'],
126
231
  api: { command: 'node server.js', env: { PORT: '4000' } },
127
232
  },
128
233
  } satisfies ConfigJs;
129
234
  ```
130
235
 
131
- Run these with `npx runset check` or `npx runset api`. Dictionary names take
132
- priority over npm script names.
236
+ Run these with `npx runset check` or `npx runset api`. Names in `scripts` take
237
+ priority over the same names in `package.json`.
133
238
 
134
239
  Config files also support `.js`, `.mjs`, `.cjs`, and `.json`. runset looks in
135
240
  the working directory and its parents. CLI commands run **after** any `commands`
136
241
  listed in the config.
137
242
 
243
+ Run-wide CLI flags override config values. Per-command options override the
244
+ run-wide defaults. Config keys use camelCase, such as `onFailure`,
245
+ `showExitCode`, and `killTimeout`; see the references below.
246
+
247
+ Set environment variables for every command with a top-level `env` object or
248
+ repeatable `-e NAME=value` flags. CLI values override config values for the same
249
+ variable. A command can add its own `env` object, as `api` does above. These
250
+ settings affect child commands; use `--color` to control runset's own colors.
251
+
252
+ Config modules can also export a synchronous function receiving
253
+ `{ argv, cwd, env }` and returning the config object. Falsy entries in
254
+ `commands` are skipped, so lists can contain conditional commands.
255
+
256
+ Named pipelines can run together: with `api: ['build:api', 'test:api']` and
257
+ `web: ['build:web', 'test:web']` in `scripts`, `npx runset -p api web` runs both
258
+ builds, then both tests. Both builds must finish before either test starts.
259
+
138
260
  ## Library
139
261
 
140
262
  ```ts
@@ -148,6 +270,94 @@ The promise resolves with a `Run`, or rejects with a `RunsetError` if the run
148
270
  fails. Use `Run.fromConfigJs(config)` to prepare a run, `describe()` to inspect
149
271
  it, `start()` to run it, and `terminate()` to stop it.
150
272
 
273
+ ## Command options
274
+
275
+ Use `"command args::option=value,flag"` on the CLI or in config command strings.
276
+ The last `::` starts the option list. Boolean options can be bare (`disabled`)
277
+ or explicit (`disabled=false`). To pass a literal `::` in the command, append an
278
+ empty option list, as in `"perl -MData::Dumper::"`.
279
+
280
+ Config command objects use camelCase: for example,
281
+ `{ command: 'lint', onFailure: 'continue' }`. Settings entries omit `command`
282
+ and supply defaults for the following commands.
283
+
284
+ | Inline option | Config key | Meaning |
285
+ | ------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
286
+ | `label=<text>` | `label` | Set the output label; preserves spaces. Visibility follows `labels`. |
287
+ | `color=<name>` | `color` | Label foreground, such as `cyan`, `ink`, or `paper`; this is a color name, while run-wide `color` is a mode. |
288
+ | `bg-color=<name>` | `bgColor` | Label background, such as `bgBlue` or `bgCoral`. Colors alone do not add a label. |
289
+ | `cwd=<dir>` | `cwd` | Set the command's directory, relative to the inherited directory. Explicitly setting it overrides the npm package-root default. |
290
+ | `disabled[=true\|false]` | `disabled` | Skip the command when true; default: `false`. |
291
+ | `parallel[=true\|false]` | `parallel` | Run alongside adjacent parallel commands. On a named pipeline, run its stages alongside neighboring pipelines. |
292
+ | `recursive[=true\|false]` | `recursive` | Expand npm scripts across workspace packages; inherits the run-wide setting (default: `false`). |
293
+ | `on-success=<action>` | `onSuccess` | `continue`, `stop`, or `restart`; inherits the run-wide setting (default: `continue`). |
294
+ | `on-failure=<action>` | `onFailure` | `continue`, `stop`, or `restart`; inherits the run-wide setting (default: `stop`). |
295
+ | `output=<value>` | `output` | Configure both streams using the output syntax above. |
296
+ | `stdout=<value>` | `stdout` | Configure stdout timing and/or destination. |
297
+ | `stderr=<value>` | `stderr` | Configure stderr timing and/or destination. |
298
+ | — | `env` | Object of environment variables added to this command; config only. |
299
+
300
+ Settings entries also accept `serial: true` as the opposite of `parallel: true`.
301
+ Each settings entry that sets `parallel` or `serial` starts a new group.
302
+
303
+ For a custom label renderer, set the run-wide, config-only `formatLabel`
304
+ function. It receives `{ command, color, defaultPrefix, stream }` and returns
305
+ the prefix string, for example:
306
+
307
+ ```ts
308
+ formatLabel: ({ defaultPrefix }) => `${new Date().toISOString()} ${defaultPrefix}`,
309
+ ```
310
+
311
+ ## CLI flags
312
+
313
+ ```text
314
+ runset [options] <command...> [-- <placeholder arguments...>]
315
+ ```
316
+
317
+ Except for `-p` and `-s`, flags apply to the whole run wherever they appear.
318
+ Long flags accept `--name value` or `--name=value`; short flags can be combined,
319
+ such as `-rp` or `-j4`. Use `--no-recursive`, `--no-show-command`,
320
+ `--no-show-exit-code`, `--no-wrap`, or `--no-dry-run` to disable a boolean
321
+ setting from the config. `--no-color` is an alias for `--color none`.
322
+
323
+ ### Execution
324
+
325
+ | Flag | Meaning and default |
326
+ | ----------------------- | --------------------------------------------------------------------------------------- |
327
+ | `-p, --parallel` | Start a group that runs the following commands together. |
328
+ | `-s, --serial` | Start a group that runs the following commands sequentially (the initial mode). |
329
+ | `-j, --jobs <n>` | Maximum concurrent commands, run in batches; default: unlimited. |
330
+ | `-r, --recursive` | Run npm scripts in every workspace package that has them; default: off. |
331
+ | `--on-success <action>` | Action after a clean exit: `continue` (default), `stop`, or `restart`. |
332
+ | `--on-failure <action>` | Action after a failed exit: `stop` (default), `continue`, or `restart`. |
333
+ | `--kill-timeout <ms>` | Grace period before forceful termination; default: `5000`. Use `0` for no grace period. |
334
+
335
+ ### Output
336
+
337
+ | Flag | Meaning and default |
338
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------ |
339
+ | `-o, --output <value>` | Set timing and/or destination for both command streams. |
340
+ | `--stdout <value>` | Set stdout timing and/or destination; default: `realtime+stdout`. |
341
+ | `--stderr <value>` | Set stderr timing and/or destination; default: `realtime+stderr`. |
342
+ | `--labels <mode>` | `auto` (default), `all`, `custom`, or `none`; see the label modes above. |
343
+ | `--color <mode>` | `auto` (default), `none`, `basic`, `soft`, or `all`. |
344
+ | `--show-command` | Print each command when it starts; default: off. |
345
+ | `--show-exit-code` | Print each command's exit status and duration; default: off. |
346
+ | `-w, --wrap` | Wrap long labelled lines, repeating the label; default: off. |
347
+ | `--log-level <level>` | Filter runset's own messages: `error`, `warn`, `info` (default), or `debug`. Does not filter command output. |
348
+
349
+ ### Configuration and help
350
+
351
+ | Flag | Meaning and default |
352
+ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
353
+ | `-c, --config <path>` | Load a specific config file instead of searching for one. |
354
+ | `--cwd <dir>` | Set the run's directory for config/package lookup, shell commands, and relative output paths. Defaults to the current directory; npm scripts run from their package root unless given a per-command `cwd`. |
355
+ | `-e, --env <NAME=value>` | Add an environment variable to every command; repeat for multiple variables. |
356
+ | `--dry-run` | Print resolved commands, stages, and effective options without running commands. |
357
+ | `-h, --help` | Show CLI help. |
358
+ | `-v, --version` | Show the installed version. |
359
+ | `--` | End runset options; remaining arguments supply placeholders. They are not automatically appended to commands. |
360
+
151
361
  ## License
152
362
 
153
363
  [MIT](LICENSE)
package/dist/index.d.mts CHANGED
@@ -9,6 +9,12 @@ export interface Std {
9
9
  export type ExitAction = 'continue' | 'restart' | 'stop';
10
10
  export declare const EXIT_ACTIONS: Set<ExitAction>;
11
11
  export type LogLevel = 'debug' | 'error' | 'info' | 'warn';
12
+ /**
13
+ * How much color runset uses: `basic` is the terminal's 16 theme colors,
14
+ * `soft` the light 256-color shades, and `all` those plus the deep ones.
15
+ * `auto` is `basic` or `soft`, whichever the terminal shows, or `none`.
16
+ */
17
+ export type ColorMode = 'all' | 'auto' | 'basic' | 'none' | 'soft';
12
18
  /** Which commands get a label in front of their output: see `--labels`. */
13
19
  export type LabelMode = 'all' | 'auto' | 'custom' | 'none';
14
20
  /** A resolved command, one per process a run spawns. */
@@ -24,7 +30,11 @@ export interface Command {
24
30
  line: string;
25
31
  onFailure: ExitAction;
26
32
  onSuccess: ExitAction;
33
+ /** The workspace package a `recursive` command was expanded into. */
34
+ packageName?: string;
27
35
  parallel: boolean;
36
+ /** Run an npm script in every workspace package that has it. */
37
+ recursive: boolean;
28
38
  /** The `package.json` script name, when `type` is `'npm'`. */
29
39
  scriptName?: string;
30
40
  /** Commands sharing a stage run together; stages run in order. */
@@ -44,9 +54,11 @@ export type LabelFormatter = (context: {
44
54
  }) => string;
45
55
  /** The parts of a {@link Command} a user may set by hand. */
46
56
  export type CommandOptions = {
57
+ /** Both streams at once; `stdout` / `stderr` in the same place outrank it. */
58
+ output?: Partial<Std> | string;
47
59
  stderr?: Partial<Std> | string;
48
60
  stdout?: Partial<Std> | string;
49
- } & Partial<Omit<Command, 'line' | 'scriptName' | 'stage' | 'stderr' | 'stdout' | 'type'>>;
61
+ } & Partial<Omit<Command, 'line' | 'packageName' | 'scriptName' | 'stage' | 'stderr' | 'stdout' | 'type'>>;
50
62
  /** One command written as an object; `command` is what makes it one. */
51
63
  export type CommandEntry = {
52
64
  command: string;
@@ -62,12 +74,12 @@ export type CommandSettings = {
62
74
  export type CommandDefinition = CommandEntry | CommandSettings | false | null | string | undefined;
63
75
  /** What a user writes in `runset.config.*`, or hands to `runset({ … })`. */
64
76
  export interface ConfigJs {
65
- color?: boolean;
66
- /** Named commands, resolved before `package.json` scripts. An entry may be a list. */
67
- commandDictionary?: Record<string, CommandDefinition | CommandDefinition[]>;
77
+ /** Default: `'auto'`. */
78
+ color?: ColorMode;
68
79
  commands?: CommandDefinition[];
69
80
  cwd?: string;
70
81
  dryRun?: boolean;
82
+ env?: Record<string, string>;
71
83
  /**
72
84
  * Renders the prefix of each labelled output line.
73
85
  *
@@ -87,10 +99,22 @@ export interface ConfigJs {
87
99
  onFailure?: ExitAction;
88
100
  /** What a clean exit does to the run. Default: `'continue'`. */
89
101
  onSuccess?: ExitAction;
102
+ /** Both streams at once; `stdout` / `stderr` outrank it. */
103
+ output?: Partial<Std> | string;
90
104
  /** The default `parallel` for every command. Default: `false`. */
91
105
  parallel?: boolean;
106
+ /** The default `recursive` for every command. Default: `false`. */
107
+ recursive?: boolean;
108
+ /** Named commands, resolved before `package.json` scripts. An entry may be a list. */
109
+ scripts?: Record<string, CommandDefinition | CommandDefinition[]>;
110
+ /** Print each command before it starts. Default: `false`. */
111
+ showCommand?: boolean;
112
+ /** Print how each command exited, green or red. Default: `false`. */
113
+ showExitCode?: boolean;
92
114
  stderr?: Partial<Std> | string;
93
115
  stdout?: Partial<Std> | string;
116
+ /** Wrap labelled lines to the terminal, labelling each piece. Default: `false`. */
117
+ wrap?: boolean;
94
118
  }
95
119
  /** A config module may export the object itself or a sync factory for it. */
96
120
  export type ConfigJsExport = ((context: {
@@ -113,13 +137,18 @@ export interface Destinations {
113
137
  export declare function isCommandSettings(definition: CommandEntry | CommandSettings): definition is CommandSettings;
114
138
  export declare function isStreamDestination(destination: string): destination is 'stderr' | 'stdout';
115
139
  //#endregion
140
+ //#region src/utils/colors.d.ts
141
+ /** A `ColorMode` once `auto` has been settled. */
142
+ type ColorLevel = Exclude<ColorMode, 'auto'>;
143
+ //#endregion
116
144
  //#region src/config/parseCli.d.ts
117
145
  /** Run-wide options a CLI flag can set. */
118
146
  interface CliOptions {
119
- color?: boolean;
147
+ color?: string;
120
148
  config?: string;
121
149
  cwd?: string;
122
150
  dryRun?: boolean;
151
+ env?: Record<string, string>;
123
152
  jobs?: number;
124
153
  killTimeout?: number;
125
154
  labels?: string;
@@ -127,8 +156,12 @@ interface CliOptions {
127
156
  onFailure?: string;
128
157
  onSuccess?: string;
129
158
  output?: string;
159
+ recursive?: boolean;
160
+ showCommand?: boolean;
161
+ showExitCode?: boolean;
130
162
  stderr?: string;
131
163
  stdout?: string;
164
+ wrap?: boolean;
132
165
  }
133
166
  interface ParsedCli {
134
167
  /** The argv this is the parse of. */
@@ -145,7 +178,7 @@ interface ParsedCli {
145
178
  /** The resolved run-wide configuration: CLI flag → config file → default. */
146
179
  declare class Config {
147
180
  readonly commands: CommandDefinition[];
148
- readonly commandDictionary: Record<string, CommandDefinition | CommandDefinition[]>;
181
+ readonly scripts: Record<string, CommandDefinition | CommandDefinition[]>;
149
182
  /** Everything after `--`, for placeholders. */
150
183
  readonly args: string[];
151
184
  readonly cwd: string;
@@ -154,8 +187,14 @@ declare class Config {
154
187
  readonly killTimeout: number;
155
188
  readonly onSuccess: ExitAction;
156
189
  readonly onFailure: ExitAction;
157
- readonly color: boolean;
190
+ readonly color: ColorLevel;
158
191
  readonly parallel: boolean;
192
+ readonly recursive: boolean;
193
+ readonly showCommand: boolean;
194
+ readonly showExitCode: boolean;
195
+ readonly wrap: boolean;
196
+ /** `COLUMNS` as runset was started with it: the width where no TTY says. */
197
+ readonly envColumns: number | undefined;
159
198
  readonly labels: LabelMode;
160
199
  readonly logLevel: LogLevel;
161
200
  readonly dryRun: boolean;
@@ -214,6 +253,10 @@ export declare class Run {
214
253
  /** Rejects with a {@link RunsetError} when the run did not succeed. */
215
254
  start(): Promise<Run>;
216
255
  terminate(options?: TerminateOptions): void;
256
+ /** `1 of 5 commands failed, 2 stopped, 1 not started`. */
257
+ private tally;
258
+ /** The tally, then a row per failure, labelled as its output was. */
259
+ private failureReport;
217
260
  private failed;
218
261
  /** Says a signal arrived before any command's parting words, then stops. */
219
262
  private onSignal;
@@ -226,7 +269,9 @@ export declare class Run {
226
269
  /** Any failure runset reports itself; `exitCode` is what the CLI exits with. */
227
270
  export declare class RunsetError extends Error {
228
271
  readonly exitCode: number;
229
- constructor(message: string, exitCode?: number);
272
+ /** What the CLI prints in place of `message`; empty when it already said so. */
273
+ readonly report: string | undefined;
274
+ constructor(message: string, exitCode?: number, report?: string);
230
275
  }
231
276
  /** A command line runset cannot read. */
232
277
  export declare class CliError extends RunsetError {}