Skip to main content

CLI Command Reference

The drift command provides access to the verifier, plugin manager, and version control.

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:

OptionShortcutDescription
--server-url-uRequired. The base URL of the server to test.
--test-files-fRequired. Paths to one or more yaml files.
--operationValidate a single operation (or comma-separated list) by ID.
--failedOnly re-run operations that failed in the previous execution.
--tags-tFilter operations by tags. Use ! to exclude (e.g., !slow).
--output-dir-oWhere to write results. Defaults to the test file directory.
--generate-resultGenerate a result bundle file after the run.
--generate-fix-promptGenerate an AI prompt file when tests fail to help with debugging.

Drift plugins

Manage and inspect Drift plugins.

  • drift plugins installed-plugins: List all plugins currently available in your environment.
  • drift plugins default-plugins: List the plugins bundled out-of-the-box.
  • drift plugins info: Display detailed metadata for a specific plugin file.

drift auth

Manages authentication with PactFlow.

SubcommandDescription
drift auth loginAuthenticate interactively. Prompts for your workspace URL and API token, then caches a session token valid for 7 days.
drift auth logoutClear the cached session for the current workspace.
drift auth statusShow 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.