Skip to main content

testivai auth

Store your API key for use by the TestivAI CLI.

Usage

npx testivai auth <api-key>

Get your API key from the TestivAI Dashboard.

Example

npx testivai auth tvai_abc123xyz

The key is stored locally and used for all subsequent testivai run commands.

All TestivAI SDKs read the API key from the TESTIVAI_API_KEY shell environment variable. This is the primary and recommended way to configure authentication:

# Set for current session
export TESTIVAI_API_KEY=tvai_abc123xyz

# Set permanently (add to your shell profile)
echo 'export TESTIVAI_API_KEY=tvai_abc123xyz' >> ~/.zshrc # macOS
echo 'export TESTIVAI_API_KEY=tvai_abc123xyz' >> ~/.bashrc # Linux

Supported Environment Variables

VariableRequiredDefaultDescription
TESTIVAI_API_KEYYesYour project API key
TESTIVAI_API_URLNohttps://core-api.testiv.aiCustom API endpoint
TESTIVAI_DEBUGNofalseEnable verbose debug logging
Shell environment variables only

TestivAI SDKs read only from shell environment variables (process.env). The SDKs do not use dotenv or load .env files. Always use export in your terminal or set variables in your CI provider's secrets.