Test Generation featuring HaloAI
Prerequisites
An API Hub for Contract Testing account with an active subscription
AI feature enabled on your account by your API Hub for Contract Testing administrator (more here)
Installation
For *nix users (including Windows users running WSL), use the following command to download and install:
curl https://download.pactflow.io/ai/get.sh | sh
Verify the installation by running pactflow-ai
to ensure it executes successfully.
Manual installation
Alternatively, download the latest version for your operating system and architecture from the table below. Remember to add it to your environment's PATH
:
Note
Linux GNU users will require glibc version 2.23 or later.
Environments which do not use glibc, or use a version of glibc prior to 2.23, should instead use the musl variant.
Usage
Running pactflow-ai --help
will give you the detailed usage for any of the subcommands.
Authentication
Authentication requires valid API Hub for Contract Testing API Tokens, which can be obtained from the Settings > Tokens
page of your API Hub for Contract Testing account.
There are several ways to authenticate with the CLI:
Environment Variables
Export the following environment variables, and the CLI will use these credentials to communicate with API Hub for Contract Testing:
export PACT_BROKER_BASE_URL="https://YOUR_ACCOUNT.pactflow.io" export PACT_BROKER_TOKEN="YOUR_TOKEN"
Local configuration file
You can also configure the CLI using the following commands:
pactflow-ai config set url https://YOUR_ACCOUNT.pactflow.io pactflow-ai config set token YOUR_TOKEN
This will create a .pactflow.toml file, which should be added to your .gitignore
.
User configuration file
Alternatively, the user configuration file can be stored in a configuration directory for API Hub for Contract Testing. The paths are ~/.config/pactflow/config.toml
on Unix, and %APPDATA%\pactflow\config.toml
on Windows.
Getting help and providing feedback
For feedback, feature requests, or assistance with the tool, please contact the email address provided when you were granted access. For support unrelated to the AI feature, please follow the usual methods.
Tutorials
We've created an in-browser tutorial to help you get started with PactFlow's test generation feature.