.env from your current working directory before running any CLI command.
Quick Start
1
Simple Usage
Create a Run an agent file from that directory:
.env next to where you run PraisonAI:2
With Configuration
praisonai.api.call does not read .env on import. Opt in with an environment variable:praisonai call CLI always loads .env from the current directory, no flag needed.How It Works
The CLI searches upward from where you run it, never from where PraisonAI is installed.Which Entry Points Auto-Load .env
Each CLI entry point loads .env from the current directory; library imports never do.
Do I Need to Load .env Manually?
For library use:
Precedence
Loading never overrides a variable that is already set (override=False).
Best Practices
Put .env in your project root
Put .env in your project root
Keep it in the directory you run
praisonai from, so the CLI always finds it.Never commit .env
Never commit .env
Add
.env to .gitignore so keys stay out of version control.Prefer shell exports for secrets in CI
Prefer shell exports for secrets in CI
.env is a developer convenience, not a secrets manager. Export variables from your CI secret store instead.Library imports do not touch os.environ
Library imports do not touch os.environ
When embedding
praisonaiagents or importing praisonai.api.call directly, call from dotenv import load_dotenv; load_dotenv() yourself. See Python Import Safety.Related
Security Environment Variables
Environment-variable gates and security advisories
PraisonAI Call
Voice call server and its environment variables

