Skip to main content
When you run PraisonAI for the first time without API keys, it detects the unconfigured environment and offers to launch the setup wizard instead of failing on the first LLM call.

Quick Start

1

Run praisonai without any setup

praisonai
If no credentials are configured, you’ll see:
No API key configured.
Would you like to run the setup wizard now? [Y/n]:
Type Y (or press Enter) to launch the setup wizard.
2

Complete setup once

The setup wizard asks for your provider and API key, then stores the credential securely:
praisonai setup
# Choose: 1) OpenAI  2) Anthropic  3) Google  4) Ollama  5) Custom
# Enter your API key when prompted
Credentials are stored in ~/.praison/credentials.json (permissions 0600).
3

Re-run β€” no prompts after the first time

praisonai "What is 2+2?"
# Runs immediately β€” no credential prompt

How It Works

Both praisonai (bare) and praisonai run perform a credential check before doing any work.

Credential detection order

StepWhat is checkedExample
1. Env vars (fast path)OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, COHERE_API_KEYexport OPENAI_API_KEY=sk-...
2. Credential store~/.praison/credentials.json written by praisonai setuppraisonai setup
3. LLM resolutionresolve_llm_endpoint_with_credentials() β€” final fallbackStored OpenAI base URL

Behaviour by Mode

ScenarioOld behaviourNew behaviour
Configured user (env var or stored credential)Works normallyWorks β€” no extra prompts, no added latency
New TTY user, no credentials, praisonaiLaunched TUI, failed on first LLM callPrints prompt, offers setup wizard
New TTY user, no credentials, praisonai run "hi"Ran agent, failed on first LLM callSame prompt as above; on success continues the run
CI / piped stdin / --output jsonCryptic LLM failureWrites error to stderr, exits 1

CI / Scripting

In non-interactive environments, PraisonAI exits with code 1 and writes to stderr:
No API key configured. Run: praisonai auth login
Non-interactive detection: not sys.stdin.isatty() or --output json mode.

GitHub Actions example

- name: Run PraisonAI agent
  run: praisonai run "Summarize the changelog"
  env:
    OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Setting any of the 6 detected env vars silences the check completely β€” no code changes needed.

Skipping the Prompt

Three ways to avoid the setup prompt:
MethodCommand / Action
Set an env varexport OPENAI_API_KEY=sk-...
Run setup ahead of timepraisonai setup
Answer β€œNo” at the promptType n β†’ exits 0 with a hint to run praisonai auth login

Best Practices

Set OPENAI_API_KEY (or the provider key for your model) as a repository secret, then reference it in your workflow env block. This is the recommended approach β€” no credential files in your repo, no interactive prompts:
env:
  OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
On shared developer machines, stored credentials (praisonai setup) are scoped to the user’s home directory and avoid environment variable leakage between sessions. Run praisonai setup config --show to verify what is stored.
Run praisonai run "ping" manually before wiring the command into a pipeline or CI job. A successful response confirms credentials are configured and the model is reachable.

Setup Wizard

Interactive wizard for configuring LLM provider credentials

Run Command

Run agents from files or prompts

CLI Reference

Complete command tree and flag reference

Installer Internals

How the installer scripts work including post-install flow