CLI Command Reference

The drift command provides access to the verifier, component manager, authentication, and version-checking commands.

Core Commands

drift init

An interactive terminal UI (TUI) that guides you through first-time setup and produces a single running contract test. Run drift init in your project root to get started.

drift init

drift init does not accept command-line options. All configuration is handled interactively within the TUI. When the session ends, it writes a test case YAML file and one or more AI prompt files to your project directory. For a full walkthrough of each step, see the Interactive Onboarding tutorial.

drift verify

The primary command for verifying a provider against your test cases.

Usage:

drift verify --server-url <URL> --test-files <FILES> [OPTIONS]

Key Options

Option

Shortcut

Description

--server-url

-u

Required. The base URL of the server to test.

--test-files

-f

Required. Paths to one or more yaml files.

--operation

Validate a single operation (or comma-separated list) by ID.

--failed

Only re-run operations that failed in the previous execution.

--tags

-t

Filter operations by tags. Use ! to exclude (e.g., !slow).

--output-dir

-o

Where to write results. Defaults to the test file directory.

--generate-result

Generate a result bundle file after the run.

--generate-fix-prompt

Generate an AI prompt file when tests fail to help with debugging.

drift plugins (deprecated)

Use drift component instead. drift plugins still works but prints a deprecation notice and will be removed in a future release

drift auth

Manages authentication with PactFlow.

Subcommand

Description

drift auth login

Authenticate interactively. Prompts for your workspace URL and API token, then caches a session token valid for 7 days.

drift auth logout

Clear the cached session for the current workspace.

drift auth status

Show the currently authenticated user and session expiry.

See Authentication for full details.

drift check-version

Checks the internet for a newer version of the Drift binary.

drift component

Lists, installs, updates, and removes the components in your Drift installation.

Subcommand

Description

drift component list

List installed components. Add --all to include components available to install.

drift component info <name>

Show details for one component. Add --paths to show installation directories.

drift component install <name>...

Install one or more optional components from the current release.

drift component install --url <url> --sha256 <checksum>

Install a component from a URL. Use --file <path> for a local file.

drift component update

Update the installation to the latest release.

drift component remove <name>

Remove a component. Core components require --force.

Option

Applies to

Description

--all, -a

list

Include components that are not installed.

--status <status>

list

Filter by stable, beta, deprecated, or unknown.

--type <type>

list

Filter by binary or plugin.

--json

list

Print output as JSON.

--offline

list, info

Do not contact the release server.

--version <version>

install, update

Use a specific release instead of the latest.

--dry-run

update

Show what would change without making changes.

--sha256 <checksum>

install

Expected checksum for --url or --file.

--yes, -y

install, update, remove

Answer yes to all prompts.

--force, -f

install, update, remove

Skip safety checks, such as removing a core component or installing without a checksum.

--plugin-dir <dir>

All

Plugin directory. Overrides plugin_dir in the configuration file. Also set by DRIFT_PLUGIN_DIR.

--drift-home-dir <dir>

All

Drift installation directory. Also set by DRIFT_HOME_DIR.

Publication date: