Skip to the content.

CLI Reference

Adaptive Tests ships a single CLI: adaptive-tests. Use via npx or as a dev dependency.

Installation

# Use directly (recommended)
npx adaptive-tests --help

# Or install locally
npm install --save-dev adaptive-tests

Commands

init

Initialize Adaptive Tests in your project (creates a config file and guided setup).

npx adaptive-tests init

What it does:


why

Explain how discovery scores candidates for a given signature. This is your primary debugging tool.

# Minimal
npx adaptive-tests why '{"name":"UserService"}'

# With type hint
npx adaptive-tests why '{"name":"UserService","type":"class"}'

# Read signature from a file
npx adaptive-tests why --signature signature.json --json

Options:


discover

Run discovery for a signature. (Useful for CI or quick checks.)

npx adaptive-tests discover --signature signature.json --json

Options:


analyze

Show exports and structural info for a specific file.

npx adaptive-tests analyze src/services/UserService.js

signature

Generate a basic signature from an existing file.

npx adaptive-tests signature src/services/UserService.js

config –validate

Validate your adaptive-tests.config.js (or discovered config).

npx adaptive-tests config --validate

cache [–clear|–persist]

Manage discovery caches.

# Clear local cache
npx adaptive-tests cache --clear

# Persist cache across runs (if supported)
npx adaptive-tests cache --persist

check –circular

Check for circular dependencies via discovery helpers.

npx adaptive-tests check --circular

scaffold (preview)

Scaffold adaptive tests for the current project. (For JavaScript/TypeScript only.)

# Scaffold using defaults into tests/adaptive
npx adaptive-tests scaffold --root .

Options vary by project; prefer running npx adaptive-tests init first to establish defaults.

Configuration

Most JavaScript/TypeScript projects place options in adaptive-tests.config.js. See the Configuration Guide for details.

Tips