Skip to main content

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

OptionTypeDefaultRequiredDescription
--pacticipant, -atext (repeatable)yesThe pacticipant being deployed.
--version, -etextIts version.
--latest, -lflagIts latest version (with --tag: the latest tagged).
--tagtextWith --latest: the tag of the version.
--branchtextThe latest version from this branch.
--main-branchflagThe latest version from its main branch.
--to-environmenttextThe environment it is deployed to.
--totextThe tag it is deployed to (legacy; prefer environments).
--ignoretext (repeatable)Leave this pacticipant out of the verdict (repeatable).
--retry-while-unknowninteger range0Retry this many times while a verification result is missing.
--retry-intervalfloat range10Seconds between retries.
--dry-runflagPrint the verdict but always exit 0.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
PACTS...pathyesPact files, or directories of *.json pact files.

Options

OptionTypeDefaultRequiredDescription
--againsttext (repeatable)yesA provider version to compare with (repeatable, at most 10): main, deployed:<environment>, version:<number> or draft:<revision>.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--nametextyesThe name tooling uses: one word, no spaces.
--display-nametextThe name people read.
--productionflagIt is a production environment.
--contract-requiredflagApiome: can-i-deploy refuses a pacticipant that has no contract.
--contact-nametextA contact for the environment.
--contact-email-addresstextThat contact's email address.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--nametextyesThe pacticipant's name, as pacts use it.
--display-nametextWhat people read, when it differs.
--main-branchtextThe branch 'latest on main' reads.
--repository-urltexthttp(s) URL of its repository.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesThe pacticipant's name or handle.
--version, -etextyesThe version number to tag.
--tag, -ttext (repeatable)The tag (repeatable).
--auto-create-versionflagRecord the version first when it does not exist yet.
--tag-with-git-branch, -gflagAlso tag the version with the detected git branch.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
URLtextyesThe URL the webhook calls.

Options

OptionTypeDefaultRequiredDescription
--request, -XtextPOSTThe method: POST, PUT or PATCH.
--header, -Htext (repeatable)'Name: value' (repeatable).
--data, -dtextThe body; @file reads it from a file.
--user, -utext'username:password' for basic auth (stored sealed).
--consumertextOnly pacts of this consumer.
--providertextOnly pacts of this provider.
--descriptiontextWhat the webhook is for.
--contract-content-changedflag
--contract-publishedflag
--contract-requiring-verification-publishedflag
--provider-verification-publishedflag
--provider-verification-succeededflag
--provider-verification-failedflag
--consumer-version-branch-createdflag
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--nametextyesThe pacticipant's name or handle.
--reasontextWhy; stored with the delete and audited.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesThe pacticipant's name or handle.
--version, -etextyesThe version number to delete.
--reasontextWhy; stored with the delete and audited.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesThe pacticipant's name or handle.
--version, -etextThe version number.
--latest, -lflagThe latest version (the default without -e).
--tagtextWith --latest: the latest version with this tag.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--project, -ptextyesThe project the consumer consumes (slug or id).
--consumer, -ctextyesThe consumer (slug or id).
--revisioninteger rangeA contract revision; defaults to the current one.
--providertextThe provider pacticipant name; defaults to the project's bound pacticipant.
--output, -ofileWrite the Pact file here instead of stdout.
--fail-on-findingsflagExit 1 when any value was invented or anything was left out.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--providertextThe provider pacticipant (handle, id or name); required for a stored pact.
--consumertextThe consumer pacticipant (handle, id or name); required for a stored pact.
--consumer-versiontextThe pact this consumer version published.
--tagtextThe latest pact of consumer versions with this tag.
--branchtextThe latest pact of consumer versions on this branch.
--pact-versiontextThe pact with this content SHA (64 hex characters).
--pact-filefileExport a local Pact file instead of a stored pact (nothing is published).
--provider-base-urltextThe value of the {{baseUrl}} collection variable (http or https URL).
--tests / --no-testsflag--testsGive each request a test script.
--all-consumersflagExport the latest pact of every consumer of --provider (or the latest with --tag / on --branch), one folder per consumer.
--state-setupflagGive each request that needs provider states a pre-request script that sets them up through {{stateChangeUrl}}.
--state-change-urltextThe value of the {{stateChangeUrl}} variable (http or https URL); needs --state-setup.
--output, -ofileWrite the collection here instead of stdout.
--fail-on-left-outflagExit 1 when any interaction was left out of the collection.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--labeltextOnly pacticipants with this label.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--fromtextThe source Pact Broker or PactFlow base URL, e.g. https://acme.pactflow.io.
--tokentextA read token for the source (or PACT_SOURCE_BROKER_TOKEN; prefer the variable: argv is visible). Env: PACT_SOURCE_BROKER_TOKEN.
--usernametextBasic-auth user of an open-source source broker. Env: PACT_SOURCE_BROKER_USERNAME.
--passwordtextBasic-auth password (prefer the variable). Env: PACT_SOURCE_BROKER_PASSWORD.
--dry-runflagRead the source and check every record against Apiome; write nothing.
--statepathapiome-pact-migrate.state.jsonWhere progress is kept, so a second run resumes.
--restartflagIgnore the progress kept in --state and send everything.
--matrix-limitinteger range1000Matrix rows read per integration (pacts and results).
--batch-bytesinteger range4194304About how many bytes of records one request carries.
--followflagKeep 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.
--intervalinteger range15Minutes between --follow passes.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
PACTS...pathyesPact files, or directories of *.json pact files.

Options

OptionTypeDefaultRequiredDescription
--consumer-app-version, -atextThe consumer build's version (a commit SHA is best).
--branchtextThe branch the build came from.
--auto-detect-version-properties, -rflagRead the branch and build URL from the CI environment (GitHub, GitLab, Jenkins, …) or git.
--tag, -ttext (repeatable)Tag the consumer version (repeatable).
--tag-with-git-branch, -gflagAlso tag the version with the detected branch.
--build-urltexthttp(s) URL of the CI build.
--mergeflagNot supported: refused with the reason.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--project, -ptextyesThe project the consumer consumes (slug or id).
--consumer, -ctextyesThe consumer (slug or id).
--consumer-app-version, -atextyesThe consumer build's version (a commit SHA is best).
--branchtextThe branch the build came from.
--tag, -ttext (repeatable)Tag the consumer version (repeatable).
--build-urltexthttp(s) URL of the CI build.
--revisioninteger rangeA contract revision; defaults to the current one.
--providertextThe provider pacticipant name; defaults to the project's bound pacticipant.
--output, -ofileAlso write the published Pact file here.
--fail-on-findingsflagExit 1 when any value was invented or anything was left out.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
CONTRACTfileThe provider's OpenAPI 3.x document (JSON or YAML). Omit with --apiome-version.

Options

OptionTypeDefaultRequiredDescription
--providertextyesThe provider's name in the broker.
--provider-app-version, -atextyesThe provider build's version (a commit SHA is best).
--apiome-versiontextRender the contract from an Apiome version, '<project>@<version>', instead of a file.
--content-typetextThe contract's media type; inferred from .json / .yaml / .yml.
--branchtextThe branch the build came from.
--tag, -ttext (repeatable)Tag the provider version (repeatable).
--build-urltexthttp(s) URL of the CI build.
--evidence, --verification-resultsfileSelf-verification report: JUnit XML (Schemathesis, Dredd, Newman or any JUnit writer), Newman JSON or Schemathesis NDJSON.
--evidence-content-type, --verification-results-content-typetextThe report's media type; inferred from .xml / .json / .ndjson / .jsonl / .txt.
--evidence-reporttextAn Apiome provider-verification report id instead of a report file.
--verification-exit-codeintegerThe verifier's exit code; 0 is success. Without it a report file counts as success unless the report shows failures.
--verifiertextThe tool that wrote the report (schemathesis, dredd, newman).
--verifier-versiontextThat tool's version.
--fail-on-unverifiedflagExit 1 when the published contract has no passing self-verification evidence.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
REPORTfileyesThe report: pact_verifier_cli --json output, JUnit XML, or a Schemathesis, Newman or Dredd report.

Options

OptionTypeDefaultRequiredDescription
--providertextyesThe provider's name in the broker.
--consumertextyesThe consumer's name in the broker.
--pact-versiontextyesThe verified pact version's SHA-256.
--provider-app-version, -atextyesThe provider build's version (a commit SHA is best).
--branchtextThe branch the provider build came from.
--tag, -ttext (repeatable)Tag the provider version (repeatable).
--build-urltexthttp(s) URL of the CI build.
--formattextautoThe report's format (auto, pact-verifier-json, junit, schemathesis, newman, dredd); auto reads the file name, then the body.
--content-typetextThe report's media type; inferred from .json / .xml / .ndjson.
--verifiertextThe tool that wrote the report.
--verifier-versiontextThat tool's version.
--fail-on-failureflagExit 1 when the published result is a failure.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

ArgumentTypeRequiredDescription
COMMAND...textThe test command, after --: e.g. -- npm test. It runs as given, not through a shell.

Options

OptionTypeDefaultRequiredDescription
--mocktextyesThe mocked API, <project>/<version> (slug or id, version label).
--consumer, -ctextyesThe consumer's name, as its pacts name it.
--consumer-app-version, -atextThe consumer build's version. Default: the commit (CI variables, then git rev-parse HEAD).
--branchtextThe branch the build came from. Default: the CI branch, then git's.
--tag, -ttext (repeatable)Tag the consumer version when publishing (repeatable).
--build-urltexthttp(s) URL of the CI build. Default: the CI's.
--providertextThe provider's name. Default: the pacticipant bound to the mocked project.
--matchingexact | type | spectypeexact: the recorded values; type: any value of the same type; spec: type plus the spec's formats.
--fieldsall | readallall: 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).
--publishflagPublish 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-dirdirectorypactsWhere to write <consumer>-<provider>.json.
--appendflagKeep calls an earlier run recorded for this consumer version (default: start clean).
--capture-urlflagAlso export APIOME_MOCK_CAPTURE_URL, a private capture URL for clients that cannot add a header.
--settle-timeoutfloat range15.0Seconds to wait, after the command, for the mock to write the calls.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesWhat was deployed.
--version, -etextyesIts version.
--environmenttextyesThe environment's name.
--application-instance, --targettextThe instance deployed to (a region, a customer).
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesWhat was released.
--version, -etextyesIts version.
--environmenttextyesThe environment's name.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesThe pacticipant.
--version, -etextyesThe released version that is no longer supported.
--environmenttextyesThe environment's name.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesWhat was undeployed.
--environmenttextyesThe environment's name.
--application-instance, --targettextThe instance it was undeployed from; leave out for the environment's unnamed instance.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--pacticipant, -atextyesThe pacticipant's name or handle.
--version, -etextyesThe deleted version's number.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--main-branch-latestinteger rangeKeep the latest N versions of each main branch (0: no such rule).
--other-branch-latestinteger rangeKeep the latest N versions of every other branch (0: no such rule).
--other-branch-daysinteger rangeWith --other-branch-latest: only while recorded in the last D days (0: however old).
--keep-tagtext (repeatable)Keep every version with this tag (repeat for several; replaces the saved tags).
--no-tagsflagKeep nothing by tag (clears the saved tags).
--nightly / --no-nightlyflag--no-nightlyRun the clean-up every night after 02:00 UTC, or not.
--restore-daysinteger rangeDays a deleted pacticipant or version stays restorable.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--main-branch-latestinteger rangeKeep the latest N versions of each main branch (0: no such rule).
--other-branch-latestinteger rangeKeep the latest N versions of every other branch (0: no such rule).
--other-branch-daysinteger rangeWith --other-branch-latest: only while recorded in the last D days (0: however old).
--keep-tagtext (repeatable)Keep every version with this tag (repeat for several; replaces the saved tags).
--no-tagsflagKeep nothing by tag (clears the saved tags).
--nightly / --no-nightlyflag--no-nightlyRun the clean-up every night after 02:00 UTC, or not.
--restore-daysinteger rangeDays a deleted pacticipant or version stays restorable.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--providertextyesThe provider pacticipant (handle, id or name).
--language, -ltypescript | java | go | pythonyestypescript (pact-js), java (pact-jvm, JUnit 5), go (pact-go v2) or python (pact-python 2).
--output, -ofileWrite the test file here instead of stdout.
--fail-on-unregisteredflagExit 1 when a state the file handles is not registered in Apiome.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--from-projectsflagCreate a pacticipant for each proposed project and repository that has none.
--environmentstextCreate these environments if missing, comma-separated: production,staging.
--require-contractflagWith --environments: can-i-deploy to production requires a contract.
--citextOpen pull requests adding can-i-deploy and record-deployment. Only: github.
--ci-environmenttextThe environment the pipeline asks about (default: production, else the first).
--write-secretsflagStore this command's broker address and key as Actions secrets in the workspace's GitHub repositories.
--dry-runflagPrint what a run would do; change nothing.
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--providertextyesThe provider whose pacts the stub serves (name or handle).
--pactstext (repeatable)The pacts to serve, comma-separated or repeated: main (each consumer's latest from its main branch), deployed, deployed:<environment>, or <consumer>@<version>.
--nametextThe last segment of the stub's URL (default: from --pacts, as in main-deployed).
--fallbacktextspecWhen no interaction matches: spec (the spec mock) or not-implemented (501).
--fallback-mocktextWith --fallback spec: the spec mock to answer from, <project>/<version>.
--deleteflagStop serving the stub named by --name (or by --pacts).
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace 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

OptionTypeDefaultRequiredDescription
--providertextyesThe provider's name or handle.
--provider-app-version, -atextyesThe provider build's version (a commit SHA is best).
--targettextyesThe registered verification target to replay against.
--branchtextThe provider build's branch.
--build-urltexthttp(s) URL of the CI build.
--consumer-version-selectortext (repeatable)A selector as JSON, e.g. '{"mainBranch": true}' (repeatable).
--enable-pendingflagA pending pact's failure does not fail the run.
--include-wip-pacts-sincetextAlso verify work-in-progress pacts published since this date.
--allow-mutatingflagReplay POST/PUT/PATCH/DELETE interactions (the target must allow them).
--replay-without-state-setupflagReplay interactions whose provider state nothing sets up.
--provider-states-setup-urltextPOST each provider state to this endpoint (a path on the target or an http(s) URL) instead of the registry.
--skip-already-verifiedflagSkip pacts that already have a result for this provider version.
--publish-verification-results / --no-publish-verification-resultsflag--publish-verification-resultsPublish the results.
--contexttext (repeatable)Non-secret CI context KEY=VALUE stored with the evidence (repeatable).
--output, -otexttabletable, json or markdown.
--broker-base-url, -btextBroker base URL, https://<api>/v1/tenants/<tenant>/pact-broker (overrides PACT_BROKER_BASE_URL).
--broker-token, -ktextWorkspace API key (overrides PACT_BROKER_TOKEN). Prefer the variable: argv is visible to others.