### Install Pact via Scoop in GitHub Actions Source: https://docs.pact.io/implementation_guides/cli Example of installing the unified Pact CLI using Scoop within a GitHub Actions workflow for Windows runners. It also includes a help command to verify the installation. ```powershell - name: Install Pact via Scoop if: runner.os == 'Windows' shell: powershell run: | scoop bucket add pact https://github.com/pact-foundation/scoop scoop install pact scoop search pact pact --help ``` -------------------------------- ### Start Pact Broker with Docker Source: https://docs.pact.io/implementation_guides/cli Starts a Pact Broker instance using Docker. ```bash pact broker docker start ``` -------------------------------- ### Start Pact Mock Server Source: https://docs.pact.io/implementation_guides/cli Starts a Pact mock server on a specified port for consumer testing. ```bash pact mock start --port 1234 ``` -------------------------------- ### Install Plugin from PactFlow Repo Source: https://docs.pact.io/ai_tools/installation Install the swagger-contract-testing plugin from the PactFlow marketplace. ```bash /plugin install swagger-contract-testing@pactflow-agent-skills ``` -------------------------------- ### Pact Rust FFI: Multipart Example Source: https://docs.pact.io/blog/2023/09/21/pact-open-source-update-sept-2023 This example demonstrates how to use the Pact Rust FFI for handling multipart requests. It is part of an effort to reorganize examples and utilize the Rust FFI for various use cases. ```rust Use Rust FFI #13: Multipart ``` -------------------------------- ### Download and Install Pact Mock Server (Chocolatey) Source: https://docs.pact.io/implementation_guides/cli Download the Pact Mock Server .nupkg and install it using Chocolatey. ```bash curl https://github.com/pact-foundation/choco/releases/download/choco/pact-mock-server.2.1.0.nupkg -OutFile pact-mock-server.nupkg choco install -y pact-mock-server --source . ``` -------------------------------- ### Install Plugin using $plugin-creator in Codex Source: https://docs.pact.io/ai_tools/installation Install a plugin from a marketplace or repository using the $plugin command. This is the recommended method for plugin installation in Codex. ```bash $plugin install swagger-contract-testing@pactflow-agent-skills ``` ```bash $plugin install pactflow/pactflow-agent-skills ``` -------------------------------- ### Project-level Install for OpenCode Source: https://docs.pact.io/ai_tools/installation Installs AI skills for a specific project only. Create a .opencode/skills directory and copy the skill folders into it. ```bash mkdir -p .opencode/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .opencode/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .opencode/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .opencode/skills/pactflow ``` -------------------------------- ### Install Skills using Skill Installer in Codex Source: https://docs.pact.io/ai_tools/installation Use the $skill-installer command to install individual skills from a specified path. This is an alternative to plugin installation for specific skills. ```bash $skill-installer pactflow/pactflow-agent-skills/plugins/swagger-contract-testing/skills/drift-testing $skill-installer pactflow/pactflow-agent-skills/plugins/swagger-contract-testing/skills/openapi-parser $skill-installer pactflow/pactflow-agent-skills/plugins/swagger-contract-testing/skills/pactflow ``` -------------------------------- ### Project-level Install for Antigravity Skills Source: https://docs.pact.io/ai_tools/installation Use this command to install skills for a specific project. Commit the `.agents/skills/` directory to share skills with your team. ```bash mkdir -p .agents/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .agents/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .agents/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .agents/skills/pactflow ``` -------------------------------- ### Download and Install Pact Broker Client (Chocolatey) Source: https://docs.pact.io/implementation_guides/cli Download the Pact Broker Client .nupkg and install it using Chocolatey. ```bash curl https://github.com/pact-foundation/choco/releases/download/choco/pact-broker-client.0.5.0.nupkg -OutFile pact-broker-client.nupkg choco install -y pact-broker-client --source . ``` -------------------------------- ### Install Pact Broker Client via GitHub Actions Source: https://docs.pact.io/implementation_guides/cli Use the pact-foundation/pact-broker-cli action to install the Pact Broker Client in GitHub Actions. ```yaml - uses: pact-foundation/pact-broker-cli@main - name: Show help run: pact-broker-cli --help ``` -------------------------------- ### Install Pact Mock Server via Scoop (Windows) Source: https://docs.pact.io/implementation_guides/cli Installs the Pact Mock Server CLI using Scoop. This command requires the Pact Scoop bucket to be added first. ```powershell scoop install pact-mock-server ``` -------------------------------- ### Chocolatey GitHub Actions Example Source: https://docs.pact.io/implementation_guides/cli Install Pact via Chocolatey in a GitHub Actions workflow, handling ARM64 architecture. ```yaml - name: Install Pact via Chocolatey if: runner.os == 'Windows' shell: powershell run: | curl https://github.com/pact-foundation/choco/releases/download/choco/pact.0.9.1.nupkg -OutFile pact.nupkg if ("${{ runner.arch }}" -eq "ARM64") { choco install -y pact --source . --params "'/ForceARM64:true'" } else { choco install -y pact --source . } pact --help ``` -------------------------------- ### React Apollo GraphQL Query Component Source: https://docs.pact.io/blog/2018/07/24/contract-testing-a-graphql-api Example of fetching data from a GraphQL API using React Apollo. Ensure `react-apollo` and `graphql-tag` are installed. ```javascript import { Query } from "react-apollo"; import gql from "graphql-tag"; const ExchangeRates = () => ( {({ loading, error, data }) => { if (loading) return

Loading...

; if (error) return

Error :(

; return data.rates.map(({ currency, rate }) => (

{`${currency}: ${rate}`}

)); }}
); ``` -------------------------------- ### PowerShell Equivalents for Unix Commands Source: https://docs.pact.io/ai_tools/installation Provides PowerShell syntax for common Unix shell commands used in the installation guide, specifically for Windows users. ```powershell New-Item -ItemType Directory -Force -Path path\to\dir ``` ```powershell Copy-Item -Recurse plugins\swagger-contract-testing\skills\drift-testing path\to\dir ``` -------------------------------- ### Install Pact Mock Server via Homebrew Source: https://docs.pact.io/implementation_guides/cli Installs the Pact Mock Server CLI using Homebrew. This command requires the Pact Foundation tap to be added first. ```bash brew install pact-foundation/tap/pact-mock-server ``` -------------------------------- ### Configure Known Marketplaces in settings.json Source: https://docs.pact.io/ai_tools/installation Automatically prompt teammates to install the PactFlow marketplace by adding it to your .claude/settings.json file. This ensures consistent setup across a team. ```json { "extraKnownMarketplaces": { "pactflow-agent-skills": { "source": { "source": "github", "repo": "pactflow/pactflow-agent-skills" } } } } ``` -------------------------------- ### Using Skills in Copilot Chat Source: https://docs.pact.io/ai_tools/installation Examples of invoking installed AI skills in Copilot Chat using slash commands. Type '/skills' to browse and configure available skills. ```bash /drift-testing write a test case for POST /orders returning 201 /openapi-parser generate Drift tests for the payments spec ``` -------------------------------- ### Create Pact Mock Server from File Source: https://docs.pact.io/implementation_guides/cli Creates a Pact mock server using a JSON file that defines the expected interactions. ```bash pact mock create --file examples/foo-bar.json --port 1234 ``` -------------------------------- ### Global Skill Installation in Kiro Source: https://docs.pact.io/ai_tools/installation Manually copy skills to the user's ~/.kiro/skills directory for installation across all projects. Workspace skills take priority over global ones if names conflict. ```bash mkdir -p ~/.kiro/skills cp -r plugins/swagger-contract-testing/skills/drift-testing ~/.kiro/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser ~/.kiro/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow ~/.kiro/skills/pactflow ``` -------------------------------- ### Project-level Install for GitHub Copilot (Multiple Locations) Source: https://docs.pact.io/ai_tools/installation Installs AI skills for a specific project, recommended for teams. Copy skill folders into standard discovery locations like .github/skills, .agents/skills, or .claude/skills. Commit the chosen directory to share. ```bash # .github/skills (most common for GitHub projects) mkdir -p .github/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .github/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .github/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .github/skills/pactflow # or .agents/skills mkdir -p .agents/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .agents/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .agents/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .agents/skills/pactflow # or .claude/skills (already used by Claude Code) mkdir -p .claude/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .claude/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .claude/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .claude/skills/pactflow ``` -------------------------------- ### Install Project-Level Skills in Windsurf Source: https://docs.pact.io/ai_tools/installation Manually copy skill directories into the project's .windsurf/skills directory. Commit this directory to share skills with your team. ```bash mkdir -p .windsurf/skills cp -r plugins/swagger-contract-testing/skills/drift-testing .windsurf/skills/drift-testing cp -r plugins/swagger-contract-testing/skills/openapi-parser .windsurf/skills/openapi-parser cp -r plugins/swagger-contract-testing/skills/pactflow .windsurf/skills/pactflow ``` -------------------------------- ### Install PactFlow Agent Skills Plugin Directly for GitHub Copilot CLI Source: https://docs.pact.io/ai_tools/installation Install the pactflow/pactflow-agent-skills plugin directly from its repository without adding the marketplace first. This is a convenient alternative for direct installation. ```bash copilot plugin install pactflow/pactflow-agent-skills ``` -------------------------------- ### Download and Run Pact Mock Server CLI for Alpine Linux Source: https://docs.pact.io/blog/page/2 This sequence downloads the Pact Mock Server CLI for Linux, gunzips it, makes it executable, and displays its help information. It is built with musl for Alpine compatibility. ```bash curl -LO https://github.com/pact-foundation/pact-reference/releases/download/pact_mock_server_cli-v1.0.5/pact_mock_server_cli-linux-$(uname -m).gz gunzip pact_mock_server_cli-linux-$(uname -m).gz mv pact_mock_server_cli-linux-$(uname -m) pact_mock_server_cli ./pact_mock_server_cli --help ``` -------------------------------- ### Install Swagger Contract Testing Plugin Source: https://docs.pact.io/ai_tools/installation Install the swagger-contract-testing plugin from the Anthropic community marketplace. ```bash claude plugin install swagger-contract-testing@claude-community ``` -------------------------------- ### Install Pact CLI (Chocolatey) Source: https://docs.pact.io/implementation_guides/cli Install the Pact CLI using Chocolatey from a local package. ```bash choco install -y pact --source . ``` -------------------------------- ### Install Pact Broker Client via Scoop (Windows) Source: https://docs.pact.io/implementation_guides/cli Installs the Pact Broker Client CLI using Scoop. This command requires the Pact Scoop bucket to be added first. ```powershell scoop install pact-broker-client ``` -------------------------------- ### Download and Install Pact Legacy (Chocolatey) Source: https://docs.pact.io/implementation_guides/cli Download the Pact Legacy .nupkg and install it using Chocolatey. ```bash curl https://github.com/pact-foundation/choco/releases/download/choco/pact-legacy.2.5.6.nupkg -OutFile pact-legacy.nupkg choco install -y pact-legacy --source . ``` -------------------------------- ### Pact Rust FFI: Binary Example Source: https://docs.pact.io/blog/2023/09/21/pact-open-source-update-sept-2023 This example showcases the usage of Pact Rust FFI for binary data. It is organized within a separate directory for clarity and is part of ongoing efforts to integrate Rust FFI capabilities. ```rust Use Rust FFI #12: Binary ``` -------------------------------- ### Download and Install Pact Plugin (Chocolatey) Source: https://docs.pact.io/implementation_guides/cli Download the Pact Plugin .nupkg and install it using Chocolatey. ```bash curl https://github.com/pact-foundation/choco/releases/download/choco/pact-plugin.0.2.0.nupkg -OutFile pact-plugin.nupkg choco install -y pact-plugin --source . ```