TestMesh
CLI

CLI Reference

The TestMesh CLI executes flows locally without needing the API server running.

The TestMesh CLI is a standalone tool that parses and executes flow YAML files directly against your services. It does not require the TestMesh API server or dashboard to be running.

Installation

brew install test-mesh/brew/testmesh
testmesh --help
curl -fsSL https://testmesh.io/install.sh | sh
testmesh --help
npm install -g @testmesh/cli
testmesh --help
cd cli
go build -o testmesh main.go
./testmesh --help

Commands

CommandDescription
runExecute a flow file and display results
validateCheck YAML syntax without executing
debugExecute step-by-step with interactive inspection
watchAuto-re-run a flow when the file changes
generateAI-powered flow generation from specs or descriptions
chatConversational test creation with AI
mockStart a local mock HTTP server
graphScan repos, view services, check coverage
initInitialize a new TestMesh project
loginAuthenticate with a TestMesh server
reportView execution reports
importImport from Postman collections or OpenAPI specs
exportExport flows to other formats
configManage CLI configuration
scheduleManage scheduled flows
mcpStart the MCP server for AI integration

Global Flags

FlagDefaultDescription
--api-urlhttp://localhost:5016TestMesh API URL — point this at a remote instance
--config.testmesh.yamlConfig file path
--verbose / -vfalseEnable verbose output

Environment Variables

VariableDescription
ANTHROPIC_API_KEYAPI key for AI-powered commands (generate, chat)
OPENAI_API_KEYAlternative API key for OpenAI models
DATABASE_URLDefault PostgreSQL connection string for database_query steps
REDIS_URLDefault Redis connection string for redis_get/redis_set steps

Common Patterns

Run Against a Specific Environment

Override the base URL or any variable inline:

BASE_URL=https://staging.example.com testmesh run ./flow.yaml

Run All Flows in a Directory

for f in ./flows/*.yaml; do testmesh run "$f"; done

CI/CD Integration

The CLI exits with a non-zero code on failure, making it straightforward to use in pipelines:

testmesh run ./flows/smoke-tests.yaml || exit 1

Or with explicit exit code checking:

testmesh run ./flows/e2e.yaml
echo "Exit code: $?"

Exit Codes

CodeMeaning
0All assertions passed
1One or more assertions failed
2Invalid flow YAML or configuration error

What's Next

On this page