apiome pact
Global options such as --base-url, --tenant and --json go before the command — see CLI reference. Exit codes are listed in Exit codes.
apiome pact
Pact Broker: publish pacts, can-i-deploy, deployments, webhooks and verification, pact-broker compatible.
apiome pact [OPTIONS] COMMAND [ARGS]...
Subcommands: can-i-deploy, check, create-environment, create-or-update-pacticipant, create-version-tag, create-webhook, delete-pacticipant, delete-version, describe-version, export-consumer-contract, export-postman, list-pacticipants, migrate, publish, publish-consumer-contract, publish-provider-contract, publish-verification-results, record, record-deployment, record-release, record-support-ended, record-undeployment, restore-version, retention, scaffold-provider-tests, setup, stub, verify.
apiome pact can-i-deploy
Can this version be deployed? (GET …/matrix, as pact-broker can-i-deploy asks it.)
Prints the matrix rows, pact-broker's "Computer says yes" or "Computer says no" verdict, the reason and the notices. Exits 0 when deployable, 1 when not or when a result is still missing after the retries; --dry-run always exits 0.
apiome pact can-i-deploy [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text (repeatable) | yes | The pacticipant being deployed. | |
--version, -e | text | Its version. | ||
--latest, -l | flag | Its latest version (with --tag: the latest tagged). | ||
--tag | text | With --latest: the tag of the version. | ||
--branch | text | The latest version from this branch. | ||
--main-branch | flag | The latest version from its main branch. | ||
--to-environment | text | The environment it is deployed to. | ||
--to | text | The tag it is deployed to (legacy; prefer environments). | ||
--ignore | text (repeatable) | Leave this pacticipant out of the verdict (repeatable). | ||
--retry-while-unknown | integer range | 0 | Retry this many times while a verification result is missing. | |
--retry-interval | float range | 10 | Seconds between retries. | |
--dry-run | flag | Print the verdict but always exit 0. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact check
Check pacts against several provider versions before publishing (POST …/pacts/check). Publishes nothing.
Each pact is compared with the provider contract of every version --against names: the newest on the provider's main branch (main), what is deployed to or released in an environment (deployed:production), a named version (version:2.7.0), or a revision of the provider's Apiome project as it stands (draft:latest). Prints one row per provider version with the verdict a publish would record, then every interaction that differs or is not in the spec, and every selector that named nothing. Exits 0 when every pact passes against every version and every selector named one; 1 otherwise, as pact-broker does.
apiome pact check [OPTIONS] PACTS...
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
PACTS... | path | yes | Pact files, or directories of *.json pact files. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--against | text (repeatable) | yes | A provider version to compare with (repeatable, at most 10): main, deployed:<environment>, version:<number> or draft:<revision>. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact create-environment
Create an environment (POST …/environments) and print its UUID.
Exits 1 when the name is taken (409) or the caller may not create environments (403).
apiome pact create-environment [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--name | text | yes | The name tooling uses: one word, no spaces. | |
--display-name | text | The name people read. | ||
--production | flag | It is a production environment. | ||
--contract-required | flag | Apiome: can-i-deploy refuses a pacticipant that has no contract. | ||
--contact-name | text | A contact for the environment. | ||
--contact-email-address | text | That contact's email address. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact create-or-update-pacticipant
Create a pacticipant, or update the one with this name, as pact-broker create-or-update-pacticipant.
Reads GET /v1/tenants/{t}/pacticipants/{name} (a name it had before a rename finds it too). When there is none it registers one (POST …/pacticipants); otherwise it sends only the flags given (PATCH …/pacticipants/{handle}) and never renames: rename from the pacticipant's Settings tab. Exits 1 on any refusal, with the server's reason.
apiome pact create-or-update-pacticipant [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--name | text | yes | The pacticipant's name, as pacts use it. | |
--display-name | text | What people read, when it differs. | ||
--main-branch | text | The branch 'latest on main' reads. | ||
--repository-url | text | http(s) URL of its repository. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact create-version-tag
Tag a pacticipant version (PUT /v1/tenants/{t}/pacticipants/{p}/versions/{v}/tags/{tag}), as pact-broker create-version-tag.
Sends one request per tag; a tag the version already has changes nothing. Without --auto-create-version an unknown version is refused (404). Needs pacts:create. Exits 1 on any refusal, after naming the tags that were added before it.
apiome pact create-version-tag [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | The pacticipant's name or handle. | |
--version, -e | text | yes | The version number to tag. | |
--tag, -t | text (repeatable) | The tag (repeatable). | ||
--auto-create-version | flag | Record the version first when it does not exist yet. | ||
--tag-with-git-branch, -g | flag | Also tag the version with the detected git branch. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact create-webhook
Create a webhook (POST …/webhooks), with pact-broker create-webhook's options.
Choose at least one event flag (--contract-content-changed, --contract-published, --contract-requiring-verification-published, --provider-verification-published, --provider-verification-succeeded, --provider-verification-failed, --consumer-version-branch-created). The password is stored sealed and never printed. Exits 1 when the broker refuses the webhook (a private host, an unknown pacticipant).
apiome pact create-webhook [OPTIONS] URL
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
URL | text | yes | The URL the webhook calls. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--request, -X | text | POST | The method: POST, PUT or PATCH. | |
--header, -H | text (repeatable) | 'Name: value' (repeatable). | ||
--data, -d | text | The body; @file reads it from a file. | ||
--user, -u | text | 'username:password' for basic auth (stored sealed). | ||
--consumer | text | Only pacts of this consumer. | ||
--provider | text | Only pacts of this provider. | ||
--description | text | What the webhook is for. | ||
--contract-content-changed | flag | |||
--contract-published | flag | |||
--contract-requiring-verification-published | flag | |||
--provider-verification-published | flag | |||
--provider-verification-succeeded | flag | |||
--provider-verification-failed | flag | |||
--consumer-version-branch-created | flag | |||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact delete-pacticipant
Delete a pacticipant with its versions, pacts and results (DELETE /v1/tenants/{t}/pacticipants/{name}).
The delete is soft: it can be undone from the Pacticipants page (or POST …/pacticipants/{name}/restore) until it is purged. Refused while one of its versions is deployed or released: record the undeployment first. Needs pacts:delete. Exits 1 on any refusal.
apiome pact delete-pacticipant [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--name | text | yes | The pacticipant's name or handle. | |
--reason | text | Why; stored with the delete and audited. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact delete-version
Delete a pacticipant version with its pacts and results (DELETE …/pacticipants/{p}/versions/{v}).
The delete is soft: restore-version (or the Versions tab's Restore) brings the version, its pacts and results back until it is purged. Refused while the version is deployed or released: record the undeployment first. Needs pacts:delete. Exits 1 on any refusal.
apiome pact delete-version [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | The pacticipant's name or handle. | |
--version, -e | text | yes | The version number to delete. | |
--reason | text | Why; stored with the delete and audited. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact describe-version
Describe a pacticipant version: number, branches, tags, build URL, creation time.
With --version it reads GET …/pact-broker/pacticipants/{p}/versions/{v}; otherwise the latest recorded version (with --tag, the latest carrying that tag). Exits 1 when there is none.
apiome pact describe-version [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | The pacticipant's name or handle. | |
--version, -e | text | The version number. | ||
--latest, -l | flag | The latest version (the default without -e). | ||
--tag | text | With --latest: the latest version with this tag. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact export-consumer-contract
Export a picker-declared consumer surface as a Pact v4 file (GET …/consumers/{c}/pact).
The pact carries one interaction per declared operation and response status, only the declared fields, and the specification's examples as sample values. Prints the findings — every value that had to be invented (placeholder) and everything left out (omitted), with a reason. Without --output the Pact JSON goes to stdout and the summary to stderr. Exits 1 when the server refuses (a contract imported from a Pact file, or one that yields no interaction), or with --fail-on-findings when there are findings.
apiome pact export-consumer-contract [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--project, -p | text | yes | The project the consumer consumes (slug or id). | |
--consumer, -c | text | yes | The consumer (slug or id). | |
--revision | integer range | A contract revision; defaults to the current one. | ||
--provider | text | The provider pacticipant name; defaults to the project's bound pacticipant. | ||
--output, -o | file | Write the Pact file here instead of stdout. | ||
--fail-on-findings | flag | Exit 1 when any value was invented or anything was left out. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact export-postman
Export a pact as a Postman Collection v2.1 (POST …/pact-postman-collections).
One request per HTTP interaction against {{baseUrl}}, a saved example of the expected response and a test script checking it (status, headers, body by Pact's default rules). Name a stored pact with --provider and --consumer (the latest pact, or one of --consumer-version, --tag, --branch, --pact-version), every consumer's latest pact with --provider and --all-consumers, or send a local file with --pact-file. --state-setup adds a pre-request script per request that POSTs its provider states to {{stateChangeUrl}} (--state-change-url) first. Prints every notice — what was left out, not asserted or not applied, with a reason, and the provider states to set up. Without --output the collection goes to stdout and the summary to stderr. Exits 1 when the server refuses (no such pact, no HTTP interaction to export), or with --fail-on-left-out when an interaction was left out. For a collection from a specification, use apiome export postman.
apiome pact export-postman [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | The provider pacticipant (handle, id or name); required for a stored pact. | ||
--consumer | text | The consumer pacticipant (handle, id or name); required for a stored pact. | ||
--consumer-version | text | The pact this consumer version published. | ||
--tag | text | The latest pact of consumer versions with this tag. | ||
--branch | text | The latest pact of consumer versions on this branch. | ||
--pact-version | text | The pact with this content SHA (64 hex characters). | ||
--pact-file | file | Export a local Pact file instead of a stored pact (nothing is published). | ||
--provider-base-url | text | The value of the {{baseUrl}} collection variable (http or https URL). | ||
--tests / --no-tests | flag | --tests | Give each request a test script. | |
--all-consumers | flag | Export the latest pact of every consumer of --provider (or the latest with --tag / on --branch), one folder per consumer. | ||
--state-setup | flag | Give each request that needs provider states a pre-request script that sets them up through {{stateChangeUrl}}. | ||
--state-change-url | text | The value of the {{stateChangeUrl}} variable (http or https URL); needs --state-setup. | ||
--output, -o | file | Write the collection here instead of stdout. | ||
--fail-on-left-out | flag | Exit 1 when any interaction was left out of the collection. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact list-pacticipants
List the workspace's pacticipants (GET /v1/tenants/{t}/pacticipants, every page).
Prints name, handle, main branch, repository and labels. JSON output is {"pacticipants": [...], "count": N} over all pages.
apiome pact list-pacticipants [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--label | text | Only pacticipants with this label. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact migrate
Migrate a Pact Broker or PactFlow workspace into Apiome (POST …/pact-migration/import).
Reads the source through its REST API — pacticipants and labels, versions with branches and tags, pacts, verification results, environments, current deployments and releases, webhooks — and re-creates them in the workspace -b/-k (or PACT_BROKER_BASE_URL/TOKEN) names, keeping the source's timestamps. Importing again changes nothing, so a run can be repeated; progress is kept in --state, so a second run skips what the first imported. --dry-run checks every record and writes nothing.
--follow keeps copying while pipelines move over one by one: every --interval minutes (15) it runs again from --state, so only what was published to the source since is read and copied. It stops on Ctrl-C, or by itself when the source has been unreachable for 24 hours (exit 1, saying so).
The report lists everything not portable (PactFlow secrets, which are never exported, are listed for re-entry; webhooks with redacted credentials are imported disabled) and every refused record with its reason. Exits 0 when every record was imported (or, with --dry-run, would be); 1 otherwise.
apiome pact migrate [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--from | text | The source Pact Broker or PactFlow base URL, e.g. https://acme.pactflow.io. | ||
--token | text | A read token for the source (or PACT_SOURCE_BROKER_TOKEN; prefer the variable: argv is visible). Env: PACT_SOURCE_BROKER_TOKEN. | ||
--username | text | Basic-auth user of an open-source source broker. Env: PACT_SOURCE_BROKER_USERNAME. | ||
--password | text | Basic-auth password (prefer the variable). Env: PACT_SOURCE_BROKER_PASSWORD. | ||
--dry-run | flag | Read the source and check every record against Apiome; write nothing. | ||
--state | path | apiome-pact-migrate.state.json | Where progress is kept, so a second run resumes. | |
--restart | flag | Ignore the progress kept in --state and send everything. | ||
--matrix-limit | integer range | 1000 | Matrix rows read per integration (pacts and results). | |
--batch-bytes | integer range | 4194304 | About how many bytes of records one request carries. | |
--follow | flag | Keep copying until everyone has moved: after the copy, run again every --interval minutes, copying only what is new, until stopped (Ctrl-C) or the source has been unreachable for 24 hours. | ||
--interval | integer range | 15 | Minutes between --follow passes. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact publish
Publish pacts for a consumer version (POST …/contracts/publish), as pact-broker publish.
Reads every pact first and refuses the run before anything is sent when a file is not a pact. Sends one request per consumer (at most 100 pacts each), records the branch, tags and build URL, and prints the broker's notices — including the bi-directional comparisons a publish runs. Exits 1 on any refusal (409 when that version already published a different pact).
apiome pact publish [OPTIONS] PACTS...
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
PACTS... | path | yes | Pact files, or directories of *.json pact files. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--consumer-app-version, -a | text | The consumer build's version (a commit SHA is best). | ||
--branch | text | The branch the build came from. | ||
--auto-detect-version-properties, -r | flag | Read the branch and build URL from the CI environment (GitHub, GitLab, Jenkins, …) or git. | ||
--tag, -t | text (repeatable) | Tag the consumer version (repeatable). | ||
--tag-with-git-branch, -g | flag | Also tag the version with the detected branch. | ||
--build-url | text | http(s) URL of the CI build. | ||
--merge | flag | Not supported: refused with the reason. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact publish-consumer-contract
Publish a picker-declared consumer surface to the Pact Broker (POST …/consumers/{c}/pact/publish).
Generates the same Pact v4 file as export-consumer-contract and publishes it for the consumer version, as pact-broker publish would: branch, tags and build URL are recorded and the bi-directional comparisons run. Prints the findings and the broker's notices. Exits 1 when the server refuses (409 when that version already published a different pact), or with --fail-on-findings when there are findings.
apiome pact publish-consumer-contract [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--project, -p | text | yes | The project the consumer consumes (slug or id). | |
--consumer, -c | text | yes | The consumer (slug or id). | |
--consumer-app-version, -a | text | yes | The consumer build's version (a commit SHA is best). | |
--branch | text | The branch the build came from. | ||
--tag, -t | text (repeatable) | Tag the consumer version (repeatable). | ||
--build-url | text | http(s) URL of the CI build. | ||
--revision | integer range | A contract revision; defaults to the current one. | ||
--provider | text | The provider pacticipant name; defaults to the project's bound pacticipant. | ||
--output, -o | file | Also write the published Pact file here. | ||
--fail-on-findings | flag | Exit 1 when any value was invented or anything was left out. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact publish-provider-contract
Publish a provider contract with its self-verification evidence (PUT …/contracts/provider/…).
Prints what was published, what the evidence proved (verified, failed, inconclusive or missing, with the report's kind, tool, digest and counts) and the bi-directional comparisons the publish ran. Exits 1 when the server refuses the request (a bad document or report, with its location), or with --fail-on-unverified when the contract is unverified.
apiome pact publish-provider-contract [OPTIONS] [CONTRACT]
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
CONTRACT | file | The provider's OpenAPI 3.x document (JSON or YAML). Omit with --apiome-version. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | yes | The provider's name in the broker. | |
--provider-app-version, -a | text | yes | The provider build's version (a commit SHA is best). | |
--apiome-version | text | Render the contract from an Apiome version, '<project>@<version>', instead of a file. | ||
--content-type | text | The contract's media type; inferred from .json / .yaml / .yml. | ||
--branch | text | The branch the build came from. | ||
--tag, -t | text (repeatable) | Tag the provider version (repeatable). | ||
--build-url | text | http(s) URL of the CI build. | ||
--evidence, --verification-results | file | Self-verification report: JUnit XML (Schemathesis, Dredd, Newman or any JUnit writer), Newman JSON or Schemathesis NDJSON. | ||
--evidence-content-type, --verification-results-content-type | text | The report's media type; inferred from .xml / .json / .ndjson / .jsonl / .txt. | ||
--evidence-report | text | An Apiome provider-verification report id instead of a report file. | ||
--verification-exit-code | integer | The verifier's exit code; 0 is success. Without it a report file counts as success unless the report shows failures. | ||
--verifier | text | The tool that wrote the report (schemathesis, dredd, newman). | ||
--verifier-version | text | That tool's version. | ||
--fail-on-unverified | flag | Exit 1 when the published contract has no passing self-verification evidence. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact publish-verification-results
Publish a verification report produced elsewhere (POST …/external-verification-results).
Reads pact_verifier_cli --json output, JUnit XML, or a Schemathesis (NDJSON or JUnit), Newman (JSON or JUnit) or Dredd (xunit) report on the server, stores it as a verification result of the pact version and prints the verdict and every note about what could not be used. Exits 1 when the server refuses (a malformed or empty report, an unknown pact version), or with --fail-on-failure when the result is a failure.
apiome pact publish-verification-results [OPTIONS] REPORT
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
REPORT | file | yes | The report: pact_verifier_cli --json output, JUnit XML, or a Schemathesis, Newman or Dredd report. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | yes | The provider's name in the broker. | |
--consumer | text | yes | The consumer's name in the broker. | |
--pact-version | text | yes | The verified pact version's SHA-256. | |
--provider-app-version, -a | text | yes | The provider build's version (a commit SHA is best). | |
--branch | text | The branch the provider build came from. | ||
--tag, -t | text (repeatable) | Tag the provider version (repeatable). | ||
--build-url | text | http(s) URL of the CI build. | ||
--format | text | auto | The report's format (auto, pact-verifier-json, junit, schemathesis, newman, dredd); auto reads the file name, then the body. | |
--content-type | text | The report's media type; inferred from .json / .xml / .ndjson. | ||
--verifier | text | The tool that wrote the report. | ||
--verifier-version | text | That tool's version. | ||
--fail-on-failure | flag | Exit 1 when the published result is a failure. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact record
Record a pact from a test run against the hosted mock: start a capture, run, stop, generate, publish.
Runs the command after -- with APIOME_MOCK_URL, APIOME_MOCK_CAPTURE_HEADER (X-Mock-Capture) and APIOME_MOCK_CAPTURE (<consumer>@<version>) in its environment; point the tests at the mock and send the header. Then turns the calls into a pact (pacts/<consumer>-<provider>.json) and, with --publish, hands it to the mock's recording policy, which publishes it, holds it for review or skips it. Exits with the command's code when it failed, 1 when nothing was recorded or the generation or publish was refused, else 0.
apiome pact record [OPTIONS] [COMMAND]...
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
COMMAND... | text | The test command, after --: e.g. -- npm test. It runs as given, not through a shell. |
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--mock | text | yes | The mocked API, <project>/<version> (slug or id, version label). | |
--consumer, -c | text | yes | The consumer's name, as its pacts name it. | |
--consumer-app-version, -a | text | The consumer build's version. Default: the commit (CI variables, then git rev-parse HEAD). | ||
--branch | text | The branch the build came from. Default: the CI branch, then git's. | ||
--tag, -t | text (repeatable) | Tag the consumer version when publishing (repeatable). | ||
--build-url | text | http(s) URL of the CI build. Default: the CI's. | ||
--provider | text | The provider's name. Default: the pacticipant bound to the mocked project. | ||
--matching | exact | type | spec | type | exact: the recorded values; type: any value of the same type; spec: type plus the spec's formats. | |
--fields | all | read | all | all: every response field the mock returned; read: only the fields the tests reported reading (the SDK's fieldUsage hook or the mock's browser recorder). | |
--publish | flag | Publish the pact through the mock's recording policy: by default only when the command passed, and a pact that got looser is published with its owners told, or held for review. | ||
--pact-dir | directory | pacts | Where to write <consumer>-<provider>.json. | |
--append | flag | Keep calls an earlier run recorded for this consumer version (default: start clean). | ||
--capture-url | flag | Also export APIOME_MOCK_CAPTURE_URL, a private capture URL for clients that cannot add a header. | ||
--settle-timeout | float range | 15.0 | Seconds to wait, after the command, for the mock to write the calls. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact record-deployment
Record that a version is deployed to an environment (POST …/deployed-versions/environment/{uuid}).
The environment is looked up by name; an unknown name exits 1 with the command that creates it. A deployment replaces the version previously deployed to the same environment and instance.
apiome pact record-deployment [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | What was deployed. | |
--version, -e | text | yes | Its version. | |
--environment | text | yes | The environment's name. | |
--application-instance, --target | text | The instance deployed to (a region, a customer). | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact record-release
Record that a version is released to an environment (POST …/released-versions/environment/{uuid}).
Unlike a deployment, a release keeps earlier released versions supported until their support ends. An unknown environment name exits 1 with the command that creates it.
apiome pact record-release [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | What was released. | |
--version, -e | text | yes | Its version. | |
--environment | text | yes | The environment's name. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact record-support-ended
Record that a released version is no longer supported (PATCH …/released-versions/{uuid}).
Reads the release (GET …/environments/{uuid}/released-versions/currently-supported), then sends {"currentlySupported": false}. From then on can-i-deploy no longer holds its counterparts to it. A version that is not currently released there exits 1.
apiome pact record-support-ended [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | The pacticipant. | |
--version, -e | text | yes | The released version that is no longer supported. | |
--environment | text | yes | The environment's name. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact record-undeployment
Record that a pacticipant is no longer deployed to an environment (PATCH …/deployed-versions/{uuid}).
Reads what is currently deployed there (GET …/environments/{uuid}/deployed-versions/currently-deployed), then sends {"currentlyDeployed": false} to the deployment in that instance. The deployment stays in the history. Nothing deployed there — or only to other instances — exits 1 and says what is.
apiome pact record-undeployment [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | What was undeployed. | |
--environment | text | yes | The environment's name. | |
--application-instance, --target | text | The instance it was undeployed from; leave out for the environment's unnamed instance. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact restore-version
Restore a deleted version with its pacts, results and deployments (POST …/versions/{v}/restore).
Works until the version is purged. Refused (409) when the version is not deleted, or when a live version has taken the number since. Needs pacts:delete. Exits 1 on any refusal.
apiome pact restore-version [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--pacticipant, -a | text | yes | The pacticipant's name or handle. | |
--version, -e | text | yes | The deleted version's number. | |
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact retention
Contracts clean-up rules: show them, change them, preview what they remove.
apiome pact retention [OPTIONS] COMMAND [ARGS]...
Subcommands: preview, set, show.
apiome pact retention preview
Preview what the clean-up rules remove if they ran now (POST …/pact-retention/policy/preview).
Without flags it previews the saved rules — exactly what the next nightly run removes. With rule flags it previews the saved rules changed by them, without saving. Needs pacts:view.
apiome pact retention preview [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--main-branch-latest | integer range | Keep the latest N versions of each main branch (0: no such rule). | ||
--other-branch-latest | integer range | Keep the latest N versions of every other branch (0: no such rule). | ||
--other-branch-days | integer range | With --other-branch-latest: only while recorded in the last D days (0: however old). | ||
--keep-tag | text (repeatable) | Keep every version with this tag (repeat for several; replaces the saved tags). | ||
--no-tags | flag | Keep nothing by tag (clears the saved tags). | ||
--nightly / --no-nightly | flag | --no-nightly | Run the clean-up every night after 02:00 UTC, or not. | |
--restore-days | integer range | Days a deleted pacticipant or version stays restorable. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact retention set
Change the clean-up rules; the ones not given stay as saved (PUT …/pact-retention/policy).
Deployed and released versions are always kept. Run apiome pact retention preview with the same flags first to see what the rules remove. Needs pacts:delete. Exits 1 on any refusal.
apiome pact retention set [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--main-branch-latest | integer range | Keep the latest N versions of each main branch (0: no such rule). | ||
--other-branch-latest | integer range | Keep the latest N versions of every other branch (0: no such rule). | ||
--other-branch-days | integer range | With --other-branch-latest: only while recorded in the last D days (0: however old). | ||
--keep-tag | text (repeatable) | Keep every version with this tag (repeat for several; replaces the saved tags). | ||
--no-tags | flag | Keep nothing by tag (clears the saved tags). | ||
--nightly / --no-nightly | flag | --no-nightly | Run the clean-up every night after 02:00 UTC, or not. | |
--restore-days | integer range | Days a deleted pacticipant or version stays restorable. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact retention show
Show the clean-up rules, the nightly switch and the restore window (GET …/pact-retention/policy).
Needs pacts:view. Exits 1 on any refusal.
apiome pact retention show [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact scaffold-provider-tests
Write a provider verification test from the provider's pacts (GET …/pact-provider-tests/{provider}).
The file reads the broker from PACT_BROKER_BASE_URL and PACT_BROKER_TOKEN (no secret is written into it), selects pacts with the recommended selectors (main branch, deployed or released) with pending pacts on, and carries one state handler stub per provider state the pacts name, with the parameters they send. Prints the states, flags those not registered in Apiome and lists every notice. Without --output the file goes to stdout and the summary to stderr. Exits 1 when the server refuses (no such provider), or with --fail-on-unregistered.
apiome pact scaffold-provider-tests [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | yes | The provider pacticipant (handle, id or name). | |
--language, -l | typescript | java | go | python | yes | typescript (pact-js), java (pact-jvm, JUnit 5), go (pact-go v2) or python (pact-python 2). | |
--output, -o | file | Write the test file here instead of stdout. | ||
--fail-on-unregistered | flag | Exit 1 when a state the file handles is not registered in Apiome. | ||
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact setup
Set up contracts: pacticipants, environments and pipelines, or show how far the set-up is.
With no flag, shows the six sections of the guided set-up (GET …/pact-setup). Each flag sets one part up and leaves what already exists alone, so the command can be run again. Reading needs pacts:view, creating pacts:create, --ci and --write-secrets pacts:delete. Exits 1 when anything failed; a repository skipped with a reason is not a failure.
apiome pact setup [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--from-projects | flag | Create a pacticipant for each proposed project and repository that has none. | ||
--environments | text | Create these environments if missing, comma-separated: production,staging. | ||
--require-contract | flag | With --environments: can-i-deploy to production requires a contract. | ||
--ci | text | Open pull requests adding can-i-deploy and record-deployment. Only: github. | ||
--ci-environment | text | The environment the pipeline asks about (default: production, else the first). | ||
--write-secrets | flag | Store this command's broker address and key as Actions secrets in the workspace's GitHub repositories. | ||
--dry-run | flag | Print what a run would do; change nothing. | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact stub
Serve a provider's pacts as a hosted mock (PUT …/pact-stubs/{provider}/{name}).
Prints the stub's URL, the pacts and interactions it serves, the provider states to send as X-Mock-Scenario, and everything not served with the reason. Re-running with the same name replaces the stub. Needs pacts:create (pacts:delete with --delete). Exits 1 on any refusal.
apiome pact stub [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | yes | The provider whose pacts the stub serves (name or handle). | |
--pacts | text (repeatable) | The pacts to serve, comma-separated or repeated: main (each consumer's latest from its main branch), deployed, deployed:<environment>, or <consumer>@<version>. | ||
--name | text | The last segment of the stub's URL (default: from --pacts, as in main-deployed). | ||
--fallback | text | spec | When no interaction matches: spec (the spec mock) or not-implemented (501). | |
--fallback-mock | text | With --fallback spec: the spec mock to answer from, <project>/<version>. | ||
--delete | flag | Stop serving the stub named by --name (or by --pacts). | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |
apiome pact verify
Verify a provider against its pacts with Apiome's hosted verifier (POST …/pact-verifier/…/verify).
Selects the pacts the provider must honour, replays each interaction against the registered target and publishes a result per conclusive pact. Prints one row per pact and every interaction that could not be replayed, with its reason, every pact skipped as already verified, and why the target could not be reached. Exits 0 when the run succeeded, 1 otherwise (a failed pact, an incomplete run, a target that could not be reached, or no pacts selected). A production target never receives mutating requests: --allow-mutating against one is refused.
apiome pact verify [OPTIONS]
Options
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
--provider | text | yes | The provider's name or handle. | |
--provider-app-version, -a | text | yes | The provider build's version (a commit SHA is best). | |
--target | text | yes | The registered verification target to replay against. | |
--branch | text | The provider build's branch. | ||
--build-url | text | http(s) URL of the CI build. | ||
--consumer-version-selector | text (repeatable) | A selector as JSON, e.g. '{"mainBranch": true}' (repeatable). | ||
--enable-pending | flag | A pending pact's failure does not fail the run. | ||
--include-wip-pacts-since | text | Also verify work-in-progress pacts published since this date. | ||
--allow-mutating | flag | Replay POST/PUT/PATCH/DELETE interactions (the target must allow them). | ||
--replay-without-state-setup | flag | Replay interactions whose provider state nothing sets up. | ||
--provider-states-setup-url | text | POST each provider state to this endpoint (a path on the target or an http(s) URL) instead of the registry. | ||
--skip-already-verified | flag | Skip pacts that already have a result for this provider version. | ||
--publish-verification-results / --no-publish-verification-results | flag | --publish-verification-results | Publish the results. | |
--context | text (repeatable) | Non-secret CI context KEY=VALUE stored with the evidence (repeatable). | ||
--output, -o | text | table | table, json or markdown. | |
--broker-base-url, -b | text | Broker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL). | ||
--broker-token, -k | text | Workspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others. |