clippier 0.2.0

MoosicBox clippier package
Documentation
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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
# Clippier

Monorepo workspace analysis and automation tool for managing multi-package projects, with focus on CI/CD pipeline generation and dependency analysis.

## Overview

Clippier is a command-line utility designed to analyze monorepo workspaces and automate various development tasks. It supports multiple workspace types including Cargo (Rust) and Node.js (npm, pnpm, bun):

- **CI/CD Pipeline Generation**: Generate feature matrices for testing
- **Dependency Analysis**: Analyze workspace dependencies and relationships
- **Feature Management**: Generate feature combinations for comprehensive testing
- **Selective Package Processing**: Filter operations to specific packages for targeted analysis
- **Feature Propagation Validation**: Ensure features are correctly propagated across workspace dependencies
- **Parent Package Validation**: Validate that parent packages expose all features from their workspace dependencies
- **Unified Linting & Formatting**: Auto-detect and run multiple linters and formatters with `check` and `fmt` commands
- **Docker Integration**: Generate optimized Dockerfiles for workspace packages
- **Change Impact Analysis**: Determine which packages are affected by file changes
- **External Dependency Tracking**: Detect changes in external dependencies via git diff analysis
- **Multi-Workspace Support**: Native support for Cargo and Node.js (npm, pnpm, bun) monorepos

## Supported Workspace Types

Clippier supports multiple monorepo workspace types with automatic detection:

### Cargo Workspaces (Rust)

- **Detection**: `Cargo.toml` with `[workspace]` section
- **Lockfile**: `Cargo.lock`
- **Package manifest**: `Cargo.toml`

### Node.js Workspaces

Clippier supports three Node.js package managers:

| Package Manager | Workspace Config                       | Lockfile            |
| --------------- | -------------------------------------- | ------------------- |
| **npm**         | `package.json` with `workspaces` field | `package-lock.json` |
| **pnpm**        | `pnpm-workspace.yaml`                  | `pnpm-lock.yaml`    |
| **bun**         | `package.json` with `workspaces` field | `bun.lock`          |

### Auto-Detection and Priority

When multiple workspace types exist in the same directory:

1. **Cargo** workspaces take priority by default
2. Use `--workspace-type node` to explicitly select Node.js workspace
3. Use `--workspace-type cargo` to explicitly select Cargo workspace

```bash
# Auto-detect (Cargo takes priority if both exist)
clippier packages .

# Explicitly use Node.js workspace
clippier packages . --workspace-type node

# Explicitly use Cargo workspace
clippier packages . --workspace-type cargo
```

## Installation

### From Source

```bash
cargo install --path packages/clippier
```

### Features

Clippier supports optional features:

- **`cargo-workspace`** (default): Enable support for Cargo (Rust) workspaces
- **`node-workspace`** (default): Enable support for Node.js workspaces (npm, pnpm, bun)
- **`check`** (default): Enable the `check` command for running linters
- **`format`** (default): Enable the `fmt` command for running formatters
- **`git-diff`** (default): Enhanced change analysis using git diff to detect external dependency changes
- **`publish`** (default): Enable the `publish` command for Cargo workspace crate publishing
- **`transforms-vendored`** (default): Enable Lua transform scripts with vendored Lua runtime
- **`transforms-system`**: Enable Lua transform scripts using system Lua installation
- **`fail-on-warnings`**: Fail build on warnings

## Usage

Clippier provides several subcommands for different analysis tasks:

### Dependencies Analysis

Analyze workspace dependencies for a specific package:

```bash
clippier dependencies Cargo.toml --output json
```

With specific OS and feature filters:

```bash
clippier dependencies Cargo.toml --os linux --features "feature1,feature2"
```

### Environment Configuration

Generate environment configurations:

```bash
clippier environment Cargo.toml --os ubuntu-latest --output json
```

### CI Steps Generation

Generate CI pipeline steps for testing:

```bash
clippier ci-steps Cargo.toml --os ubuntu-latest --features "default,feature1"
```

### Feature Matrix Analysis

Analyze and generate feature combinations for testing:

```bash
clippier features Cargo.toml \
  --max 10 \
  --max-parallel 4 \
  --chunked 2 \
  --spread \
  --randomize \
  --features "default,audio,video" \
  --skip-features "test,dev" \
  --output json
```

#### Wildcard Pattern Support in skip-features

The `--skip-features` flag supports powerful wildcard patterns and negation:

**Wildcard Patterns:**

```bash
# Skip all features ending with -default
clippier features Cargo.toml --skip-features "*-default" --output json

# Skip all features starting with test-
clippier features Cargo.toml --skip-features "test-*" --output json

# Skip features with single character after prefix (v1, v2, but not v10)
clippier features Cargo.toml --skip-features "v?" --output json

# Combine multiple patterns
clippier features Cargo.toml --skip-features "*-default,test-*,dev-*" --output json
```

**Negation Patterns (Skip All Except):**

```bash
# Skip everything except enable-bob
clippier features Cargo.toml --skip-features "*,!enable-bob" --output json

# Skip everything except features starting with enable-
clippier features Cargo.toml --skip-features "*,!enable-*" --output json

# Complex: skip *-default and test-* features, but keep test-utils
clippier features Cargo.toml \
  --skip-features "*-default,test-*,!test-utils" \
  --output json
```

**Pattern Syntax:**

| Pattern     | Matches                            | Example                                            |
| ----------- | ---------------------------------- | -------------------------------------------------- |
| `*`         | Zero or more characters            | `*-default` matches `bob-default`, `sally-default` |
| `?`         | Exactly one character              | `v?` matches `v1`, `v2` but not `v10`              |
| `!pattern`  | Negation (excludes matching items) | `*,!enable-bob` includes all except `enable-bob`   |
| Exact match | No wildcards                       | `default` matches only `default`                   |

**Pattern Evaluation:**

- Patterns are evaluated in order from left to right
- For `--skip-features`: The last matching pattern determines if a feature is skipped
- For `--features`, `--packages`, `--required-features`: Negations remove items from the result set
- Negation (`!`) works in all wildcard-supporting arguments

**Configuration File Usage:**

```toml
[[config]]
os = "ubuntu"
rust = { skip-features = ["*-default", "test-*", "!test-utils"] }
```

#### Wildcard Pattern Support in --features

The `--features` flag supports wildcard patterns and negation for selecting features:

```bash
# Include all features starting with enable-
clippier features Cargo.toml --features "enable-*" --output json

# Include multiple wildcard patterns
clippier features Cargo.toml --features "enable-*,test-*" --output json

# Mix exact features with wildcards
clippier features Cargo.toml --features "enable-*,production,default" --output json

# Use negation to include all except specific features
clippier features Cargo.toml --features "*,!test-*" --output json

# Include enable-* features except enable-experimental
clippier features Cargo.toml --features "enable-*,!enable-experimental" --output json

# Combine with skip-features for powerful filtering
clippier features Cargo.toml \
  --features "enable-*,test-*" \
  --skip-features "test-integration" \
  --output json
```

**Note:** The `--features` flag uses **inclusion** (expand matching features), while `--skip-features` uses **exclusion** (remove matching features). Both support negation with `!` prefix. They can be combined for precise control.

#### Wildcard Pattern Support in --required-features

The `--required-features` flag supports wildcard patterns and negation for specifying required features. These patterns are **expanded to concrete feature names** in the JSON output, making them suitable for consumption by CI tools and scripts.

```bash
# Require all features starting with enable-
clippier features Cargo.toml --required-features "enable-*" --output json

# Require multiple wildcard patterns
clippier features Cargo.toml --required-features "enable-*,test-*" --output json

# Mix exact features with wildcards
clippier features Cargo.toml --required-features "enable-*,production,default" --output json

# Use negation to require enable-* except enable-experimental
clippier features Cargo.toml --required-features "enable-*,!enable-experimental" --output json

# Combine with other feature flags
clippier features Cargo.toml \
  --features "enable-*,production" \
  --skip-features "test-*,!test-utils" \
  --required-features "enable-*,!enable-experimental" \
  --output json
```

**Important:** Unlike `--skip-features` (which removes features) and `--features` (which selects features to process), `--required-features` is **metadata** that gets included in the JSON output. Wildcards and negations are expanded so downstream consumers receive concrete feature names, not glob patterns.

**Example output:**

```json
{
  "name": "my-package",
  "features": ["default", "production", "enable-bob"],
  "requiredFeatures": ["enable-bob", "enable-sally", "enable-feature"],
  "os": "ubuntu-latest",
  ...
}
```

**Configuration File Usage:**

```toml
[[config]]
os = "ubuntu"
rust = { required-features = ["enable-*", "production"] }
```

The wildcards will be expanded when the configuration is processed, ensuring the JSON output contains concrete feature names.

#### Deterministic Randomization with Seed

Use a specific seed for reproducible randomized feature combinations:

```bash
clippier features Cargo.toml \
  --chunked 3 \
  --randomize \
  --seed 12345 \
  --output json
```

When `--randomize` is used without `--seed`, a random seed is generated and printed to stderr (not affecting JSON output):

```bash
clippier features Cargo.toml \
  --chunked 3 \
  --randomize \
  --output json
# Outputs: Generated seed: 1234567890 (to stderr)
```

This enables replaying the same randomized distribution by using the printed seed value.

#### Package Filtering

Filter feature matrix generation to specific packages by name or by Cargo.toml properties:

**Wildcard Pattern Support:**

The `--packages` flag supports wildcard patterns for selecting packages:

```bash
# Process all packages starting with moosicbox_
clippier features . --packages "moosicbox_*" --output json

# Process all server packages except test servers
clippier features . --packages "*_server,!*_test_server" --output json

# Process specific API packages
clippier features . --packages "moosicbox_*_api" --output json

# Mix wildcards with exact names
clippier features . --packages "moosicbox_server,moosicbox_*_api,core" --output json
```

**Property-Based Filtering:**

```bash
# Filter by package properties (exclude unpublished and examples)
clippier features . \
  --skip-if "package.publish=false" \
  --skip-if "package.name$=_example" \
  --output json

# Include only packages with specific characteristics
clippier features . \
  --include-if "package.name^=moosicbox_" \
  --include-if "package.categories@=audio" \
  --output json
```

**Combined Filtering:**

```bash
# Combine wildcards with other filters
clippier features . \
  --packages "moosicbox_*_server" \
  --os ubuntu \
  --features "enable-*,production" \
  --skip-features "test-*" \
  --output json
```

This is particularly useful for:

- **Focused testing**: Test only specific packages during development
- **CI optimization**: Build matrix for selected components based on criteria
- **Monorepo management**: Process subsets of large workspaces with naming conventions
- **Quality gates**: Filter by documentation completeness, categories, etc.

#### Enhanced Change Impact Analysis

Include only features for packages affected by specific file changes:

```bash
clippier features Cargo.toml \
  --changed-files "src/lib.rs,packages/server/src/main.rs" \
  --max 10 \
  --output json
```

#### Git-Based External Dependency Analysis (Requires git-diff feature)

Analyze feature matrices considering both file changes and external dependency changes:

```bash
clippier features Cargo.toml \
  --changed-files "Cargo.lock,src/lib.rs" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --max 10 \
  --output json
```

### Packages Command

Generate a list of workspace packages (useful for CI matrix generation with one job per package):

```bash
# List all packages in workspace
clippier packages . --output json

# List packages for specific OS
clippier packages . --os ubuntu --output json

# Filter to specific packages
clippier packages . --packages "server,auth,database" --output json

# Limit number of packages (useful for parallel job limits)
clippier packages . --max-parallel 10 --output json
```

#### With Change Detection (Requires git-diff feature)

List only packages affected by file changes:

```bash
# Using manual changed files
clippier packages . \
  --changed-files "src/lib.rs,packages/server/src/main.rs" \
  --output json

# Using git diff
clippier packages . \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --output json

# Combined: manual files + git diff + external dependency tracking
clippier packages . \
  --changed-files "Cargo.lock" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --output json
```

#### Node.js Workspaces

The packages command works with Node.js monorepos (npm, pnpm, bun):

```bash
# List packages in a Node.js monorepo (auto-detected from lockfile)
clippier packages . --output json

# Explicitly use Node.js workspace type
clippier packages . --workspace-type node --output json

# With change detection using lockfile changes
clippier packages . \
  --workspace-type node \
  --changed-files "pnpm-lock.yaml,packages/api/src/index.ts" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --output json
```

The packages command provides:

- **Package enumeration**: List all workspace packages with metadata
- **Change-based filtering**: Only include packages affected by specific changes
- **Git integration**: Automatically detect changed files from git commits
- **External dependency tracking**: Detect packages affected by lockfile changes (Cargo.lock, pnpm-lock.yaml, package-lock.json, bun.lock)
- **CI matrix optimization**: Generate one job per package instead of per feature
- **Multi-workspace support**: Works with Cargo, npm, pnpm, and bun workspaces

**Output format:**

```json
[
    {
        "name": "server",
        "path": "packages/server",
        "os": "ubuntu-latest"
    },
    {
        "name": "auth",
        "path": "packages/auth",
        "os": "ubuntu-latest"
    }
]
```

**Use cases:**

- **CI/CD**: Generate job matrices for parallel package testing
- **Change analysis**: Identify which packages need rebuilding
- **Monorepo management**: List subsets of packages for targeted operations
- **Documentation**: Generate package inventories for workspace documentation

### Publish Cargo Workspace Crates

Publish all crates in a Cargo workspace, skipping versions that already exist on crates.io and ordering unpublished crates by normal/build workspace dependencies:

```bash
# Publish from the current directory
clippier publish

# Preview what would be published
clippier publish --dry-run

# Publish one package plus its normal/build workspace dependencies
clippier publish --package moosicbox_audio_output

# Use an explicit workspace path
clippier publish /path/to/workspace
```

`clippier publish` ignores dev-dependencies when computing publish order so dev-dependency cycles do not block publication. It publishes from a temporary sanitized manifest with workspace dev-dependencies removed and workspace dependency inheritance resolved. It defaults to `cargo publish --no-verify`; pass `--verify` to run Cargo's local verification step.

### Workspace Dependencies

Find all workspace dependencies for a package:

```bash
clippier workspace-deps /path/to/workspace package-name --format json
```

Include specific features:

```bash
clippier workspace-deps /path/to/workspace package-name \
  --features "feature1,feature2" \
  --format text
```

#### All Potential Dependencies Mode

Include all potential workspace dependencies (useful for Docker builds):

```bash
clippier workspace-deps /path/to/workspace package-name \
  --all-potential-deps \
  --format json
```

This mode includes all workspace dependencies regardless of feature activation, ensuring Docker builds have access to all required packages for build compatibility.

### Generate Dockerfile

Automatically generate optimized multi-stage Dockerfiles:

```bash
clippier generate-dockerfile /path/to/workspace target-package \
  --features "feature1,feature2" \
  --output ./Dockerfile \
  --base-image rust:1-bookworm \
  --final-image debian:bookworm-slim \
  --build-args "--release" \
  --generate-dockerignore true
```

The generated Dockerfiles include:

- Multi-stage builds for optimized layer caching
- Automatic system dependency detection from `clippier.toml` files
- Workspace member optimization
- Build artifact caching
- Runtime dependency installation

### Affected Packages Analysis

Determine which packages are affected by file changes:

```bash
clippier affected-packages /path/to/workspace \
  --changed-files "src/lib.rs,Cargo.toml,packages/server/src/main.rs" \
  --target-package server \
  --output json
```

#### Enhanced Git-Based Analysis (Requires git-diff feature)

Analyze impact including external dependency changes from Cargo.lock:

```bash
clippier affected-packages /path/to/workspace \
  --changed-files "Cargo.lock,src/lib.rs,packages/server/src/main.rs" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --output json
```

This enhanced mode:

- Detects changes in external dependencies by analyzing lockfile diff (Cargo.lock, pnpm-lock.yaml, package-lock.json, bun.lock)
- Maps external dependency changes to affected workspace packages
- Provides comprehensive impact analysis for both internal and external changes
- Works with both Cargo and Node.js workspaces

#### Node.js Workspaces

```bash
# Analyze affected packages in a Node.js monorepo
clippier affected-packages /path/to/workspace \
  --workspace-type node \
  --changed-files "pnpm-lock.yaml,packages/api/src/index.ts" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --output json
```

### Feature Propagation Validation

Validate that features are correctly propagated across workspace dependencies to ensure consistent builds and prevent feature-related compilation failures:

```bash
# Quick validation of fail-on-warnings feature
clippier validate-feature-propagation . --features "fail-on-warnings"

# Auto-detect and validate all matching features
clippier validate-feature-propagation . --output json

# Validate specific packages only
clippier validate-feature-propagation . --workspace-only --features "fail-on-warnings"
```

The feature validator ensures that when a package depends on another workspace package that has a specific feature, that feature is correctly propagated. This prevents build failures where features are inconsistently enabled across the dependency graph.

#### Common Use Cases

**Validate fail-on-warnings propagation:**

```bash
clippier validate-feature-propagation . --features "fail-on-warnings"
```

**Auto-detect features that need propagation:**

```bash
# Automatically finds features that exist in multiple packages
clippier validate-feature-propagation . --workspace-only
```

**CI/CD Integration:**

```bash
clippier validate-feature-propagation . \
  --features "fail-on-warnings" \
  --output json
```

**Get detailed JSON report:**

```bash
clippier validate-feature-propagation . \
  --features "fail-on-warnings,std,async" \
  --workspace-only \
  --output json > validation-report.json
```

#### Understanding Validation Results

The validator provides clear feedback about feature propagation issues:

**Successful validation:**

```
✅ All packages correctly propagate features!
Total packages checked: 147
Valid packages: 147
```

**Validation with errors:**

```
❌ Found 2 packages with incorrect feature propagation:

📦 Package: moosicbox_server
  Feature: fail-on-warnings
    Missing propagations:
      - moosicbox_tcp/fail-on-warnings (Dependency 'moosicbox_tcp' has feature but it's not propagated)
```

#### Error Types and Meanings

The validator detects two types of issues:

**Missing Propagations:**

- A dependency has a feature but it's not propagated
- Example: `pkg_a` depends on `pkg_b` which has `fail-on-warnings`, but `pkg_a` doesn't propagate it
- Fix: Add `"pkg_b/fail-on-warnings"` to the feature definition in `pkg_a`

**Incorrect Propagations:**

- A feature is propagated to a non-existent dependency or feature
- Example: `pkg_a` propagates `pkg_b/feature` but `pkg_b` doesn't have `feature`
- Fix: Remove the incorrect propagation or add the missing feature to the dependency

**Optional Dependencies:**
The validator correctly handles optional dependencies using the `?` syntax:

- `dep?/feature` - Propagates feature only when the optional dependency is activated
- Required for dependencies marked with `optional = true` in Cargo.toml

#### Overriding Validation Errors

Sometimes you need to suppress specific validation errors on a case-by-case basis. Clippier supports three methods for overriding validation failures, with clear precedence rules:

**Override Precedence (Highest to Lowest):**

1. CLI arguments (temporary overrides for testing)
2. Package-level `clippier.toml` (package-specific configuration)
3. Package-level `Cargo.toml` metadata (inline configuration)
4. Workspace-level `clippier.toml` (workspace-wide defaults)

**CLI Overrides (Quick Testing):**

```bash
# Allow a specific missing propagation
clippier validate-feature-propagation . \
  --features "fail-on-warnings" \
  --allow-missing "server:fail-on-warnings:legacy_dep"

# Allow missing propagation for all packages
clippier validate-feature-propagation . \
  --allow-missing "fail-on-warnings:legacy_dep"

# Ignore specific packages entirely
clippier validate-feature-propagation . \
  --ignore-package "experimental_*" \
  --ignore-package "wip_module"

# Ignore specific features globally
clippier validate-feature-propagation . \
  --ignore-feature "unstable-*"
```

**Package-Level clippier.toml (Recommended for Persistent Overrides):**

```toml
# packages/server/clippier.toml
[feature-validation]
[[feature-validation.override]]
feature = "fail-on-warnings"
dependency = "legacy_tcp"
type = "allow-missing"
reason = "Legacy dependency doesn't support fail-on-warnings - tracked in #123"
expires = "2025-12-31"

[[feature-validation.override]]
feature = "async-*"
dependency = "sync_util"
type = "allow-missing"
reason = "Utility crate is intentionally synchronous"
```

**Workspace-Level clippier.toml (Workspace-Wide Policies):**

```toml
# {workspace_root}/clippier.toml
[feature-validation]
[[feature-validation.override]]
feature = "*"
dependency = "external_vendor_*"
type = "allow-missing"
reason = "Vendor dependencies don't follow our feature conventions"
```

**Package Cargo.toml Metadata (Inline Configuration):**

```toml
# packages/server/Cargo.toml
[package.metadata.clippier.feature-validation]
[[package.metadata.clippier.feature-validation.override]]
feature = "fail-on-warnings"
dependency = "some_dep"
type = "allow-missing"
reason = "Dependency issue tracked in #456"
```

**Override Types:**

- `allow-missing` - Allow a specific missing propagation
- `allow-incorrect` - Allow a specific incorrect propagation
- `suppress` - Suppress all validation for matching cases

**Wildcard Support:**

Overrides support wildcard patterns for flexible matching:

```toml
[[feature-validation.override]]
feature = "async-*"        # Matches async-io, async-runtime, etc.
dependency = "*_sync"      # Matches util_sync, core_sync, etc.
type = "allow-missing"
reason = "Sync dependencies don't support async features"
```

**Expiration Dates:**

Add expiration dates to temporary overrides to ensure they're revisited:

```toml
[[feature-validation.override]]
feature = "fail-on-warnings"
dependency = "legacy_dep"
type = "allow-missing"
reason = "Migration in progress"
expires = "2025-12-31"  # RFC 3339 or YYYY-MM-DD format
```

**Output with Overrides:**

When overrides are applied, the validation output includes a summary:

```
🔍 Feature Propagation Validation Results
=========================================
Total packages checked: 147
Valid packages: 147

📋 Override Summary:
  Applied: 3 overrides
    - cli: 1
    - package-clippier-toml: 2

🔕 Overridden Errors (3):
  📦 server:fail-on-warnings:legacy_tcp
    Reason: Legacy dependency migration in progress
    Source: PackageClippierToml
    Expires: 2025-12-31

✅ All packages correctly propagate features (with 3 overrides)!
```

**Advanced Override Options:**

```bash
# Fail if any overrides have expired
clippier validate-feature-propagation . \
  --fail-on-expired

# Show detailed override information
clippier validate-feature-propagation . \
  --verbose-overrides
```

#### Parent Package Validation

Parent packages are packages that aggregate and re-export features from their workspace dependencies. The validator can ensure that parent packages correctly expose all features from their dependencies with appropriate naming conventions.

**What is a Parent Package?**

A parent package typically:

- Depends on multiple workspace packages
- Re-exports features from those dependencies using a prefix pattern
- Acts as a facade for a subsystem of the workspace

For example, if `moosicbox_app` depends on `moosicbox_audio` which has features `mp3`, `flac`, and `aac`, the parent should expose them as `audio-mp3`, `audio-flac`, and `audio-aac`.

**CLI Usage:**

```bash
# Validate specific packages as parent packages
clippier validate-feature-propagation . \
  --parent-packages "moosicbox_app,moosicbox_server"

# Limit depth of dependency chain checking
clippier validate-feature-propagation . \
  --parent-packages "moosicbox_app" \
  --parent-depth 2

# Skip additional features during parent validation
clippier validate-feature-propagation . \
  --parent-packages "moosicbox_app" \
  --parent-skip-features "unstable,experimental"

# Override prefix for specific dependencies
clippier validate-feature-propagation . \
  --parent-packages "moosicbox_app" \
  --parent-prefix "moosicbox_audio:audio" \
  --parent-prefix "moosicbox_video:vid"

# Disable loading parent config from clippier.toml
clippier validate-feature-propagation . \
  --parent-packages "moosicbox_app" \
  --no-parent-config
```

**Package-Level Configuration (clippier.toml):**

```toml
# packages/moosicbox_app/clippier.toml
[feature-validation]

# Declare this package as a parent package
[feature-validation.parent]
enabled = true
depth = 2  # Only check direct deps and their deps (optional)
skip-features = ["internal-*", "test-*"]  # Additional features to skip

# Override prefixes for specific dependencies
[[feature-validation.parent.prefix]]
dependency = "moosicbox_audio"
prefix = "audio"

[[feature-validation.parent.prefix]]
dependency = "moosicbox_video"
prefix = "video"
```

**Workspace-Level Configuration (clippier.toml):**

```toml
# {workspace_root}/clippier.toml
[feature-validation]

# Declare parent packages at workspace level
[[feature-validation.parent-packages]]
package = "moosicbox_app"
depth = 2

[[feature-validation.parent-packages]]
package = "moosicbox_server"

# Global prefix overrides
[[feature-validation.parent-prefix]]
dependency = "moosicbox_audio"
prefix = "audio"
```

**Understanding Prefix Inference:**

By default, the validator infers the prefix from the dependency name:

- `moosicbox_audio``audio`
- `switchy_database``database`
- `my_lib``lib`

The prefix is derived by taking the last segment after underscores. You can override this with explicit prefix configuration.

**Validation Output:**

```
🔍 Feature Propagation Validation Results
=========================================
Total packages checked: 147
Valid packages: 147

📦 Parent Package Validation
=============================

📦 Package: moosicbox_app
  Dependencies checked: 5
  Features checked: 42
  Features correctly exposed: 40

  ❌ Missing Feature Exposures:
    Dependency: moosicbox_audio
      Feature: experimental-codec
      Expected parent feature: audio-experimental-codec
      Expected propagation: moosicbox_audio?/experimental-codec
      Depth: 1

    Dependency: moosicbox_video (via moosicbox_media)
      Feature: av1
      Expected parent feature: video-av1
      Expected propagation: moosicbox_video?/av1
      Depth: 2
      Chain: moosicbox_app -> moosicbox_media -> moosicbox_video
```

**Parent Validation Options:**

| Option                   | Description                                           | Default             |
| ------------------------ | ----------------------------------------------------- | ------------------- |
| `--parent-packages`      | Packages to validate as parent packages               | From config         |
| `--parent-depth`         | Max depth for nested dependency checking (None = all) | None (unlimited)    |
| `--parent-skip-features` | Additional features to skip                           | `["default", "_*"]` |
| `--parent-prefix`        | Override prefix for dependencies (`dep:prefix`)       | Auto-inferred       |
| `--no-parent-config`     | Disable loading parent config from clippier.toml      | false               |

### Check Command (Linting)

Run all available linters in your workspace with automatic tool detection:

```bash
# Run all detected linters
clippier check

# Run in a specific directory
clippier check --working-dir /path/to/project

# Run only specific tools
clippier check --tools "clippy,eslint"

# List available tools without running them
clippier check --list

# Include execution metadata in JSON output (`cargo` / `binary` / `runner`)
clippier check --list --output json

# Require specific tools (fail if not installed)
clippier check --required "clippy,prettier"

# Skip specific tools
clippier check --skip "shellcheck"

# JSON output for CI integration
clippier check --output json
```

`check`/`fmt` also load default tool settings from a `clippier.toml` in the working directory:

```toml
[tools]
skip = ["gofmt"]
required = ["rustfmt", "taplo"]
runner-fallback = true
biome-use-editorconfig = true
biome-use-vcs-ignore = true

[[tools.overlap-warning-suppress]]
capability = "format"
tools = ["biome", "prettier"]
extensions = ["md", "mdx"]
```

CLI values are additive: `--skip` and `--required` are merged with config values.

The `check` command automatically detects and runs:

- **Rust**: `cargo clippy` (with `-D warnings` for zero-warnings policy)
- **TOML**: `taplo fmt --check`
- **JavaScript/TypeScript**: `biome format`, `eslint`
- **Markdown/MDX**: `clippier_md` strict check
- **YAML**: `dprint check`
- **Python**: `ruff check`, `black --check`
- **Go**: `gofmt -l`
- **Shell**: `shfmt -d`, `shellcheck`

Tools run in parallel by default for maximum performance.

By default, `check` auto-selects tools based on manifest/config files in the working directory:

- `Cargo.toml` -> `clippy`, `rustfmt`, `taplo`
- `package.json` -> `eslint`, `biome`
- `pyproject.toml`, `requirements.txt`, or `setup.py` -> `ruff`, `black`
- `go.mod` -> `gofmt`
- `taplo.toml` -> `taplo`
- `.shellcheckrc` -> `shellcheck`
- `dprint.json`/`dprint.jsonc` -> `dprint`
- workspace includes `packages/clippier/md/Cargo.toml` -> `clippier_md`

### Fmt Command (Formatting)

Run all available formatters to fix formatting issues:

```bash
# Format all files
clippier fmt

# Check formatting without modifying files
clippier fmt --check

# Run in a specific directory
clippier fmt --working-dir /path/to/project

# Run only specific formatters
clippier fmt --tools "rustfmt,prettier"

# List available formatters without running them
clippier fmt --list

# Include execution metadata in JSON output (`cargo` / `binary` / `runner`)
clippier fmt --list --output json

# Require specific formatters (fail if not installed)
clippier fmt --required "rustfmt"

# Skip specific formatters
clippier fmt --skip "gofmt"

# JSON output for CI integration
clippier fmt --output json
```

The `fmt` command automatically detects and runs:

- **Rust**: `cargo fmt`
- **TOML**: `taplo fmt`
- **JavaScript/TypeScript**: `biome format --write`
- **Markdown/MDX**: `clippier_md fmt`
- **YAML**: `dprint fmt`
- **Python**: `ruff format`, `black`
- **Go**: `gofmt -w`
- **Shell**: `shfmt -w`

By default, `fmt` auto-selects tools based on manifest/config files in the working directory:

- `Cargo.toml` -> `rustfmt`, `taplo`
- `package.json` -> `biome`
- `pyproject.toml`, `requirements.txt`, or `setup.py` -> `ruff`, `black`
- `go.mod` -> `gofmt`
- `taplo.toml` -> `taplo`
- `.shfmt.conf` -> `shfmt`
- `dprint.json`/`dprint.jsonc` -> `dprint`
- workspace includes `packages/clippier/md/Cargo.toml` -> `clippier_md`

Clippier only selects and runs tools that are already installed; it never installs tools or modifies your system environment.

Tool resolution precedence (for `prettier`, `biome`, `eslint`, `dprint`, `remark`, and `clippier_md`) is:

1. CLI `--tool-path key=value` override
2. Configured path in `tools.paths.<tool>`
3. `node_modules/.bin/<tool>` in the working directory or ancestors
4. Standalone `<tool>` in PATH
5. Package-manager runner fallback (enabled by default): `bunx`, then `pnpm dlx`, then `npx --yes`

Use `--no-runner-fallback` to disable runner fallback for a command.
Prettier is invoked with `--ignore-unknown` for unsupported file types. Use `.prettierignore` for parser-supported files you want excluded from formatting.
`clippier_md` provides native strict check behavior for markdown in `fmt --check` and is the default markdown formatter in this workspace.

When both `biome` and `prettier` are explicitly selected, clippier emits overlap warnings when they can target the same extensions.
Overlap warnings are computed dynamically from files currently present in the working directory plus relevant tool config filters (`biome.json` `files.includes` and `.prettierignore`).

Suppress overlap warnings with pair-specific config rules (case-insensitive tool/extension matching):

```toml
[tools]

[[tools.overlap-warning-suppress]]
capability = "format"
tools = ["biome", "prettier"]
extensions = ["md", "mdx"]
```

Use `extensions = []` (or omit `extensions`) to suppress all overlap warnings for a pair/capability.

Biome uses `.editorconfig` by default (`--use-editorconfig=true`). You can opt out via config (`tools.biome-use-editorconfig = false`) or CLI (`--no-biome-use-editorconfig`).

Biome also uses VCS ignore semantics by default (`--vcs-enabled=true --vcs-use-ignore-file=true --vcs-root <working-dir>`). You can opt out via config (`tools.biome-use-vcs-ignore = false`) or CLI (`--no-biome-use-vcs-ignore`).

Precedence for tool selection is:

1. `--tools` (explicit tool list)
2. Auto-detected manifest/config defaults
3. CLI/config `required`
4. `skip`

When a tool appears in both `required` and `skip`, `skip` wins. When a tool appears in both `--tools` and `skip`, `--tools` wins.

Color behavior for tool output:

- `--color auto` follows terminal detection
- `--color always` forces colors in child tool output
- `--color never` disables colors in child tool output
- For `--output json` with `--color auto`, clippier disables colors to keep JSON payloads clean

TUI behavior for tool output:

- In interactive terminals, `check` and `fmt` auto-enable a live pane TUI while tools are running
- Use `--no-tui` to disable live panes and keep non-interactive streaming behavior
- Pane output renders ANSI SGR colors/styles from tool output directly in the TUI
- Carriage-return updates (progress/spinner style output) are rendered as in-place line updates in focused panes
- Pane titles show `updating` while recent carriage-return updates are active
- Press `q` or `Ctrl-C` while TUI is visible to close only the TUI view
- Use `Tab`/`Shift+Tab` (or left/right arrows) to switch focused pane; use `j`/`k`, up/down, page up/down, home/end to scroll focused output
- After the TUI view closes, pressing `Ctrl-C` cancels running tools and exits clippier
- After tools complete, clippier exits the TUI and prints full sectioned raw output as usual

#### Supported Tools

| Tool          | Language/Format         | Capabilities | Detection                                                                 |
| ------------- | ----------------------- | ------------ | ------------------------------------------------------------------------- |
| `rustfmt`     | Rust                    | Format       | `cargo` in PATH                                                           |
| `clippy`      | Rust                    | Lint         | `cargo` in PATH                                                           |
| `taplo`       | TOML                    | Format, Lint | `taplo` binary                                                            |
| `prettier`    | JS/TS/JSON/MD/YAML/etc. | Format       | `prettier` from explicit path, local bin, PATH, or bunx/pnpm/npx fallback |
| `biome`       | JS/TS/JSON              | Format, Lint | `biome` from explicit path, local bin, PATH, or bunx/pnpm/npx fallback    |
| `eslint`      | JS/TS                   | Lint         | `eslint` from explicit path, local bin, PATH, or bunx/pnpm/npx fallback   |
| `dprint`      | Multi-language          | Format, Lint | `dprint` from explicit path, local bin, PATH, or bunx/pnpm/npx fallback   |
| `clippier_md` | Markdown/MDX            | Format       | `cargo run -p clippier_md -- fmt`                                         |
| `remark`      | Markdown/MDX            | Format       | `remark` from explicit path, local bin, PATH, or bunx/pnpm/npx fallback   |
| `mdformat`    | Markdown                | Format       | `mdformat` binary, `uvx` fallback, or Nix ephemeral fallback              |
| `yamlfmt`     | YAML                    | Format       | `yamlfmt` binary or Nix ephemeral fallback                                |
| `ruff`        | Python                  | Format, Lint | `ruff` binary                                                             |
| `black`       | Python                  | Format       | `black` binary                                                            |
| `gofmt`       | Go                      | Format       | `gofmt` binary                                                            |
| `shfmt`       | Shell                   | Format       | `shfmt` binary                                                            |
| `shellcheck`  | Shell                   | Lint         | `shellcheck` binary                                                       |

#### Output Format (JSON)

```json
{
    "success": false,
    "total": 4,
    "passed": 3,
    "failed": 1,
    "duration_ms": 2345,
    "results": [
        {
            "name": "rustfmt",
            "display_name": "Rust Formatter",
            "success": true,
            "exit_code": 0,
            "duration_ms": 1234
        },
        {
            "name": "clippy",
            "display_name": "Rust Linter",
            "success": false,
            "exit_code": 1,
            "duration_ms": 567,
            "stderr": "error: unused variable..."
        }
    ]
}
```

#### CI Integration Example

```yaml
name: Lint & Format Check
on: [push, pull_request]

jobs:
    check:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v4

            - name: Install tools
              run: |
                  cargo install clippier taplo-cli
                  npm install -g prettier

            - name: Check formatting
              run: clippier fmt --check

            - name: Run linters
              run: clippier check
```

### Docker Deployment

Generate production-ready Dockerfiles with comprehensive dependency analysis:

```bash
# Generate Dockerfile for server package with all potential dependencies
clippier generate-dockerfile . server \
  --features "production,postgres" \
  --output docker/Dockerfile.server \
  --build-args "--release --locked"
```

### Change Impact Analysis

Determine test scope based on changed files and external dependencies:

```bash
# Find affected packages from git changes including external deps
CHANGED=$(git diff --name-only HEAD~1)
clippier affected-packages . \
  --changed-files "$CHANGED" \
  --git-base "HEAD~1" \
  --git-head "HEAD" \
  --output json
```

### Smart Workspace Dependency Management

Analyze workspace dependencies with different levels of detail:

```bash
# Get minimal dependencies for current features
clippier workspace-deps . my-package --features "default,feature1"

# Get all potential dependencies for Docker builds
clippier workspace-deps . my-package --all-potential-deps --format json
```

### Workspace Toolchains

Aggregate toolchains and dependencies from all workspace packages for CI setup:

```bash
# Get aggregated toolchain information for CI setup
clippier workspace-toolchains . --os ubuntu --output json
```

This command scans all packages in the workspace and collects their toolchains, dependencies, CI steps, and environment variables for the specified OS. Useful for workspace-level CI setup.

**Output format:**

```json
{
    "dependencies": ["sudo apt-get install -y libssl-dev"],
    "toolchains": ["cargo-machete", "taplo"],
    "ci_steps": ["cargo fmt --check"],
    "env": { "RUST_BACKTRACE": "1" },
    "nightly_packages": ["experimental_package"],
    "git_submodules": false
}
```

## Command Line Options

### Common Command Options

These options are shared across multiple subcommands (they are not top-level global flags).

| Option             | Description                                                           |
| ------------------ | --------------------------------------------------------------------- |
| `--output`         | Output format: `json`, `raw`                                          |
| `--workspace-type` | Workspace type to use: `cargo`, `node` (auto-detect if not specified) |

### Features Command Options

| Option                | Description                                                             | Default      |
| --------------------- | ----------------------------------------------------------------------- | ------------ |
| `--os`                | Target operating system                                                 | -            |
| `--workspace-type`    | Workspace type: `cargo`, `node` (auto-detect if not specified)          | Auto-detect  |
| `--offset`            | Skip first N features                                                   | 0            |
| `--max`               | Maximum number of features                                              | All          |
| `--max-parallel`      | Maximum parallel jobs                                                   | -            |
| `--chunked`           | Group features into chunks                                              | -            |
| `--spread`            | Spread features across jobs                                             | false        |
| `--randomize`         | Randomize features before chunking/spreading                            | false        |
| `--seed`              | Seed for deterministic randomization                                    | -            |
| `--features`          | Features to include (supports wildcards `*`, `?` and negation `!`)      | -            |
| `--skip-features`     | Features to exclude (supports wildcards `*`, `?` and negation `!`)      | -            |
| `--required-features` | Always-required features (supports wildcards `*`, `?` and negation `!`) | -            |
| `--packages`          | Packages to process (supports wildcards `*`, `?` and negation `!`)      | All packages |
| `--changed-files`     | Filter by changed files                                                 | -            |
| `--git-base`          | Git base commit for external dep analysis                               | -            |
| `--git-head`          | Git head commit for external dep analysis                               | -            |
| `--skip-if`           | Skip packages matching manifest filter                                  | -            |
| `--include-if`        | Include only packages matching filter                                   | -            |
| `--ignore`            | Glob patterns to ignore when detecting affected packages                | -            |

### Packages Command Options

| Option                | Description                                                        | Default      |
| --------------------- | ------------------------------------------------------------------ | ------------ |
| `--os`                | Target operating system                                            | `ubuntu`     |
| `--workspace-type`    | Workspace type: `cargo`, `node` (auto-detect if not specified)     | Auto-detect  |
| `--packages`          | Packages to include (supports wildcards `*`, `?` and negation `!`) | All packages |
| `--changed-files`     | Filter by changed files                                            | -            |
| `--git-base`          | Git base commit for change detection                               | -            |
| `--git-head`          | Git head commit for change detection                               | -            |
| `--include-reasoning` | Include reasoning for affected packages                            | false        |
| `--max-parallel`      | Maximum number of packages to return                               | -            |
| `--skip-if`           | Skip packages matching manifest filter                             | -            |
| `--include-if`        | Include only packages matching filter                              | -            |
| `--ignore`            | Glob patterns to ignore when detecting affected packages           | -            |
| `--output`            | Output format: `json`, `raw`                                       | `json`       |

### Workspace Dependencies Options

| Option                 | Description                        | Default |
| ---------------------- | ---------------------------------- | ------- |
| `--features`           | Features to enable                 | -       |
| `--format`             | Output format: `json`, `text`      | `text`  |
| `--all-potential-deps` | Include all potential dependencies | false   |

### Docker Generation Options

| Option                    | Description                           | Default                |
| ------------------------- | ------------------------------------- | ---------------------- |
| `--git-ref`               | Git ref when workspace is a git URL   | `master`               |
| `--features`              | Features to enable for target package | -                      |
| `--no-default-features`   | Do not activate default features      | false                  |
| `--base-image`            | Docker builder image                  | `rust:1-bookworm`      |
| `--final-image`           | Docker runtime image                  | `debian:bookworm-slim` |
| `--build-args`            | Cargo build arguments                 | -                      |
| `--generate-dockerignore` | Generate .dockerignore                | true                   |
| `--env`                   | Runtime environment variables         | -                      |
| `--build-env`             | Build-time environment variables      | -                      |
| `--arg`                   | Arguments to pass to binary           | -                      |
| `--bin`                   | Specify binary name                   | Auto-detect            |

### Affected Packages Options

| Option             | Description                                                    | Default     |
| ------------------ | -------------------------------------------------------------- | ----------- |
| `--workspace-type` | Workspace type: `cargo`, `node` (auto-detect if not specified) | Auto-detect |
| `--changed-files`  | List of changed files                                          | Required    |
| `--target-package` | Specific package to check                                      | -           |
| `--git-base`       | Git base commit for external dep analysis                      | -           |
| `--git-head`       | Git head commit for external dep analysis                      | -           |
| `--ignore`         | Glob patterns to ignore when detecting changes                 | -           |
| `--output`         | Output format: `json`, `raw`                                   | `json`      |

### Feature Validation Options

| Option                           | Description                                             | Default             |
| -------------------------------- | ------------------------------------------------------- | ------------------- |
| `--features`                     | Comma-separated list of features to validate            | Auto-detect         |
| `--skip-features`                | Features to skip during validation (supports wildcards) | `["default", "_*"]` |
| `--workspace-only`               | Only validate workspace packages                        | true                |
| `--output`                       | Output format: `json`, `raw`                            | `raw`               |
| `--path`                         | Workspace root path                                     | Current directory   |
| `--fail-on-error`                | Exit with error code if validation fails                | true                |
| `--strict-optional`              | Require `dep?/feature` syntax for optional deps         | false               |
| `--allow-missing`                | Allow specific missing propagations                     | -                   |
| `--allow-incorrect`              | Allow specific incorrect propagations                   | -                   |
| `--ignore-package`               | Suppress validation for specific packages               | -                   |
| `--ignore-feature`               | Suppress validation for specific features               | -                   |
| `--use-config-overrides`         | Load overrides from clippier.toml files                 | true                |
| `--use-cargo-metadata-overrides` | Load overrides from Cargo.toml metadata                 | true                |
| `--warn-expired`                 | Warn about expired overrides                            | true                |
| `--fail-on-expired`              | Fail validation if expired overrides exist              | false               |
| `--verbose-overrides`            | Show detailed override information                      | false               |
| `--parent-packages`              | Packages to validate as parent packages                 | From config         |
| `--parent-depth`                 | Max depth for nested dependency checking                | None (unlimited)    |
| `--parent-skip-features`         | Additional features to skip for parent validation       | -                   |
| `--parent-prefix`                | Override prefix for dependencies (`dep:prefix`)         | Auto-inferred       |
| `--no-parent-config`             | Disable loading parent config from clippier.toml        | false               |

### Workspace Toolchains Options

| Option     | Description                        | Default |
| ---------- | ---------------------------------- | ------- |
| `--os`     | Target operating system (required) | -       |
| `--output` | Output format: `json`, `raw`       | `json`  |

### Check Command Options

| Option                        | Description                                     | Default           |
| ----------------------------- | ----------------------------------------------- | ----------------- |
| `--working-dir`               | Working directory to run in                     | Current directory |
| `--tools`                     | Specific tools to run (comma-separated)         | All detected      |
| `--list`                      | List available tools instead of running them    | false             |
| `--required`                  | Tools that MUST be installed (error if missing) | -                 |
| `--skip`                      | Tools to skip even if detected                  | -                 |
| `--color`                     | Color mode: `auto`, `always`, `never`           | `auto`            |
| `--no-tui`                    | Disable real-time pane TUI output               | `false`           |
| `--no-runner-fallback`        | Disable bunx/pnpm/npx fallback for tools        | `false`           |
| `--tool-path`                 | Override tool path (`key=value`, repeatable)    | -                 |
| `--biome-use-editorconfig`    | Force Biome `.editorconfig` support             | `false`           |
| `--no-biome-use-editorconfig` | Disable Biome `.editorconfig` support           | `false`           |
| `--biome-use-vcs-ignore`      | Force Biome VCS ignore semantics                | `false`           |
| `--no-biome-use-vcs-ignore`   | Disable Biome VCS ignore semantics              | `false`           |
| `--output`                    | Output format: `json`, `raw`                    | `raw`             |

### Fmt Command Options

| Option                        | Description                                     | Default           |
| ----------------------------- | ----------------------------------------------- | ----------------- |
| `--working-dir`               | Working directory to run in                     | Current directory |
| `--check`                     | Only check formatting without modifying files   | false             |
| `--tools`                     | Specific tools to run (comma-separated)         | All detected      |
| `--list`                      | List available tools instead of running them    | false             |
| `--required`                  | Tools that MUST be installed (error if missing) | -                 |
| `--skip`                      | Tools to skip even if detected                  | -                 |
| `--color`                     | Color mode: `auto`, `always`, `never`           | `auto`            |
| `--no-tui`                    | Disable real-time pane TUI output               | `false`           |
| `--no-runner-fallback`        | Disable bunx/pnpm/npx fallback for tools        | `false`           |
| `--tool-path`                 | Override tool path (`key=value`, repeatable)    | -                 |
| `--biome-use-editorconfig`    | Force Biome `.editorconfig` support             | `false`           |
| `--no-biome-use-editorconfig` | Disable Biome `.editorconfig` support           | `false`           |
| `--biome-use-vcs-ignore`      | Force Biome VCS ignore semantics                | `false`           |
| `--no-biome-use-vcs-ignore`   | Disable Biome VCS ignore semantics              | `false`           |
| `--output`                    | Output format: `json`, `raw`                    | `raw`             |

## Configuration

Clippier can be configured using `clippier.toml` files at two levels:

### Workspace-Level Configuration

Place a `clippier.toml` at the workspace root to define defaults for all packages:

```toml
# {workspace_root}/clippier.toml
# Workspace-level defaults apply to all packages unless overridden

[tools]
skip = ["gofmt"]
required = ["rustfmt", "taplo"]

# Rust-specific configuration (workspace-wide defaults)
[rust]
nightly = false
cargo = ["--locked"]

[env]
RUST_BACKTRACE = "1"
CARGO_TERM_COLOR = "always"

# Default OS matrix for packages that do not define local [[config]] entries
[[config]]
os = "ubuntu"

[[config]]
os = "macos"

[[config]]
os = "windows"

[[ci-steps]]
command = "cargo fmt --check"

[[dependencies]]
command = "sudo apt-get update"

[[dependencies]]
command = "sudo apt-get install -y pkg-config libssl-dev"
```

### Package-Level Configuration

Place a `clippier.toml` in individual package directories to override or extend workspace defaults:

```toml
# packages/{package}/clippier.toml
# Package-level config merges with workspace defaults.
# Local [[config]] entries replace the workspace default OS matrix for this package.

[env]
PACKAGE_SPECIFIC_VAR = "custom_value"

# Root-level Rust config (applies to all OS configs unless overridden)
[rust]
nightly = true

[[config]]
os = "ubuntu-latest"
# Per-OS Rust config using inline table
rust = { skip-features = ["simd"], cargo = ["build", "test", "clippy"] }

[config.env]
RUST_BACKTRACE = "1"
CARGO_TERM_COLOR = "always"

# System dependencies for Docker generation
[[config.dependencies]]
command = "sudo apt-get update"

[[config.dependencies]]
command = "sudo apt-get install -y pkg-config libssl-dev libasound2-dev"

# Feature-specific dependencies
[[config.dependencies]]
command = "sudo apt-get install -y libsqlite3-dev"
features = ["database"]

[[config]]
os = "windows"
# Skip certain features on Windows
rust = { skip-features = ["asio"] }

[parallelization]
chunked = 4
```

### Rust-Specific Configuration

Rust/Cargo-specific options are now namespaced under `[rust]` (workspace/package level) or `rust = {...}` (OS config level):

| Option              | Description              | Example                              |
| ------------------- | ------------------------ | ------------------------------------ |
| `nightly`           | Use nightly toolchain    | `nightly = true`                     |
| `cargo`             | Cargo command arguments  | `cargo = ["--locked"]`               |
| `skip-features`     | Features to skip in CI   | `skip-features = ["simd", "test-*"]` |
| `required-features` | Features required for CI | `required-features = ["production"]` |

**Examples:**

```toml
# Workspace-level Rust config
[rust]
nightly = false
cargo = ["--locked"]
skip-features = ["dev", "test-*"]

# Per-OS config with Rust overrides
[[config]]
os = "ubuntu"
rust = { nightly = true, skip-features = ["simd"] }

[[config]]
os = "windows"
rust = { skip-features = ["asio"] }

[[config]]
os = "macos"
# Uses workspace defaults (no rust override)
```

### Node.js-Specific Configuration

Node.js-specific options are namespaced under `[node]` (workspace/package level) or `node = {...}` (OS config level):

| Option            | Description                          | Example                                   |
| ----------------- | ------------------------------------ | ----------------------------------------- |
| `package-manager` | Preferred package manager            | `package-manager = "pnpm"`                |
| `node-version`    | Node.js version to use               | `node-version = "20"`                     |
| `skip-packages`   | Packages to skip in CI               | `skip-packages = ["@myorg/deprecated-*"]` |
| `args`            | Additional package manager arguments | `args = ["--frozen-lockfile"]`            |

**Examples:**

```toml
# Workspace-level Node config
[node]
package-manager = "pnpm"
node-version = "20"
skip-packages = ["@myorg/deprecated-*"]

# Per-OS config with Node overrides
[[config]]
os = "ubuntu"
node = { package-manager = "pnpm", args = ["--frozen-lockfile"] }

[[config]]
os = "windows"
node = { package-manager = "npm" }
```

### Configuration Precedence

Configuration values are resolved in the following order (highest to lowest priority):

1. **Config-specific** - `[[config]]` section in package's `clippier.toml`
2. **Package-level** - Top-level values in package's `clippier.toml`
3. **Workspace defaults** - Values in workspace root `clippier.toml`
4. **Built-in defaults** - Hardcoded fallback values

For matrix generation, package-local `[[config]]` entries are an override for workspace `[[config]]` entries. If a package has no local `[[config]]`, Clippier uses the workspace root `[[config]]` entries. If neither exists, Clippier falls back to a single Ubuntu config.

### Configuration Features

- **Workspace-level defaults**: Set organization-wide configuration once
- **Package-level overrides**: Customize specific packages as needed
- **Feature-specific dependencies**: Dependencies can be conditionally included based on enabled features
- **Multiple OS configurations**: Support for different operating systems
- **Environment variable management**: Configurable environment variables at workspace and package levels
- **CI step customization**: Custom CI pipeline steps
- **Toolchain specification**: Custom Rust toolchains per configuration

## Advanced Package Filtering

Clippier supports powerful property-based filtering to include or exclude packages based on their Cargo.toml properties using `--skip-if` and `--include-if` flags.

### Filter Syntax

**Format:** `property[.nested]<operator>value`

Filters can access any property in a package's Cargo.toml, including nested metadata.

### Available Operators

#### Scalar Operators

Match against string, boolean, or integer values:

| Operator | Description        | Example                               |
| -------- | ------------------ | ------------------------------------- |
| `=`      | Exact match        | `package.publish=false`               |
| `!=`     | Not equal          | `package.version!=0.1.0`              |
| `^=`     | Starts with        | `package.name^=moosicbox_`            |
| `$=`     | Ends with          | `package.name$=_example`              |
| `*=`     | Contains substring | `package.description*=audio`          |
| `~=`     | Regex match        | `package.name~=^moosicbox_.*_server$` |

#### Array Operators

Match against array properties (keywords, categories, authors, etc.):

| Operator | Description                           | Example                            |
| -------- | ------------------------------------- | ---------------------------------- |
| `@=`     | Array contains exact element          | `package.categories@=audio`        |
| `@*=`    | Array contains element with substring | `package.keywords@*=music`         |
| `@^=`    | Array contains element starting with  | `package.keywords@^=api-`          |
| `@~=`    | Array contains element matching regex | `package.categories@~=^multimedia` |
| `@!`     | Array is empty                        | `package.keywords@!`               |
| `@#=`    | Array length equals                   | `package.keywords@#=3`             |
| `@#>`    | Array length greater than             | `package.authors@#>1`              |
| `@#<`    | Array length less than                | `package.categories@#<5`           |
| `!@=`    | Array does NOT contain                | `package.keywords!@=deprecated`    |

#### Existence Operators

Check if properties exist:

| Operator | Description             | Example              |
| -------- | ----------------------- | -------------------- |
| `?`      | Property exists         | `package.readme?`    |
| `!?`     | Property does NOT exist | `package.homepage!?` |

### Logical Operators and Expressions

You can combine multiple filter conditions using logical operators to create complex expressions:

| Operator | Description                      | Example                                                                   |
| -------- | -------------------------------- | ------------------------------------------------------------------------- |
| `AND`    | Both conditions must be true     | `package.publish=false AND version^=0.1`                                  |
| `OR`     | At least one condition is true   | `package.publish=false OR name$=_example`                                 |
| `NOT`    | Inverts the condition            | `NOT package.publish=false`                                               |
| `( )`    | Groups conditions for precedence | `(package.publish=false OR package.name$=_test) AND package.version^=0.1` |

**Operator Precedence** (highest to lowest):

1. `NOT`
2. `AND`
3. `OR`

**Case Insensitive**: Keywords can be written as `AND`, `and`, `And`, etc.

**Quoted Values**: Use double quotes for values containing spaces or special characters:

- `package.name="my package"` - Matches packages with spaces in name
- `package.description="This AND that"` - Quotes prevent "AND" from being treated as operator

**Escape Sequences** in quoted strings:

- `\"` - Double quote
- `\\` - Backslash
- `\n` - Newline
- `\t` - Tab

### Usage Examples

#### Skip Unpublished Packages

```bash
# Exclude packages with publish = false
clippier features . --skip-if "package.publish=false" --output json
```

#### Include Only Specific Package Prefixes

```bash
# Only process moosicbox packages
clippier features . --include-if "package.name^=moosicbox_" --output json

# Exclude example packages
clippier packages . --skip-if "package.name$=_example" --output json
```

#### Filter by Categories or Keywords

```bash
# Only packages with audio category
clippier features . --include-if "package.categories@=audio" --output json

# Packages containing "api" in keywords
clippier features . --include-if "package.keywords@*=api" --output json

# Skip packages with empty keywords
clippier features . --skip-if "package.keywords@!" --output json
```

#### Array Length Filtering

```bash
# Only packages with 3+ keywords (well-documented)
clippier features . --include-if "package.keywords@#>2" --output json

# Packages with exactly 2 categories
clippier features . --include-if "package.categories@#=2" --output json
```

#### Nested Metadata Access

```bash
# Only independent workspace packages
clippier features . \
  --include-if "package.metadata.workspaces.independent=true" \
  --output json

# Skip packages with custom CI configuration
clippier packages . --skip-if "package.metadata.ci.skip-tests=true"
```

#### Combining Multiple Filters

**Using separate filter arguments (OR logic for skip, AND logic for include):**

```bash
# Include moosicbox packages, exclude examples and unpublished
clippier features . \
  --include-if "package.name^=moosicbox_" \
  --skip-if "package.name$=_example" \
  --skip-if "package.publish=false" \
  --output json

# Audio packages with sufficient documentation
clippier features . \
  --include-if "package.categories@=audio" \
  --include-if "package.keywords@#>2" \
  --include-if "package.readme?" \
  --output json
```

**Using logical expressions within a single filter:**

```bash
# Exclude examples OR unpublished packages
clippier features . \
  --skip-if "package.name$=_example OR publish=false" \
  --output json

# Include published moosicbox packages that are NOT examples
clippier features . \
  --include-if "package.name^=moosicbox_ AND publish=true AND NOT name$=_example" \
  --output json

# Complex: audio/video packages with good docs
clippier features . \
  --include-if "(package.categories@=audio OR package.categories@=video) AND package.keywords@#>2 AND package.readme?" \
  --output json

# Skip test packages or packages with specific metadata
clippier features . \
  --skip-if "package.name$=_test OR (metadata.ci? AND metadata.ci.skip=true)" \
  --output json
```

### Filter Logic

**Skip Filters (`--skip-if`):**

- Multiple skip filter arguments use **OR** logic
- Each filter argument can be a complex expression with `AND`, `OR`, `NOT`
- If **ANY** skip filter matches, the package is excluded
- Processed after include filters

**Include Filters (`--include-if`):**

- Multiple include filter arguments use **AND** logic
- Each filter argument can be a complex expression with `AND`, `OR`, `NOT`
- **ALL** include filters must match for a package to be included

**Expression Evaluation:**

Within each filter argument:

- `AND` requires both sides to be true
- `OR` requires at least one side to be true
- `NOT` inverts the result
- Parentheses `()` control precedence

**Examples:**

```bash
# Skip: Exclude if name ends with _example OR publish is false
--skip-if "package.name$=_example OR publish=false"
# Equivalent to separate args: --skip-if "package.name$=_example" --skip-if "package.publish=false"

# Include: Must match name prefix AND (one of the categories)
--include-if "package.name^=moosicbox_ AND (categories@=audio OR categories@=video)"

# Complex: Skip unpublished non-library packages
--skip-if "package.publish=false AND NOT package.name$=_lib"

# Multiple arguments with AND logic between them
--include-if "package.name^=moosicbox_" --include-if "package.categories@=audio"
# Both filters must match: name must start with moosicbox_ AND have audio category
```

### Property Paths

Access any Cargo.toml property using dot notation with the full path:

- `package.name`, `package.version`, `package.edition` - Standard package properties
- `package.publish`, `package.categories`, `package.keywords` - Package metadata
- `package.metadata.custom.field` - Custom nested metadata
- `dependencies.serde.version` - Dependency information
- `features.default` - Feature configuration
- `workspace.members` - Workspace configuration

### Practical Use Cases

#### CI/CD Optimization

```bash
# Test only published, non-example packages
clippier features . \
  --skip-if "package.publish=false" \
  --skip-if "package.name$=_example" \
  --max 20 \
  --output json
```

#### Monorepo Component Isolation

```bash
# Test only frontend packages (by naming convention)
clippier features . \
  --include-if "package.name*=_ui" \
  --include-if "package.name*=_web" \
  --output json

# Backend services only
clippier features . \
  --include-if "package.name*=_server" \
  --include-if "package.name*=_service" \
  --output json
```

#### Documentation Quality Checks

```bash
# Find packages missing documentation
clippier packages . --skip-if "package.readme?" --output raw

# Well-documented packages only
clippier features . \
  --include-if "package.readme?" \
  --include-if "package.keywords@#>2" \
  --include-if "package.categories@#>0" \
  --output json
```

#### Dependency Auditing

```bash
# Packages with specific metadata flags
clippier packages . \
  --include-if "metadata.security.audited=true" \
  --output json
```

## Use Cases

### CI/CD Pipeline Generation

Generate feature matrices for GitHub Actions with intelligent change detection:

```bash
# Generate feature combinations for testing only affected packages
clippier features Cargo.toml \
  --changed-files "$CHANGED_FILES" \
  --git-base "origin/main" \
  --git-head "HEAD" \
  --max 20 \
  --max-parallel 6 \
  --chunked 3 \
  --spread \
  --randomize \
  --skip-features "dev,test" \
  --required-features "production" \
  --output json > feature-matrix.json
```

The `--randomize` flag shuffles features before chunking, creating different feature combinations across CI runs. This helps catch issues with various feature groupings that might not be discovered with deterministic chunking.

#### Reproducible CI Builds

For reproducible builds (useful for debugging specific feature combinations), use the `--seed` parameter:

```bash
# Generate reproducible feature combinations using a specific seed
clippier features Cargo.toml \
  --changed-files "$CHANGED_FILES" \
  --max 20 \
  --max-parallel 6 \
  --chunked 3 \
  --spread \
  --randomize \
  --seed 1234567890 \
  --skip-features "dev,test" \
  --required-features "production" \
  --output json > feature-matrix.json
```

This ensures the same feature distribution is generated every time, enabling reproduction of specific CI failures.

### Selective Package Processing

Process specific packages in large workspaces:

```bash
# Generate feature matrix for specific packages only
clippier features . \
  --packages server,auth,database \
  --max 10 \
  --chunked 3 \
  --output json

# Useful for:
# - Development: Focus on packages you're actively working on
# - CI/CD: Create targeted test matrices
# - Performance: Reduce processing time for large workspaces
```

#### Combining with Change Detection

```bash
# Process specific packages AND filter by changes
clippier features . \
  --packages server,auth \
  --changed-files "src/lib.rs,Cargo.toml" \
  --max 10 \
  --output json
```

When both `--packages` and `--changed-files` are specified:

- First filters to specified packages
- Then applies change detection within those packages
- Results in highly targeted feature matrices

### Docker Deployment

Generate production-ready Dockerfiles with comprehensive dependency analysis:

```bash
# Generate Dockerfile for server package with all potential dependencies
clippier generate-dockerfile . server \
  --features "production,postgres" \
  --output docker/Dockerfile.server \
  --build-args "--release --locked"
```

### Smart Workspace Dependency Management

Analyze workspace dependencies with different levels of detail:

```bash
# Get minimal dependencies for current features
clippier workspace-deps . my-package --features "default,feature1"

# Get all potential dependencies for Docker builds
clippier workspace-deps . my-package --all-potential-deps --format json
```

## Core Functionality

- **Feature Combination Generation**: Creates combinations of Cargo features for testing
- **Feature Propagation Validation**: Ensures features are correctly propagated across workspace dependencies
- **Workspace Dependency Analysis**: Maps dependencies between workspace packages
- **CI Configuration Generation**: Produces CI/CD pipeline configurations
- **Docker File Generation**: Creates optimized multi-stage Dockerfiles
- **Impact Analysis**: Determines which packages are affected by code changes
- **External Dependency Tracking**: Monitors changes in external dependencies via git analysis
- **Smart Filtering**: Reduces test scope by analyzing only affected packages
- **Selective Package Processing**: Filter operations to specific packages for improved performance

## Advanced Features

### Selective Package Processing

The `--packages` flag enables targeted processing of specific workspace packages:

- **Performance optimization**: Process only relevant packages instead of entire workspace
- **Development workflow**: Focus on packages under active development
- **CI/CD flexibility**: Create custom test matrices for different components
- **Monorepo management**: Handle subsets of large multi-package repositories

Example workflow for package groups:

```bash
# Frontend packages
clippier features . --packages ui,web,app --output json

# Backend services
clippier features . --packages server,auth,database --output json

# Core libraries
clippier features . --packages core,utils,common --output json
```

Package names should match exactly as defined in Cargo.toml files. For packages with prefixes (e.g., `moosicbox_server`), use the full name.

### External Dependency Analysis

When the `git-diff` feature is enabled (default), Clippier can:

- **Parse Cargo.lock changes**: Detect version updates in external dependencies
- **Map external to internal dependencies**: Understand which workspace packages use which external dependencies
- **Provide comprehensive impact analysis**: Include both file-based and dependency-based changes
- **Optimize CI/CD pipelines**: Test only packages actually affected by changes

### Intelligent Docker Generation

The Docker generation feature provides:

- **System dependency detection**: Automatically includes required system packages
- **Multi-stage optimization**: Separates build and runtime environments
- **Layer caching optimization**: Structures Dockerfiles for maximum cache efficiency
- **Feature-aware builds**: Includes only dependencies needed for specified features
- **Comprehensive dependency inclusion**: Uses `--all-potential-deps` mode for build compatibility

### Workspace Relationship Mapping

- **Dependency graph generation**: Complete workspace dependency mapping
- **Circular dependency detection**: identify problematic dependency cycles
- **Build order optimization**: Determine optimal build sequences
- **Feature dependency resolution**: Handle complex feature interactions

## Output Formats

### JSON Output

Structured data suitable for programmatic processing:

```json
{
    "packages": [
        {
            "name": "package-name",
            "features": ["feature1", "feature2"],
            "dependencies": ["dep1", "dep2"],
            "os": "ubuntu-latest",
            "path": "packages/package-name"
        }
    ]
}
```

For affected packages analysis:

```json
{
    "affected_packages": ["server", "auth", "database"],
    "package": "server",
    "affected": true,
    "all_affected": ["server", "auth", "database"]
}
```

For feature validation results:

```json
{
    "total_packages": 147,
    "valid_packages": 145,
    "errors": [
        {
            "package": "moosicbox_server",
            "errors": [
                {
                    "feature": "fail-on-warnings",
                    "missing_propagations": [
                        {
                            "dependency": "moosicbox_tcp",
                            "expected": "moosicbox_tcp/fail-on-warnings",
                            "reason": "Dependency 'moosicbox_tcp' has feature 'fail-on-warnings' but it's not propagated"
                        }
                    ],
                    "incorrect_propagations": []
                }
            ]
        }
    ],
    "warnings": []
}
```

### Raw/Text Output

Human-readable text format for direct use in scripts:

```
server
auth
database
```

## Package Selection Examples

### Development Workflow

Focus on packages you're actively developing:

```bash
# Working on authentication system
clippier features . \
  --packages auth,auth_middleware,auth_api \
  --max 5 \
  --output json

# Testing database layer changes
clippier features . \
  --packages database,migrations,models \
  --features "postgres,sqlite" \
  --output json
```

### CI/CD Pipeline with Package Groups

```yaml
name: Component Testing
on:
    workflow_dispatch:
        inputs:
            component:
                description: 'Component to test'
                required: true
                type: choice
                options:
                    - frontend
                    - backend
                    - core

jobs:
    test-component:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v4

            - name: Set package list
              id: packages
              run: |
                  case "${{ github.event.inputs.component }}" in
                    frontend)
                      echo "list=ui,web,app" >> $GITHUB_OUTPUT
                      ;;
                    backend)
                      echo "list=server,api,auth" >> $GITHUB_OUTPUT
                      ;;
                    core)
                      echo "list=core,utils,common" >> $GITHUB_OUTPUT
                      ;;
                  esac

            - name: Generate test matrix
              run: |
                  clippier features . \
                    --packages "${{ steps.packages.outputs.list }}" \
                    --max 10 \
                    --output json
```

### Performance Comparison

```bash
# Full workspace analysis (slow for large workspaces)
time clippier features . --output json > all.json

# Targeted package analysis (much faster)
time clippier features . \
  --packages critical_service \
  --output json > critical.json

# Measure the improvement
echo "Full workspace: $(wc -l < all.json) configurations"
echo "Single package: $(wc -l < critical.json) configurations"
```

## Integration Examples

### GitHub Actions Workflow with Smart Change Detection

```yaml
name: CI
on: [push, pull_request]

jobs:
  analyze-changes:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.matrix.outputs.matrix }}
      analysis-method: ${{ steps.analysis.outputs.method }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

       - name: Build clippier
         run: cargo build --release --package clippier

       - name: Validate feature propagation
         run: |
           ./target/release/clippier validate-feature-propagation . \
             --features "fail-on-warnings"

       - name: Analyze changes and generate matrix
        id: analysis
        run: |
          # Get changed files
          CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | tr '\n' ',' | sed 's/,$//')

          # Use enhanced analysis if Cargo.lock changed
          if echo "$CHANGED_FILES" | grep -q "Cargo.lock"; then
            echo "method=hybrid" >> $GITHUB_OUTPUT
            matrix=$(./target/release/clippier features Cargo.toml \
              --changed-files "$CHANGED_FILES" \
              --git-base "${{ github.event.before }}" \
              --git-head "${{ github.sha }}" \
              --max 15 --output json)
          else
            echo "method=file-based" >> $GITHUB_OUTPUT
            matrix=$(./target/release/clippier features Cargo.toml \
              --changed-files "$CHANGED_FILES" \
              --max 15 --output json)
          fi

          echo "matrix=$matrix" >> $GITHUB_OUTPUT

  test:
    needs: analyze-changes
    if: needs.analyze-changes.outputs.matrix != '[]'
    strategy:
      matrix: ${{ fromJson(needs.analyze-changes.outputs.matrix) }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - name: Test with features (${{ needs.analyze-changes.outputs.analysis-method }})
        run: cargo test --package ${{ matrix.name }} --features "${{ matrix.features }}"
```

### Docker Build Pipeline with Dependency Optimization

```bash
#!/bin/bash
# Generate optimized Dockerfiles for all binary packages

PACKAGES=("server" "tunnel-server" "load-balancer")

for package in "${PACKAGES[@]}"; do
  echo "Generating Dockerfile for $package..."

  # Show dependency analysis
  echo "Dependencies analysis:"
  echo "  Normal: $(./clippier workspace-deps . "moosicbox_$package" | wc -l) packages"
  echo "  All potential: $(./clippier workspace-deps . "moosicbox_$package" --all-potential-deps | wc -l) packages"

  # Generate Dockerfile
  ./clippier generate-dockerfile . "moosicbox_$package" \
    --output "docker/Dockerfile.$package" \
    --generate-dockerignore

  echo "Generated docker/Dockerfile.$package"
done
```

### Advanced Change Analysis Script

```bash
#!/bin/bash
# Comprehensive change impact analysis

BASE_COMMIT=${1:-"origin/main"}
HEAD_COMMIT=${2:-"HEAD"}

echo "🔍 Analyzing changes from $BASE_COMMIT to $HEAD_COMMIT"

# Get changed files
CHANGED_FILES=$(git diff --name-only "$BASE_COMMIT".."$HEAD_COMMIT" | tr '\n' ',' | sed 's/,$//')
echo "📝 Changed files: $CHANGED_FILES"

# Analyze affected packages
if echo "$CHANGED_FILES" | grep -q "Cargo.lock"; then
  echo "🧠 Using hybrid analysis (external deps + file changes)"
  AFFECTED=$(./clippier affected-packages . \
    --changed-files "$CHANGED_FILES" \
    --git-base "$BASE_COMMIT" \
    --git-head "$HEAD_COMMIT" \
    --output json)
else
  echo "📁 Using file-based analysis"
  AFFECTED=$(./clippier affected-packages . \
    --changed-files "$CHANGED_FILES" \
    --output json)
fi

echo "📦 Affected packages: $AFFECTED"

# Validate feature propagation before testing
echo "🔧 Validating feature propagation for affected packages..."
if ! ./clippier validate-feature-propagation . --features "fail-on-warnings" --workspace-only; then
    echo "❌ Feature propagation validation failed - fix before continuing"
    exit 1
fi

# Generate test matrix for affected packages only
echo "🎯 Generating targeted test matrix..."
MATRIX=$(./clippier features Cargo.toml \
  --changed-files "$CHANGED_FILES" \
  --git-base "$BASE_COMMIT" \
  --git-head "$HEAD_COMMIT" \
  --max 20 \
  --output json)

echo "🧪 Test matrix: $MATRIX"
```

### Feature Validation in CI Pipeline

```bash
#!/bin/bash
# Comprehensive feature validation script for CI/CD

echo "🔧 Validating feature propagation..."

# First, validate that fail-on-warnings is properly propagated
echo "  Checking fail-on-warnings propagation..."
if ! ./clippier validate-feature-propagation . --features "fail-on-warnings"; then
    echo "❌ fail-on-warnings validation failed"
    exit 1
fi

# Auto-detect and validate all features that might need propagation
echo "  Auto-detecting features for validation..."
VALIDATION_RESULT=$(./clippier validate-feature-propagation . --workspace-only --output json)
ERRORS=$(echo "$VALIDATION_RESULT" | jq '.errors | length')

if [ "$ERRORS" -gt 0 ]; then
    echo "❌ Found $ERRORS feature propagation errors"
    echo "$VALIDATION_RESULT" | jq -r '.errors[] | "Package: \(.package) - \(.errors | length) error(s)"'
    exit 1
else
    VALID_PACKAGES=$(echo "$VALIDATION_RESULT" | jq '.valid_packages')
    echo "✅ All $VALID_PACKAGES packages have correct feature propagation"
fi

echo "🎯 Feature validation completed successfully!"
```

## Best Practices

### Feature Propagation Validation

1. **Run in CI/CD pipelines**: Catch propagation issues early before they cause build failures

    ```bash
    # In your CI pipeline
    clippier validate-feature-propagation . --features "fail-on-warnings"
    ```

2. **Use auto-detection mode**: Finds all features that might need propagation across your workspace

    ```bash
    # Discovers features that exist in multiple packages
    clippier validate-feature-propagation . --workspace-only
    ```

3. **Validate after adding dependencies**: Ensure new workspace dependencies don't break feature propagation

    ```bash
    # Quick check after adding a new workspace dependency
    clippier validate-feature-propagation . --features "fail-on-warnings,your-feature"
    ```

4. **Use workspace-only mode**: Focus validation on packages you control, excluding external dependencies

    ```bash
    # Avoids false positives from external dependencies
    clippier validate-feature-propagation . --workspace-only
    ```

5. **Document required features**: Make feature propagation requirements explicit in your workspace
    ```toml
    # In Cargo.toml, document why features are propagated
    [features]
    fail-on-warnings = [
        "dep_a/fail-on-warnings",  # Required for consistent builds
        "dep_b?/fail-on-warnings", # Optional dep - only when enabled
    ]
    ```

### Package Selection Best Practices

1. **Use exact package names**: Specify packages exactly as they appear in Cargo.toml

    ```bash
    # Correct
    clippier features . --packages moosicbox_server,moosicbox_auth

    # Incorrect (unless packages are actually named this way)
    clippier features . --packages server,auth
    ```

2. **Combine with other filters for precision**: Layer multiple filters for targeted analysis

    ```bash
    clippier features . \
      --packages server,database \
      --os ubuntu \
      --features "production" \
      --skip-features "dev,test" \
      --required-features "production"
    ```

3. **Use in CI/CD for component testing**: Create separate workflows for different components

    ```bash
    # Test only affected services
    clippier features . \
      --packages $AFFECTED_SERVICES \
      --changed-files "$CHANGED_FILES"
    ```

4. **Performance optimization for large workspaces**: Process packages in groups

    ```bash
    # Process in batches for very large workspaces
    BATCH1="pkg1,pkg2,pkg3,pkg4,pkg5"
    BATCH2="pkg6,pkg7,pkg8,pkg9,pkg10"

    clippier features . --packages $BATCH1 --output json > batch1.json
    clippier features . --packages $BATCH2 --output json > batch2.json
    ```

### General Workspace Management

1. **Regular dependency analysis**: Run `workspace-deps` to understand your dependency graph
2. **Impact-driven testing**: Use `affected-packages` to optimize CI runs
3. **Feature matrix optimization**: Use `--changed-files` to test only what matters
4. **Docker build optimization**: Use `--all-potential-deps` for complete build contexts

## Troubleshooting

### Feature Validation Issues

**"Feature not found" errors:**

- Ensure the feature exists in at least one workspace package
- Check spelling and case sensitivity in feature names
- Use auto-detection mode to see which features are available

**Too many false positives:**

- Use `--workspace-only` to exclude external dependencies
- Specify exact features with `--features` instead of auto-detection
- Check that external dependencies actually need the features

**Missing optional dependency syntax:**

- Use `dep?/feature` syntax for optional dependencies
- Ensure the dependency is marked as `optional = true` in Cargo.toml
- Verify the optional dependency actually has the feature you're propagating

**CI/CD integration issues:**

- Use `--output json` for programmatic output parsing
- Use `--fail-on-error` to control exit codes in CI pipelines
- Verify the clippier binary is built and available in the workflow

**Performance issues with large workspaces:**

- Use `--features` to validate specific features instead of auto-detection
- Consider `--workspace-only` to reduce scope
- Run validation in parallel with other CI steps

### Package Selection Issues

**"Package not found" warnings:**

- Verify package names match exactly as in Cargo.toml
- Check for typos or incorrect prefixes
- Use `cargo metadata` to list all workspace packages
- Remember packages are case-sensitive

**Empty results with --packages:**

- Ensure packages exist in the workspace
- Check that packages have Cargo.toml files
- Verify workspace members list includes the packages
- Try without --packages flag to see all available packages

**Combining --packages with --changed-files:**

- Both filters are applied (packages AND changes)
- May result in empty set if no changes affect selected packages
- Use one or the other for broader results
- Check package paths match changed file paths

### General Troubleshooting

**Command not found errors:**

- Ensure clippier is built: `cargo build --release --package clippier`
- Check the binary path: `./target/release/clippier`
- Verify you're in the workspace root directory

**Git-related errors (external dependency analysis):**

- Ensure git history is available (use `fetch-depth: 0` in GitHub Actions)
- Check that base and head commits exist
- Verify you have the `git-diff` feature enabled (default)

**JSON parsing errors:**

- Verify JSON output with `jq` or similar tools
- Check for proper shell escaping in CI environments
- Ensure output is captured correctly in scripts

## Quick Reference

### Feature Skip Patterns (Wildcards & Negation)

```bash
# Wildcard patterns
--skip-features "*-default"                    # Skip all *-default features
--skip-features "test-*"                       # Skip all test-* features
--skip-features "v?"                           # Skip v1, v2, v3 (not v10)
--skip-features "*internal*"                   # Skip features containing "internal"

# Negation patterns (skip all except)
--skip-features "*,!enable-bob"                # Skip all except enable-bob
--skip-features "*,!enable-*"                  # Skip all except enable-*
--skip-features "*,!production,!default"       # Skip all except production and default

# Complex combinations
--skip-features "*-default,test-*,!test-utils" # Skip defaults and tests, keep test-utils
--skip-features "v?,!v2"                       # Skip v1, v3 but keep v2
--skip-features "*,!enable-*,!production"      # Only keep enable-* and production features

# In configuration files
[[config]]
os = "ubuntu"
skip-features = ["*-default", "test-*", "!test-utils"]
```

**Pattern Syntax:**

- `*` - Matches zero or more characters
- `?` - Matches exactly one character
- `!pattern` - Negation (excludes matching items from the result set)
- Supported in: `--features`, `--skip-features`, `--required-features`, `--packages`
- Patterns evaluated left-to-right

### Feature Inclusion Patterns (`--features`)

```bash
# Include all features starting with enable-
--features "enable-*"

# Include multiple wildcard patterns
--features "enable-*,test-*"

# Mix wildcards with exact names
--features "enable-*,production,default"

# Use negation to include all except specific features
--features "*,!test-*"

# Include enable-* except enable-experimental
--features "enable-*,!enable-experimental"

# Combine with skip-features for precise control
--features "enable-*,test-*" --skip-features "test-integration"
```

**Note:** `--features` expands wildcards to **include** matching features. Supports negation with `!` prefix to exclude specific patterns.

### Required Features Patterns (`--required-features`)

```bash
# Require all features starting with enable-
--required-features "enable-*"

# Require multiple wildcard patterns
--required-features "enable-*,test-*"

# Mix wildcards with exact names
--required-features "enable-*,production,default"

# Use negation to require enable-* except enable-experimental
--required-features "enable-*,!enable-experimental"
```

**Note:** Wildcards and negations are **expanded to concrete feature names** in the JSON output. This is metadata that gets included for downstream consumers.

**Output example:**

```json
{
    "requiredFeatures": ["enable-bob", "enable-sally", "enable-feature", "production"]
}
```

### Package Selection Patterns (`--packages`)

```bash
# Include all packages starting with moosicbox_
--packages "moosicbox_*"

# Include all server packages
--packages "*_server"

# Mix wildcards with exact names
--packages "moosicbox_server,moosicbox_*_api,core"

# Use negation to include all except test packages
--packages "*,!*_test"

# Include all server packages except test servers
--packages "*_server,!*_test_server"

# Select specific API packages
--packages "moosicbox_*_api"
```

**Note:** `--packages` supports negation with `!` prefix to exclude specific packages from the selection.

### Property-Based Filter Syntax

```bash
# Scalar operators
--skip-if "package.publish=false"              # Exact match
--include-if "package.name^=moosicbox_"        # Starts with
--skip-if "package.name$=_example"             # Ends with
--include-if "package.description*=audio"      # Contains
--include-if "package.name~=^test_.*"          # Regex match

# Array operators
--include-if "package.categories@=audio"       # Array contains
--include-if "package.keywords@*=api"          # Array element contains substring
--include-if "package.keywords@^=music"        # Array element starts with
--include-if "package.categories@~=^multi"     # Array element matches regex
--skip-if "package.keywords@!"                 # Array is empty
--include-if "package.keywords@#=3"            # Array length equals
--include-if "package.authors@#>1"             # Array length greater than
--include-if "package.categories@#<5"          # Array length less than
--skip-if "package.keywords!@=deprecated"      # Array does NOT contain

# Existence operators
--include-if "package.readme?"                 # Property exists
--skip-if "package.homepage!?"                 # Property does NOT exist

# Nested properties
--include-if "package.metadata.workspaces.independent=true"
--skip-if "package.metadata.ci.skip-tests=true"

# Combining filters
clippier features . \
  --include-if "package.name^=moosicbox_" \
  --skip-if "package.name$=_example" \
  --skip-if "package.publish=false"
```

### Packages Command Patterns

```bash
# List all workspace packages
clippier packages . --output json

# List packages for specific OS
clippier packages . --os ubuntu --output json

# Filter to specific packages
clippier packages . --packages server,auth

# Property-based filtering
clippier packages . --skip-if "package.publish=false" --output json
clippier packages . --include-if "package.categories@=audio" --output json

# Only packages affected by changes
clippier packages . --changed-files "src/lib.rs,Cargo.toml"

# Only packages affected by git changes
clippier packages . --git-base origin/main --git-head HEAD

# Combined with max parallel limit
clippier packages . --max-parallel 20 --output json

# Raw output (package names only)
clippier packages . --output raw
```

### Common Package Selection Patterns (Features Command)

```bash
# Single package
clippier features . --packages my_package

# Multiple packages (exact names)
clippier features . --packages pkg1,pkg2,pkg3

# Wildcard patterns - all packages with prefix
clippier features . --packages "moosicbox_*"

# Wildcard patterns - all server packages
clippier features . --packages "*_server"

# Wildcard patterns - all API packages
clippier features . --packages "moosicbox_*_api"

# Mix wildcards with exact names
clippier features . --packages "moosicbox_server,moosicbox_*_api,core"

# Combined with OS filter
clippier features . --packages "moosicbox_*_server" --os ubuntu

# Combined with feature wildcards
clippier features . --packages "*_server" --features "enable-*,production"

# Combined with all wildcard features (comprehensive example)
clippier features . \
  --packages "moosicbox_*_server" \
  --features "enable-*,production" \
  --skip-features "test-*,!test-utils" \
  --required-features "enable-*"

# Combined with change detection
clippier features . --packages "moosicbox_*" --changed-files "src/main.rs"

# With chunking for CI
clippier features . --packages "*_server,*_api" --chunked 5 --max-parallel 10

# For Docker generation
clippier workspace-deps . my_package --all-potential-deps

# For affected packages
clippier affected-packages . --changed-files "*.rs" --target-package server
```

## See Also

- [MoosicBox Server]../server/README.md - Example of complex workspace package
- [Cargo Workspaces]https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html - Rust workspace documentation
- [GitHub Actions]https://docs.github.com/en/actions - CI/CD platform integration
- [Docker Multi-stage Builds]https://docs.docker.com/develop/dev-best-practices/dockerfile_best-practices/#use-multi-stage-builds - Docker optimization techniques