specshield 3.0.0 โ 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +277 -46
- package/package.json +34 -33
- package/src/cli.js +2 -0
- package/src/commands/bdct.js +71 -44
- package/src/commands/init.js +399 -0
- package/src/core/configWriter.js +221 -0
- package/src/core/projectConfig.js +189 -0
- package/src/core/projectDetect.js +180 -0
package/README.md
CHANGED
|
@@ -117,6 +117,26 @@ specshield compare base.yaml target.yaml --fail-on-breaking
|
|
|
117
117
|
|
|
118
118
|
That's it. Works with any OpenAPI 3.x YAML or JSON spec.
|
|
119
119
|
|
|
120
|
+
**For BDCT**, run the wizard once and never re-type the same flags again:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
specshield init
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
It autodetects your OpenAPI spec, your service name (from `package.json` /
|
|
127
|
+
`pyproject.toml` / `pom.xml` / `go.mod`), your git branch, and your
|
|
128
|
+
default environment, asks you a few questions, and writes a
|
|
129
|
+
**`.specshield.yml`** at the project root. Every subsequent
|
|
130
|
+
`specshield bdct ...` invocation reads this file, so your CI commands
|
|
131
|
+
collapse to:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
specshield bdct publish-provider --version $GITHUB_SHA
|
|
135
|
+
specshield bdct can-i-deploy --version $GITHUB_SHA
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
See [ยง specshield init](#specshield-init--first-run-setup-wizard) below.
|
|
139
|
+
|
|
120
140
|
---
|
|
121
141
|
|
|
122
142
|
## ๐ Create Your Free Account
|
|
@@ -248,7 +268,16 @@ Done. Your token is stored in `~/.specshield/config.json` โ no need to pass it
|
|
|
248
268
|
export SPECSHIELD_API_KEY=ss_your_token_here
|
|
249
269
|
```
|
|
250
270
|
|
|
251
|
-
|
|
271
|
+
This single env var works for every command โ `compare`, `login`, and every
|
|
272
|
+
`bdct` subcommand all read it.
|
|
273
|
+
|
|
274
|
+
Token resolution order:
|
|
275
|
+
- `compare` / `login`: `--api-key` flag โ `SPECSHIELD_API_KEY` env var โ stored config โ `.specshield.yml`
|
|
276
|
+
- `bdct ...` subcommands: `--api-token` flag โ `SPECSHIELD_API_KEY` env var โ stored config
|
|
277
|
+
|
|
278
|
+
> **Why two flag names?** `compare` and `login` were built first and used
|
|
279
|
+
> `--api-key`. The newer `bdct` commands use `--api-token` to keep the word
|
|
280
|
+
> "key" reserved for the stored config concept. The env var unifies both.
|
|
252
281
|
|
|
253
282
|
---
|
|
254
283
|
|
|
@@ -349,6 +378,104 @@ github:
|
|
|
349
378
|
|
|
350
379
|
---
|
|
351
380
|
|
|
381
|
+
## `specshield init` โ first-run setup wizard
|
|
382
|
+
|
|
383
|
+
Run once at the root of your project. The wizard:
|
|
384
|
+
|
|
385
|
+
1. Detects your OpenAPI spec (looks under `api/`, `spec/`, `docs/`, repo root).
|
|
386
|
+
2. Detects your service name (`package.json`, `pyproject.toml`, `pom.xml`, `go.mod`, `Cargo.toml`, or directory name).
|
|
387
|
+
3. Detects your git branch and suggests `production` for `main`/`master`, `staging` otherwise.
|
|
388
|
+
4. Asks whether this project is a provider, a consumer, or both.
|
|
389
|
+
5. Asks for your org key (autocompletes from your account if you're already signed in).
|
|
390
|
+
6. Validates / stores your API key.
|
|
391
|
+
7. Writes **`.specshield.yml`** and, optionally, a starter **`.github/workflows/specshield-bdct.yml`** that uses [`specshield26/bdct-action@v1`](https://github.com/marketplace/actions/specshield-bdct).
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
specshield init
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Example `.specshield.yml`
|
|
398
|
+
|
|
399
|
+
```yaml
|
|
400
|
+
schemaVersion: 1
|
|
401
|
+
|
|
402
|
+
failOnBreaking: true
|
|
403
|
+
severity: error
|
|
404
|
+
|
|
405
|
+
bdct:
|
|
406
|
+
org: acme-pay
|
|
407
|
+
environment: staging
|
|
408
|
+
|
|
409
|
+
provider:
|
|
410
|
+
name: payment-service
|
|
411
|
+
spec: api/openapi.yaml
|
|
412
|
+
|
|
413
|
+
# consumer (optional โ present when --kind=consumer or --kind=both):
|
|
414
|
+
# consumer:
|
|
415
|
+
# name: checkout-ui
|
|
416
|
+
# provider: payment-service
|
|
417
|
+
# contract: contracts/payment-service.yaml
|
|
418
|
+
# format: OPENAPI
|
|
419
|
+
|
|
420
|
+
github:
|
|
421
|
+
specPath: api/openapi.yaml
|
|
422
|
+
failOnBreaking: true
|
|
423
|
+
commentOnPr: true
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
CLI flags **always** override this file. Paths in the file are resolved
|
|
427
|
+
relative to the file's own directory, so you can run `specshield bdct ...`
|
|
428
|
+
from any subdirectory of your project.
|
|
429
|
+
|
|
430
|
+
### Non-interactive (scriptable) mode
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
# Provider-only project
|
|
434
|
+
specshield init --no-interactive \
|
|
435
|
+
--kind provider \
|
|
436
|
+
--org acme-pay \
|
|
437
|
+
--provider payment-service \
|
|
438
|
+
--spec api/openapi.yaml \
|
|
439
|
+
--env staging \
|
|
440
|
+
--write-workflow
|
|
441
|
+
|
|
442
|
+
# Consumer-only project
|
|
443
|
+
specshield init --no-interactive \
|
|
444
|
+
--kind consumer \
|
|
445
|
+
--org acme-pay \
|
|
446
|
+
--consumer checkout-ui \
|
|
447
|
+
--consumer-provider payment-service \
|
|
448
|
+
--contract contracts/payment-service.yaml \
|
|
449
|
+
--format OPENAPI \
|
|
450
|
+
--env staging
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### All `init` flags
|
|
454
|
+
|
|
455
|
+
| Flag | Purpose |
|
|
456
|
+
| --- | --- |
|
|
457
|
+
| `--no-interactive` | Run without prompts; all required fields must come from flags or `package.json`/git autodetection. |
|
|
458
|
+
| `--print` | Detect everything, print the proposed YAML to stdout, write nothing. Good for `--dry-run` review in CI. |
|
|
459
|
+
| `--force` | Skip the overwrite-confirmation if `.specshield.yml` already exists. |
|
|
460
|
+
| `--server <url>` | Use a non-default SpecShield endpoint (self-hosted / staging). Default: `https://specshield.io`. |
|
|
461
|
+
| `--kind <kind>` | `provider`, `consumer`, `both`, or `skip`. Required in `--no-interactive`. |
|
|
462
|
+
| `--org <key>` | Organization key. |
|
|
463
|
+
| `--provider <name>` | Provider service name (used when `--kind=provider|both`). |
|
|
464
|
+
| `--spec <path>` | Path to the provider OpenAPI spec. |
|
|
465
|
+
| `--consumer <name>` | Consumer service name (used when `--kind=consumer|both`). |
|
|
466
|
+
| `--consumer-provider <name>` | The provider this consumer talks to (used when `--kind=consumer|both`). |
|
|
467
|
+
| `--contract <path>` | Path to the consumer contract (OpenAPI or Pact JSON). |
|
|
468
|
+
| `--format <fmt>` | Consumer contract format: `OPENAPI` (default) or `PACT`. |
|
|
469
|
+
| `--env <environment>` | Default environment for BDCT operations. |
|
|
470
|
+
| `--write-workflow` | Also write a starter GitHub Actions workflow under `.github/workflows/specshield-bdct.yml`. |
|
|
471
|
+
|
|
472
|
+
> **What is _not_ written into `.specshield.yml`:** your API key. It is
|
|
473
|
+
> stored in `~/.specshield/config.json` (set by `specshield login`) or
|
|
474
|
+
> read from `SPECSHIELD_API_KEY` in CI. The project file is meant to be
|
|
475
|
+
> committed; never commit a secret into it.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
352
479
|
## Bi-Directional Contract Testing (BDCT)
|
|
353
480
|
|
|
354
481
|
**Spec-to-spec contract testing โ no running services required.**
|
|
@@ -374,17 +501,25 @@ specshield bdct publish-provider \
|
|
|
374
501
|
--provider payment-service \
|
|
375
502
|
--version v2.1.0 \
|
|
376
503
|
--spec ./api/openapi.yaml \
|
|
377
|
-
--env production
|
|
504
|
+
--env production \
|
|
505
|
+
--branch main
|
|
378
506
|
```
|
|
379
507
|
|
|
380
508
|
```
|
|
381
|
-
โ Provider
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
509
|
+
โ Provider Spec Published
|
|
510
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
511
|
+
ID : 1842
|
|
512
|
+
Provider : payment-service
|
|
513
|
+
Version : v2.1.0
|
|
514
|
+
Environment : production
|
|
515
|
+
Published At: 2026-05-13 14:30:12
|
|
516
|
+
Verifications triggered: 3
|
|
386
517
|
```
|
|
387
518
|
|
|
519
|
+
`--branch` is optional โ when present it's stamped on the published spec so you
|
|
520
|
+
can correlate a spec version with the git branch it came from in
|
|
521
|
+
`bdct list-providers`.
|
|
522
|
+
|
|
388
523
|
### Publish a Consumer Contract
|
|
389
524
|
|
|
390
525
|
The consumer contract is an OpenAPI spec that describes only the endpoints the consumer uses:
|
|
@@ -425,19 +560,30 @@ specshield bdct publish-consumer \
|
|
|
425
560
|
--consumer checkout-ui \
|
|
426
561
|
--provider payment-service \
|
|
427
562
|
--version 2.0.0 \
|
|
428
|
-
--contract ./contracts/checkout-ui-payment.yaml
|
|
563
|
+
--contract ./contracts/checkout-ui-payment.yaml \
|
|
564
|
+
--format OPENAPI
|
|
429
565
|
```
|
|
430
566
|
|
|
431
567
|
```
|
|
432
|
-
โ Consumer
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
568
|
+
โ Consumer Contract Published
|
|
569
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
570
|
+
ID : 942
|
|
571
|
+
Consumer : checkout-ui
|
|
572
|
+
Provider : payment-service
|
|
573
|
+
Version : 2.0.0
|
|
574
|
+
Format : OPENAPI
|
|
575
|
+
Published At: 2026-05-13 14:31:05
|
|
576
|
+
Verifications triggered: 1
|
|
577
|
+
|
|
578
|
+
โ Run: specshield bdct verify --consumer checkout-ui --provider payment-service
|
|
436
579
|
```
|
|
437
580
|
|
|
438
|
-
If the provider spec is already published, compatibility is
|
|
581
|
+
If the provider spec is already published, compatibility is verified
|
|
582
|
+
automatically โ the "Verifications triggered" count reflects that.
|
|
439
583
|
|
|
440
|
-
**Pact JSON contracts are also
|
|
584
|
+
**Pact JSON contracts are also supported** โ pass `--format PACT` and point
|
|
585
|
+
`--contract` at a Pact file. The backend stores the format and runs the same
|
|
586
|
+
compatibility engine against your provider's OpenAPI spec:
|
|
441
587
|
|
|
442
588
|
```bash
|
|
443
589
|
specshield bdct publish-consumer \
|
|
@@ -445,9 +591,12 @@ specshield bdct publish-consumer \
|
|
|
445
591
|
--consumer checkout-ui \
|
|
446
592
|
--provider payment-service \
|
|
447
593
|
--version 2.0.0 \
|
|
448
|
-
--contract ./pacts/checkout-ui-payment-service.json
|
|
594
|
+
--contract ./pacts/checkout-ui-payment-service.json \
|
|
595
|
+
--format PACT
|
|
449
596
|
```
|
|
450
597
|
|
|
598
|
+
`--format` defaults to `OPENAPI` if omitted.
|
|
599
|
+
|
|
451
600
|
### Verify Compatibility
|
|
452
601
|
|
|
453
602
|
Manually trigger a verification between a specific consumer/provider pair:
|
|
@@ -499,18 +648,36 @@ specshield bdct can-i-deploy \
|
|
|
499
648
|
--env production
|
|
500
649
|
```
|
|
501
650
|
|
|
651
|
+
Deployable output:
|
|
652
|
+
|
|
502
653
|
```
|
|
503
|
-
โ
|
|
654
|
+
โ PASS: payment-service v2.1.0 is deployable in production
|
|
655
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
656
|
+
|
|
657
|
+
Consumer Verifications
|
|
504
658
|
|
|
505
|
-
|
|
659
|
+
Consumer Version Status Verified At
|
|
660
|
+
โโโโโโโโโโโ โโโโโโโ โโโโโโโโโโ โโโโโโโโโโโโโโโ
|
|
661
|
+
checkout-ui 2.0.0 COMPATIBLE 2026-05-13 14:32
|
|
662
|
+
mobile-app 1.5.0 COMPATIBLE 2026-05-13 14:32
|
|
663
|
+
partner-sdk 3.2.1 COMPATIBLE 2026-05-13 14:32
|
|
506
664
|
```
|
|
507
665
|
|
|
666
|
+
Blocked output:
|
|
667
|
+
|
|
508
668
|
```
|
|
509
|
-
โ NOT
|
|
669
|
+
โ FAIL: payment-service v2.1.0 is NOT deployable in production
|
|
670
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
671
|
+
|
|
672
|
+
Consumer Verifications
|
|
510
673
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
674
|
+
Consumer Version Status Verified At
|
|
675
|
+
โโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโ
|
|
676
|
+
checkout-ui 2.0.0 INCOMPATIBLE 2026-05-13 14:32
|
|
677
|
+
mobile-app 1.5.0 INCOMPATIBLE 2026-05-13 14:32
|
|
678
|
+
|
|
679
|
+
โ Run: specshield bdct verify --consumer <NAME> --provider payment-service
|
|
680
|
+
โ to identify and resolve incompatibilities
|
|
514
681
|
```
|
|
515
682
|
|
|
516
683
|
Exit codes: `0` = deployable ยท `1` = blocked ยท `2` = error
|
|
@@ -524,12 +691,17 @@ specshield bdct matrix --org acme-store --env production
|
|
|
524
691
|
```
|
|
525
692
|
|
|
526
693
|
```
|
|
527
|
-
Compatibility Matrix
|
|
694
|
+
BDCT Compatibility Matrix
|
|
695
|
+
Environment: production
|
|
696
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
697
|
+
|
|
698
|
+
Consumer \ Provider payment-service order-service
|
|
699
|
+
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
|
|
700
|
+
checkout-ui COMPATIBLE COMPATIBLE
|
|
701
|
+
mobile-app INCOMPATIBLE COMPATIBLE
|
|
702
|
+
partner-sdk COMPATIBLE UNKNOWN
|
|
528
703
|
|
|
529
|
-
|
|
530
|
-
checkout-ui COMPATIBLE COMPATIBLE
|
|
531
|
-
mobile-app INCOMPATIBLE COMPATIBLE
|
|
532
|
-
partner-sdk COMPATIBLE UNKNOWN
|
|
704
|
+
โ COMPATIBLE โ INCOMPATIBLE โ UNKNOWN
|
|
533
705
|
```
|
|
534
706
|
|
|
535
707
|
### List Provider Specs
|
|
@@ -543,11 +715,15 @@ specshield bdct list-providers --org acme-store --provider payment-service
|
|
|
543
715
|
```
|
|
544
716
|
|
|
545
717
|
```
|
|
546
|
-
Provider Specs
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
718
|
+
Published Provider Specs
|
|
719
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
720
|
+
Showing 3 of 3 specs
|
|
721
|
+
|
|
722
|
+
ID Provider Version Environment Branch Published At
|
|
723
|
+
โโโโ โโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโโ โโโโโโโโโโโโโโโ
|
|
724
|
+
1842 payment-service v2.1.0 production main 2026-05-13 14:30
|
|
725
|
+
1799 payment-service v2.0.0 staging main 2026-04-20 09:11
|
|
726
|
+
1772 order-service v1.3.0 production main 2026-04-28 11:02
|
|
551
727
|
```
|
|
552
728
|
|
|
553
729
|
### List Consumer Contracts
|
|
@@ -573,11 +749,14 @@ specshield bdct list \
|
|
|
573
749
|
```
|
|
574
750
|
|
|
575
751
|
```
|
|
576
|
-
BDCT
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
752
|
+
BDCT Verification History
|
|
753
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
754
|
+
Showing 2 of 2 verifications
|
|
755
|
+
|
|
756
|
+
ID Consumer Provider Cons Ver Prov Ver Status Environment Verified At
|
|
757
|
+
โโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโ โโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโ
|
|
758
|
+
3081 checkout-ui payment-service 2.0.0 v2.1.0 COMPATIBLE production 2026-05-13 14:32
|
|
759
|
+
3082 mobile-app payment-service 1.5.0 v2.1.0 INCOMPATIBLE production 2026-05-13 14:32
|
|
581
760
|
```
|
|
582
761
|
|
|
583
762
|
### BDCT JSON Output
|
|
@@ -734,28 +913,60 @@ jobs:
|
|
|
734
913
|
|
|
735
914
|
## Config File
|
|
736
915
|
|
|
737
|
-
|
|
916
|
+
Run [`specshield init`](#specshield-init--first-run-setup-wizard) to generate
|
|
917
|
+
`.specshield.yml` automatically, or hand-write it. Either way, every
|
|
918
|
+
`specshield ...` invocation reads the file from the project root (or any
|
|
919
|
+
parent directory) and uses its values as defaults โ CLI flags always win.
|
|
920
|
+
|
|
921
|
+
The full schema supports both local-compare defaults and BDCT defaults:
|
|
738
922
|
|
|
739
923
|
```yaml
|
|
740
|
-
|
|
741
|
-
severity: error
|
|
924
|
+
schemaVersion: 1
|
|
742
925
|
|
|
926
|
+
# Local-compare defaults (used by `specshield compare`).
|
|
927
|
+
failOnBreaking: true
|
|
928
|
+
severity: error # info | warning | error
|
|
743
929
|
ignore:
|
|
744
|
-
- "DELETE /admin removed"
|
|
930
|
+
- "DELETE /admin removed" # match by substring; repeatable
|
|
745
931
|
|
|
932
|
+
# Hosted compare (set --remote on the CLI to override).
|
|
746
933
|
remote:
|
|
747
934
|
enabled: false
|
|
748
|
-
url:
|
|
935
|
+
url: https://specshield.io/compare
|
|
749
936
|
timeout: 10000
|
|
750
|
-
# apiKey
|
|
751
|
-
|
|
937
|
+
# apiKey is intentionally NOT set here. Use SPECSHIELD_API_KEY in CI
|
|
938
|
+
# or `specshield login` locally. Never commit a key to a file.
|
|
939
|
+
|
|
940
|
+
# BDCT defaults (used by every `specshield bdct ...` subcommand).
|
|
941
|
+
bdct:
|
|
942
|
+
org: acme-pay
|
|
943
|
+
environment: staging
|
|
944
|
+
# server: https://specshield.io # only set for self-hosted / staging
|
|
945
|
+
|
|
946
|
+
provider:
|
|
947
|
+
name: payment-service
|
|
948
|
+
spec: api/openapi.yaml # paths are relative to this file
|
|
949
|
+
# branch: main # informational tag on each publish
|
|
950
|
+
|
|
951
|
+
# consumer:
|
|
952
|
+
# name: checkout-ui
|
|
953
|
+
# provider: payment-service
|
|
954
|
+
# contract: contracts/payment-service.yaml
|
|
955
|
+
# format: OPENAPI # OPENAPI | PACT
|
|
956
|
+
|
|
957
|
+
# GitHub App + bdct-action defaults.
|
|
752
958
|
github:
|
|
753
959
|
specPath: api/openapi.yaml
|
|
754
960
|
failOnBreaking: true
|
|
755
961
|
commentOnPr: true
|
|
756
962
|
```
|
|
757
963
|
|
|
758
|
-
|
|
964
|
+
When this file is present, BDCT commands collapse to just `--version`:
|
|
965
|
+
|
|
966
|
+
```bash
|
|
967
|
+
specshield bdct publish-provider --version $GITHUB_SHA
|
|
968
|
+
specshield bdct can-i-deploy --version $GITHUB_SHA
|
|
969
|
+
```
|
|
759
970
|
|
|
760
971
|
---
|
|
761
972
|
|
|
@@ -788,12 +999,32 @@ specshield bdct <subcommand> [options]
|
|
|
788
999
|
| `publish-consumer` | Publish a consumer contract (OpenAPI subset or Pact JSON) |
|
|
789
1000
|
| `verify` | Manually trigger verification for a consumer/provider pair |
|
|
790
1001
|
| `can-i-deploy` | Check if a service version is safe to deploy |
|
|
791
|
-
| `matrix` |
|
|
1002
|
+
| `matrix` | Compatibility matrix across all consumer/provider pairs |
|
|
792
1003
|
| `list-providers` | List published provider specs |
|
|
793
1004
|
| `list-consumers` | List published consumer contracts |
|
|
794
1005
|
| `list` | List verification history |
|
|
795
1006
|
|
|
796
|
-
|
|
1007
|
+
Every `bdct` subcommand accepts these flags in common:
|
|
1008
|
+
|
|
1009
|
+
| Flag | Purpose |
|
|
1010
|
+
|---|---|
|
|
1011
|
+
| `--org <key>` | Organization key (or read from `.specshield.yml`'s `bdct.org`) |
|
|
1012
|
+
| `--json` | Machine-readable JSON output |
|
|
1013
|
+
| `--server <url>` | Override SpecShield server URL (self-hosted / staging) |
|
|
1014
|
+
| `--api-token <token>` | API token (overrides env / stored config) |
|
|
1015
|
+
|
|
1016
|
+
Per-subcommand flags:
|
|
1017
|
+
|
|
1018
|
+
| Subcommand | Flags |
|
|
1019
|
+
|---|---|
|
|
1020
|
+
| `publish-provider` | `--spec <path>`, `--provider <name>`, `--version <ver>`, `--env <env>`, `--branch <branch>` |
|
|
1021
|
+
| `publish-consumer` | `--contract <path>`, `--consumer <name>`, `--provider <name>`, `--version <ver>`, `--format OPENAPI\|PACT` |
|
|
1022
|
+
| `verify` | `--consumer <name>`, `--provider <name>`, `--consumer-version <ver>`, `--provider-version <ver>`, `--env <env>` |
|
|
1023
|
+
| `can-i-deploy` | `--service <name>`, `--version <ver>`, `--env <env>` |
|
|
1024
|
+
| `matrix` | `--env <env>` |
|
|
1025
|
+
| `list-providers` | `--provider <name>` (filter) |
|
|
1026
|
+
| `list-consumers` | `--consumer <name>` (filter), `--provider <name>` (filter) |
|
|
1027
|
+
| `list` | `--consumer <name>`, `--provider <name>`, `--env <env>`, `--page <n>`, `--size <n>` |
|
|
797
1028
|
|
|
798
1029
|
---
|
|
799
1030
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specshield",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "CLI for OpenAPI breaking change detection and bi-directional contract verification โ with can-i-deploy gating
|
|
3
|
+
"version": "3.1.2",
|
|
4
|
+
"description": "CLI for OpenAPI breaking change detection and bi-directional contract verification โ with can-i-deploy gating, GitHub PR checks, and a first-run setup wizard.",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"specshield": "./bin/specshield.js"
|
|
@@ -13,36 +13,36 @@
|
|
|
13
13
|
"lint": "eslint src tests --ext .js"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
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
|
-
],
|
|
16
|
+
"openapi",
|
|
17
|
+
"swagger",
|
|
18
|
+
"api-diff",
|
|
19
|
+
"openapi-diff",
|
|
20
|
+
"swagger-diff",
|
|
21
|
+
"breaking-change-detection",
|
|
22
|
+
"api-breaking-changes",
|
|
23
|
+
"api-compatibility",
|
|
24
|
+
"contract-testing",
|
|
25
|
+
"consumer-driven-contract",
|
|
26
|
+
"api-contract",
|
|
27
|
+
"contract-verification",
|
|
28
|
+
"can-i-deploy",
|
|
29
|
+
"ci-cd",
|
|
30
|
+
"github-actions",
|
|
31
|
+
"cli",
|
|
32
|
+
"developer-tools",
|
|
33
|
+
"openapi-compare",
|
|
34
|
+
"swagger-compare",
|
|
35
|
+
"pact-alternative",
|
|
36
|
+
"api-contract-testing",
|
|
37
|
+
"microservices",
|
|
38
|
+
"api-quality",
|
|
39
|
+
"api-governance",
|
|
40
|
+
"bi-directional-contract-testing",
|
|
41
|
+
"bdct",
|
|
42
|
+
"pact-json",
|
|
43
|
+
"github-app",
|
|
44
|
+
"api-drift"
|
|
45
|
+
],
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"files": [
|
|
48
48
|
"bin",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"commander": "^12.0.0",
|
|
57
57
|
"fs-extra": "^11.2.0",
|
|
58
58
|
"js-yaml": "^4.1.0",
|
|
59
|
-
"ora": "^5.4.1"
|
|
59
|
+
"ora": "^5.4.1",
|
|
60
|
+
"prompts": "^2.4.2"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"jest": "^29.7.0"
|
package/src/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const { Command } = require('commander');
|
|
4
4
|
const { version } = require('../package.json');
|
|
5
5
|
const compareCommand = require('./commands/compare');
|
|
6
|
+
const initCommand = require('./commands/init');
|
|
6
7
|
const loginCommand = require('./commands/login');
|
|
7
8
|
const logoutCommand = require('./commands/logout');
|
|
8
9
|
const bdctCommand = require('./commands/bdct');
|
|
@@ -19,6 +20,7 @@ program
|
|
|
19
20
|
.enablePositionalOptions();
|
|
20
21
|
|
|
21
22
|
program.addCommand(compareCommand);
|
|
23
|
+
program.addCommand(initCommand);
|
|
22
24
|
program.addCommand(loginCommand);
|
|
23
25
|
program.addCommand(logoutCommand);
|
|
24
26
|
program.addCommand(bdctCommand);
|