Anthivo home

ConfigurationEnvironment Variables

Environment Variables

Give AMI the URLs and credentials it needs to test your running app.

AMI tests your running app, so it needs the same configuration your app uses: base URLs, test accounts and connection strings. Keep them in an env file that your config loads.

Loading an env file

Point env in your config at the file. AMI loads it before planning, and agents receive only the variables they need.

.env.test
API_URL=http://localhost:3000DATABASE_URL=postgres://localhost:5432/checkout_testTEST_USER_EMAIL=qa@example.com

Per-environment values

Use one file per environment, such as .env.test and .env.staging, and switch with the --env flag of anthivo run.

Secrets in CI

In CI, set variables as secrets instead of committing env files. Variables already in the environment take precedence over the file.

Point AMI at test data only. Agents create, change and delete records while they test.