Skip to main content
PraisonAI auto-loads a .env from your current working directory before running any CLI command.

Quick Start

1

Simple Usage

Create a .env next to where you run PraisonAI:
Run an agent file from that directory:
2

With Configuration

praisonai.api.call does not read .env on import. Opt in with an environment variable:
The 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).
Before this release, PraisonAI’s CLIs could load a .env from a source checkout or any parent of site-packages. If an API key stops being set after upgrading, move the .env into the directory you run praisonai from, or export the variable in your shell.

Best Practices

Keep it in the directory you run praisonai from, so the CLI always finds it.
Add .env to .gitignore so keys stay out of version control.
.env is a developer convenience, not a secrets manager. Export variables from your CI secret store instead.
When embedding praisonaiagents or importing praisonai.api.call directly, call from dotenv import load_dotenv; load_dotenv() yourself. See Python Import Safety.

Security Environment Variables

Environment-variable gates and security advisories

PraisonAI Call

Voice call server and its environment variables