cargo-gamma 0.3.0

Fast mutation testing for Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# Command-line reference

Every subcommand and every option `cargo-gamma` accepts.

## Contents

* [Invoking the tool]#invoking-the-tool
* [The subcommands]#the-subcommands
* [The option categories]#the-option-categories
* [Where settings come from]#where-settings-come-from
* [Passing arguments through]#passing-arguments-through
* [Resuming interrupted testing]#resuming-interrupted-testing
* [Understanding uncovered mutants]#understanding-uncovered-mutants
* [Exit status]#exit-status
* [Full option reference]#full-option-reference
  * [Accepted by every subcommand]#accepted-by-every-subcommand
  * [`gamma run`]#gamma-run
  * [`gamma list`]#gamma-list
    * [`gamma list mutants`]#gamma-list-mutants
    * [`gamma list files`]#gamma-list-files
    * [`gamma list mutators`]#gamma-list-mutators
    * [`gamma list presets`]#gamma-list-presets
  * [`gamma explain`]#gamma-explain
  * [`gamma suppress`]#gamma-suppress
  * [`gamma unsuppress`]#gamma-unsuppress
  * [`gamma merge`]#gamma-merge
  * [`gamma hints`]#gamma-hints
  * [`gamma clean`]#gamma-clean
  * [`gamma completions`]#gamma-completions

## Invoking the tool

`cargo-gamma` is a cargo subcommand, so it is spelled with a space:

```bash
cargo gamma run
```

With no subcommand, `run` is implied, so these are the same:

```bash
cargo gamma
cargo gamma run
```

That shorthand only applies when the first argument is not itself a subcommand. `cargo gamma --workspace`
is a run over the whole workspace; `cargo gamma list` is the `list` subcommand and not a run.

## The subcommands

<!-- begin generated: commands -->

| Command | What it does |
| --- | --- |
| [`gamma run`]#gamma-run | Run mutation testing |
| [`gamma list`]#gamma-list | List what would be done, without doing it |
| [`gamma explain`]#gamma-explain | Explain a mutator, a mutant, or a suppression |
| [`gamma suppress`]#gamma-suppress | Write suppressions into the source for mutants that cannot usefully be tested |
| [`gamma unsuppress`]#gamma-unsuppress | Remove skip directives that no longer suppress anything |
| [`gamma merge`]#gamma-merge | Combine per-shard reports into one answer |
| [`gamma hints`]#gamma-hints | Promote what a run learned about speed into a file the workspace can check in |
| [`gamma clean`]#gamma-clean | Delete cargo-gamma's cached data for a workspace |
| [`gamma completions`]#gamma-completions | Print a shell completion script |

<!-- end generated -->

`gamma list` defaults to `mutants`. Its explicit modes are:

| Mode | Purpose |
| --- | --- |
| `mutants` | List the current selected mutant population. |
| `files` | List source files in the selected population. |
| `mutators` | List registered mutators and their selection state. |
| `presets` | List named mutator presets. |

## Resuming interrupted testing

After CTRL+C during the mutant-testing phase, continue that same campaign with:

```bash
cargo gamma run --resume-testing
```

The prepared workspace and test binaries are reused as-is. Discovery, copying,
instrumentation, builds, baseline measurement, and test census collection do not
run again. All completed verdicts are retained; unfinished mutants are retried.
Selection and test settings are frozen, so live source changes, execution settings
in `gamma.toml`, new hints, and suppression edits do not alter the resumed
campaign. Reporting options remain live; `min-score` and `max-flaky` gates are
read from current configuration unless overridden on the command line. Unrelated
execution values are not validated on resume, but unknown top-level configuration
keys are rejected. Use `--dir` and, if necessary,
`--cache-dir` to identify the existing campaign.

Resume reports an error if the campaign did not reach testing, already published
its completed ledger, has incompatible or corrupt state, or is missing or has
changed its prepared artifacts or, when tests remain pending, inherited
environment. If testing finished
but completed-ledger publication was interrupted, resume publishes the result
without rerunning mutants or requiring the current inherited environment to
match. It never falls back to starting a new campaign. Only
campaigns started by a version supporting this option have resumable state;
older diagnostic progress logs cannot be resumed.

`cargo gamma hints`, `cargo gamma suppress`, and `cargo gamma unsuppress` can
also be used after interruption. Hints and suppressions use the current partial
campaign's recorded evidence rather than an older completed campaign. Pending
mutants supply no verdict. Suppression and unsuppression preview edits unless
`--apply` is passed, and their source-validation safeguards still apply.
`hints --replace` is the exception: whole-artifact replacement requires a valid
completed campaign ledger and never uses the interrupted checkpoint.

## The option categories

The same categories appear in `--help` and in the reference below. Knowing which category a setting
lives in is usually enough to find it:

| Category | What it governs |
| --- | --- |
| **Selecting what to mutate** | Which files, packages, lines and mutators make up the population. Applied before anything is built. |
| **Cargo features** | The feature set to compile under. Discovery and the build must agree, so these apply to both. |
| **Configuration** | Where settings are read from, and whether the file is read at all. |
| **Building** | Compiler convergence and test-binary generation: profile, arguments to Cargo, timeouts, and how many withdrawal rounds are allowed. |
| **Running tests** | How the suite is executed per mutant: parallelism, timeouts, which test targets may decide a verdict, and which runner. |
| **Memory** | The ceiling each test binary runs under, and how it is derived. A mutant can turn bounded allocation into unbounded allocation, which a timeout catches only slowly. |
| **Scratch tree** | Where the instrumented copy of the workspace lives, and what is copied into it. |
| **Run control** | What the run does as a whole: gate on a score, reuse safe knowledge from a previous run, or stop early. |
| **Reporting** | What is written where, and how much detail the console prints. |
| **Global options** | Color, accepted by every subcommand. Progress display settings are run control. |

Two categories are specific to one subcommand: **Suppressing** (`suppress`, `unsuppress`) and
**Merging** (`merge`).

## Where settings come from

A setting can be given in three places. Later beats earlier:

1. **The built-in default.**
2. **The configuration file**, `gamma.toml` by default — see [CONFIG.md]CONFIG.md for every
   key, and [`gamma.toml`]gamma.toml for a documented file to copy.
3. **The command line.**

So a flag always wins over the file, and `--no-config` ignores the file entirely — which is what
makes a scripted run reproducible regardless of what the project happens to have committed.

Not every option has a configuration key, and not every key has an option. A key with no flag is
noted in [CONFIG.md](CONFIG.md); an option with no key is generally one that makes no sense to
persist, such as `--dry-run`.

## Passing arguments through

Three options forward arguments to something else, and they are not interchangeable:

| Option | Reaches | Use it for |
| --- | --- | --- |
| `--cargo-arg`, `-C` | every **cargo** invocation | `--offline`, `--locked`, `--target`, and other build arguments (not Cargo `--config`; use a configuration file gamma can inspect) |
| `--cargo-test-arg` | every **test binary** | harness arguments, in a form a configuration file can hold |
| `--` (trailing) | every **test binary** | the same thing, typed at the shell |

`--cargo-test-arg` and `--` mean the same thing to the harness and are concatenated. Both exist
because a configuration file cannot express a positional `--`, and because `--` must come last, so
nothing can follow it:

```bash
cargo gamma run --cargo-arg --offline -- --test-threads=1
```

## Understanding uncovered mutants

`uncovered` means cargo-gamma obtained complete, deterministic evidence that no selected runtime
test activated the mutation site's guard. That evidence can come from an opted-in reachability
census or from sealed whole-binary observations learned while testing another replacement at the
same stable site. It does not mean that every external coverage report must show the source line as
missed. `--whole-test-binaries` disables deterministic reach narrowing, so this case-level
classification is unavailable.

For example, code annotated `#[coverage(off)]` is removed from a coverage tool's denominator but
remains production code that gamma mutates. A project can therefore report 100% line coverage while
gamma correctly reports an uncovered mutant in that function. Coverage combined across other
platforms, features or test targets can create the same difference, as can cfg-disabled or
compile-time proc-macro code. Line coverage can also mark a line while a particular expression or
branch on it never ran.

Respond according to intent: add a runtime test, align the run's features/platform/test-targets with
the coverage job, or use a reviewed [suppression](../README.md#suppressing-mutations) for code that
is intentionally outside the mutation oracle. Gamma does not automatically exclude
`#[coverage(off)]`, because deliberately uncounted code can still contain behavior worth testing.

## Test environment

Cargo-gamma builds test targets through Cargo and then reuses those binaries directly or through
nextest. Direct launches reproduce Cargo's runtime environment, including package and manifest
metadata, build-script environment and `OUT_DIR`, integration-test `CARGO_BIN_EXE_*` paths, the
selected Cargo/rustup toolchain, the package working directory, and executable and dynamic-library
search paths. With `--nextest`, cargo-gamma supplies the Cargo context and nextest adds its
runner-specific `NEXTEST_*` variables.

## Exit status

The process status distinguishes a rejected invocation, a completed campaign whose correctness
gate failed, and a campaign that could not obtain a complete answer:

| Status | Meaning |
| ---: | --- |
| `0` | The command completed and every requested gate or expectation passed. Help and version also return success. |
| `1` | The command line, configuration, or effective selection was invalid. |
| `2` | The command completed, but a score gate or source expectation failed, or a requested gate had no complete population to grade. |
| `3` | The command could not proceed or could not produce the requested complete result. |
| `70` | An internal cargo-gamma panic reached the top-level boundary. |

An empty population fails only when a configured gate requires something to grade. A partially
completed population fails when either `--min-score` or `--max-flaky` is configured; with no strict
gate it remains a reportable result. Build convergence that leaves stuck mutants is still status
`3`, because the selected population was not built completely enough to answer.

A failing baseline also returns status `3`. Cargo-gamma lets completing baseline binaries report
all their test failures, writes each failure under
`target/cargo-gamma/baseline-failures/<package>/<target>/` (or the equivalent beneath
`--artifact-dir`). It prints a platform-native `Wrote` path for the canonical diagnostics and each
failure's `failure.json` and `diags.json`, then one aggregate error directing the reader there. A
new build clears that directory first, so every retained record belongs to the current run. Because
the instrumented build has already converged before baselining, these diagnostics retain the full
mutant population and its known unviable and still-pending outcomes even when the baseline fails.

## Full option reference

`--help` and `--version` are accepted everywhere and are omitted below. Options marked with a
default take that value when neither the command line nor the configuration file sets one.

<!-- begin generated: options -->

### Accepted by every subcommand

**Global options**

| Option | Value | What it does |
| --- | --- | --- |
| `--color` | `<WHEN>` | When to use color in output. Defaults to `auto`. |

### `gamma run`

Run mutation testing

```text
cargo gamma run [OPTIONS] [-- <TEST_ARGS>...]
```

**Run control**

| Option | Value | What it does |
| --- | --- | --- |
| `--resume-testing` |  | Continue the interrupted campaign's testing phase using its existing prepared tree. |
| `--progress` | `<WHEN>` | When to show the progress display. Defaults to `auto`. |
| `--dashboard` |  | Show a live testing dashboard instead of the progress bar. |
| `--min-score` | `<PERCENT>` | Fail the run if the assertion-killed mutation score is below this percentage. |
| `--max-flaky` | `<COUNT>` | Fail if more than this many mutants have an unresolved flaky outcome. |
| `--incremental` | `<INCREMENTAL>` | How an incremental run reuses the last run: `no` starts cold; `build` reuses compiler unviability and checked execution hints. |
| `--leak-dirs` |  | Keep an incomplete scratch workspace after errors so it can be inspected. |
| `--no-baseline` |  | Skip the baseline run. |
| `--no-confirm` |  | Believe a failing test without re-running it with no mutant active. |
| `--dry-run` |  | Find and report mutants without building or running anything. |
| `--no-stall-detection` |  | Wait out the whole budget for every mutant instead of cutting off one that has stopped making progress. |

**Selecting what to mutate**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package to analyze. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to apply, as a comma-separated selector list. |
| `--file` | `<GLOB>` | Only mutate files matching these glob patterns. |
| `--exclude-file` | `<GLOB>` | Skip files matching these glob patterns. |
| `--shard-count` | `<COUNT>` | Number of shards to divide the mutants into. |
| `--shard-index` | `<INDEX>` | Which shard to run, from 0. |
| `-D`, `--in-diff` | `<PATH>` | Only mutate lines added or changed by this unified diff, or `-` for standard input. |
| `-p`, `--package` | `<NAME>` | Only mutate these packages. Defaults to Cargo's package selection for the current directory. |
| `--workspace` |  | Mutate every package in the workspace. |
| `--error` | `<EXPR>` | Additional values for `fn_value.err_with`, which replaces a function body with `Err(...)`. |
| `--only-survivors` |  | Run only mutants that genuinely survived in the previous cargo-gamma report. |
| `--mutant` | `<ID>` | Run exactly this current mutant ID; repeat to select more than one. |

**Cargo features**

| Option | Value | What it does |
| --- | --- | --- |
| `--features` | `<FEATURES>` | Cargo features to activate, comma-separated or repeated. |
| `--all-features` |  | Activate every feature of every selected package. |
| `--no-default-features` |  | Do not activate the `default` feature. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Running tests**

| Option | Value | What it does |
| --- | --- | --- |
| `--show-build` |  | Show Cargo's raw build output. |
| `-j`, `--jobs` | `<N>` | How many mutants to test at once. Defaults to one more than the available parallelism. |
| `--resource-concurrency` | `<NAME=N>` | Override the maximum concurrency of a test resource declared with `#[gamma::resource]`. |
| `--test-timeout-multiplier` | `<FACTOR>` | Multiple of each test binary's baseline duration that a mutant is allowed. |
| `--minimum-test-timeout` | `<SECONDS>` | Lower bound on a test binary's timeout, however fast the baseline was. |
| `--cargo-test-arg` | `<ARG>` | Pass an argument through to every test binary. |
| `--test-package` | `<NAME>` | Run the tests of these packages when deciding a verdict. |
| `--test-lib` |  | Use only library unit-test harnesses as the verdict oracle. |
| `--include-test` | `<GLOB>` | Only let these test targets decide a verdict. |
| `--exclude-test` | `<GLOB>` | Do not let these test targets decide a verdict. |
| `--nextest` |  | Run test binaries through `cargo nextest` for per-test process isolation. |
| `--test-workspace` |  | Let every workspace package's tests decide a verdict. |
| `--optimize-test-execution` |  | Measure which individual tests reach each mutation site before testing mutants. |
| `--whole-test-binaries` |  | Run every selected test in each reachable test binary. |

**Memory**

| Option | Value | What it does |
| --- | --- | --- |
| `--memory` | `<MODE>` | How much memory control to place around each test binary. `enforce` by default. |
| `--memory-multiplier` | `<FACTOR>` | Multiple of a test binary's baseline peak memory a mutant of it may reach. |
| `--memory-headroom` | `<SIZE>` | Absolute headroom added to a test binary's baseline peak memory. |
| `--memory-limit` | `<SIZE>` | An explicit memory ceiling for every test binary, instead of one derived from the baseline. |
| `--baseline-memory-limit` | `<SIZE>` | A memory ceiling for the baseline runs themselves. |
| `--no-relaunch` |  | Do not re-run inside a systemd scope to obtain the cgroup memory control needs. |

**Building**

| Option | Value | What it does |
| --- | --- | --- |
| `--profile` | `<NAME>` | Which Cargo profile to build with. |
| `-C`, `--cargo-arg` | `<ARG>` | Pass an argument through to every cargo invocation. |
| `--build-timeout` | `<SECONDS>` | Seconds a compiler invocation may take before the run is abandoned. |
| `--build-timeout-multiplier` | `<FACTOR>` | Multiple of the first compiler round's duration that a later round is allowed. |
| `--rollback-rounds` | `<ROUNDS>` | How many compiler rounds may withdraw mutants that do not compile. Defaults to `256`. |

**Cache**

| Option | Value | What it does |
| --- | --- | --- |
| `--cache-dir` | `<PATH>` | Put cargo-gamma's reusable workspace and Cargo artifacts in this directory. |
| `--copy-ignored` |  | Copy files version control ignores into the cached workspace as well. |

**Arguments**

| Option | Value | What it does |
| --- | --- | --- |
| `<TEST_ARGS>` | `<TEST_ARGS>` | Arguments passed to every test binary, after `--`. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--artifact-dir` | `<PATH>` | Write all user-facing artifacts to this directory. |
| `--show-killed` |  | List the mutants the suite killed, not just the ones that survived. |
| `--show-unviable` |  | List every mutant that could not be compiled, not just how many there were. |
| `--sarif-level` | `<LEVEL>` | How loudly a survivor is reported to a SARIF consumer. Defaults to `note`. |
| `--annotations` | `<WHEN>` | Annotate the diff and write a job summary when running inside a CI system. Defaults to `auto`. |
| `--diag-names` | `<POLICY>` | What to do with package and binary names in the diagnostics bundle. Defaults to `hashed`. |

### `gamma list`

List what would be done, without doing it

```text
cargo gamma list <COMMAND>
```

### `gamma list mutants`

List the mutants that would be generated

```text
cargo gamma list mutants [OPTIONS]
```

**Selecting what to mutate**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package to analyze. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to apply, as a comma-separated selector list. |
| `--file` | `<GLOB>` | Only mutate files matching these glob patterns. |
| `--exclude-file` | `<GLOB>` | Skip files matching these glob patterns. |
| `--shard-count` | `<COUNT>` | Number of shards to divide the mutants into. |
| `--shard-index` | `<INDEX>` | Which shard to run, from 0. |
| `-D`, `--in-diff` | `<PATH>` | Only mutate lines added or changed by this unified diff, or `-` for standard input. |
| `-p`, `--package` | `<NAME>` | Only mutate these packages. Defaults to Cargo's package selection for the current directory. |
| `--workspace` |  | Mutate every package in the workspace. |
| `--error` | `<EXPR>` | Additional values for `fn_value.err_with`, which replaces a function body with `Err(...)`. |

**Cargo features**

| Option | Value | What it does |
| --- | --- | --- |
| `--features` | `<FEATURES>` | Cargo features to activate, comma-separated or repeated. |
| `--all-features` |  | Activate every feature of every selected package. |
| `--no-default-features` |  | Do not activate the `default` feature. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--json` |  | Emit machine-readable JSON instead of text. |
| `--json-report` | `<PATH>` | Write the population as a report document, for `merge` to withdraw retired mutants against. |

### `gamma list files`

List the source files that would be analyzed

```text
cargo gamma list files [OPTIONS]
```

**Selecting what to mutate**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package to analyze. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to apply, as a comma-separated selector list. |
| `--file` | `<GLOB>` | Only mutate files matching these glob patterns. |
| `--exclude-file` | `<GLOB>` | Skip files matching these glob patterns. |
| `--shard-count` | `<COUNT>` | Number of shards to divide the mutants into. |
| `--shard-index` | `<INDEX>` | Which shard to run, from 0. |
| `-D`, `--in-diff` | `<PATH>` | Only mutate lines added or changed by this unified diff, or `-` for standard input. |
| `-p`, `--package` | `<NAME>` | Only mutate these packages. Defaults to Cargo's package selection for the current directory. |
| `--workspace` |  | Mutate every package in the workspace. |
| `--error` | `<EXPR>` | Additional values for `fn_value.err_with`, which replaces a function body with `Err(...)`. |

**Cargo features**

| Option | Value | What it does |
| --- | --- | --- |
| `--features` | `<FEATURES>` | Cargo features to activate, comma-separated or repeated. |
| `--all-features` |  | Activate every feature of every selected package. |
| `--no-default-features` |  | Do not activate the `default` feature. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--json` |  | Emit machine-readable JSON instead of text. |

### `gamma list mutators`

List the mutator registry

```text
cargo gamma list mutators [OPTIONS]
```

**Selecting mutators**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path used to find `gamma.toml`. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to mark as enabled, as a comma-separated selector list. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--json` |  | Emit machine-readable JSON instead of text. |

### `gamma list presets`

List the named mutator presets

```text
cargo gamma list presets [OPTIONS]
```

**Selecting mutators**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path used to find `gamma.toml`. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to mark as enabled, as a comma-separated selector list. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--json` |  | Emit machine-readable JSON instead of text. |

### `gamma explain`

Explain a mutator, a mutant, or a suppression

```text
cargo gamma explain [OPTIONS] <SUBJECT>
```

**Arguments**

| Option | Value | What it does |
| --- | --- | --- |
| `<SUBJECT>` | `<SUBJECT>` | A mutator name, family, preset, or mutant id. |

**Selecting current mutants**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace used to resolve a current mutant ID. Defaults to `.`. |
| `-p`, `--package` | `<NAME>` | Restrict current discovery to these packages. |
| `--workspace` |  | Resolve current mutants across every workspace package. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--report` | `<PATH>` | Read historical verdict context from this cargo-gamma JSON report. |

**Cargo features**

| Option | Value | What it does |
| --- | --- | --- |
| `--features` | `<FEATURES>` | Cargo features to activate, comma-separated or repeated. |
| `--all-features` |  | Activate every feature of every selected package. |
| `--no-default-features` |  | Do not activate the `default` feature. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

### `gamma suppress`

Write suppressions into the source for mutants that cannot usefully be tested

```text
cargo gamma suppress [OPTIONS]
```

**Suppressing**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package whose latest campaign should be used. Defaults to `.`. |
| `--apply` |  | Write and verify the generated directives instead of printing the proposed diff. |
| `--eligible` | `<LIST>` | Which verdicts may be suppressed. Defaults to `timeout,outofmem`. |
| `--allow-dirty` |  | Edit source files that have uncommitted changes. |

**Cache**

| Option | Value | What it does |
| --- | --- | --- |
| `--cache-dir` | `<PATH>` | Read completed or interrupted testing evidence from this cache directory. |

### `gamma unsuppress`

Remove skip directives that no longer suppress anything

```text
cargo gamma unsuppress [OPTIONS]
```

**Selecting what to mutate**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package to analyze. Defaults to `.`. |
| `--mutators` | `<SELECTORS>` | Mutators to apply, as a comma-separated selector list. |
| `--file` | `<GLOB>` | Only mutate files matching these glob patterns. |
| `--exclude-file` | `<GLOB>` | Skip files matching these glob patterns. |
| `--shard-count` | `<COUNT>` | Number of shards to divide the mutants into. |
| `--shard-index` | `<INDEX>` | Which shard to run, from 0. |
| `-D`, `--in-diff` | `<PATH>` | Only mutate lines added or changed by this unified diff, or `-` for standard input. |
| `-p`, `--package` | `<NAME>` | Only mutate these packages. Defaults to Cargo's package selection for the current directory. |
| `--workspace` |  | Mutate every package in the workspace. |
| `--error` | `<EXPR>` | Additional values for `fn_value.err_with`, which replaces a function body with `Err(...)`. |

**Cargo features**

| Option | Value | What it does |
| --- | --- | --- |
| `--features` | `<FEATURES>` | Cargo features to activate, comma-separated or repeated. |
| `--all-features` |  | Activate every feature of every selected package. |
| `--no-default-features` |  | Do not activate the `default` feature. |

**Configuration**

| Option | Value | What it does |
| --- | --- | --- |
| `--config` | `<PATH>` | Read configuration from this file instead of `gamma.toml`. |
| `--no-config` |  | Ignore the configuration file entirely. |

**Suppressing**

| Option | Value | What it does |
| --- | --- | --- |
| `--apply` |  | Remove the directives instead of printing what would be removed. |
| `--allow-dirty` |  | Remove directives from source files that have uncommitted changes. |

### `gamma merge`

Combine per-shard reports into one answer

```text
cargo gamma merge [OPTIONS] <REPORTS>...
```

**Arguments**

| Option | Value | What it does |
| --- | --- | --- |
| `<INPUTS>` | `<REPORTS>` | The reports to merge. A directory is read for its `*.json` files. |

**Reporting**

| Option | Value | What it does |
| --- | --- | --- |
| `--json-report` | `<PATH>` | Write the merged `mutation-testing-elements` document here. |
| `--html-report` | `<PATH>` | Write a self-contained merged HTML report here. |

**Merging**

| Option | Value | What it does |
| --- | --- | --- |
| `--window` | `<DAYS>` | Days after which a verdict is reported as stale. Zero disables the freshness window. Defaults to `30`. |

**Run control**

| Option | Value | What it does |
| --- | --- | --- |
| `--min-score` | `<PERCENT>` | Fail if the merged assertion-killed score is below this percentage. |
| `--max-flaky` | `<COUNT>` | Fail if more than this many merged mutants have an unresolved flaky outcome. |

### `gamma hints`

Promote what a run learned about speed into a file the workspace can check in

```text
cargo gamma hints [OPTIONS]
```

**Options**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package whose latest campaign knowledge should be promoted. Defaults to `.`. |

**Cache**

| Option | Value | What it does |
| --- | --- | --- |
| `--cache-dir` | `<PATH>` | Read the run record from this cache directory instead of cargo-gamma's default. |

**Run control**

| Option | Value | What it does |
| --- | --- | --- |
| `--dry-run` |  | Report what would be promoted without writing anything. |
| `--replace` |  | Replace the complete hints artifact instead of merging the recorded campaign into it. |

### `gamma clean`

Delete cargo-gamma's cached data for a workspace

```text
cargo gamma clean [OPTIONS]
```

**Options**

| Option | Value | What it does |
| --- | --- | --- |
| `-d`, `--dir` | `<PATH>` | Path to the workspace or package whose cache should be deleted. Defaults to `.`. |

### `gamma completions`

Print a shell completion script

```text
cargo gamma completions <SHELL>
```

**Arguments**

| Option | Value | What it does |
| --- | --- | --- |
| `<SHELL>` | `<SHELL>` | The shell to generate a completion script for. |

<!-- end generated -->