Skip to main content
PraisonAI leads you to a verified, working agent in as few keystrokes as possible — auto-detecting any provider key you already have, validating the one you enter, and smoke-testing before it hands back the prompt. praisonai --init is now safe to run before setup — if no provider is configured it prints provider guidance and exits cleanly rather than throwing a stack trace. Either order works for onboarding.
The user launches PraisonAI without API keys; the CLI offers the setup wizard instead of failing on the first model call.

Onboarding Flow

Quick Start

1

Run praisonai without any setup

If no credentials are configured, you’ll see:
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:
On first run, the picker shows every catalogue-known provider (Groq, OpenRouter, Mistral, DeepSeek, xAI, …) — not just the historical curated five — and prints a Get your key: link before the masked prompt.
When one of OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, or GOOGLE_API_KEY is already exported, the wizard skips the menu and pre-selects that provider — you only confirm.
Credentials are stored in ~/.praisonai/credentials.json (permissions 0600). Legacy ~/.praison/credentials.json is still read as a fallback and migrated automatically on the next write — no re-login required.
3

Re-run — no prompts after the first time


Wizard flow (post-#2680)

The wizard moves through three stages: auto-detect, validate, and smoke-test.
1

Auto-detect a key you already have

If a *_API_KEY is already exported, the first prompt is a confirmation — not a numeric menu:
Answer n to fall through to the full provider menu. The provider menu only appears when no key is detected, and is catalogue-driven — it lists every provider ModelCatalogue knows about (Groq, OpenRouter, Mistral, DeepSeek, xAI, …), curated ones first and custom last.
2

Validate the key before it persists

Entered keys run through the same validate_api_key() check as praisonai auth login. A bad key re-prompts instead of silently writing a broken credential:
After up to three attempts the wizard proceeds with the last entry so you’re never stuck in a loop.
3

Smoke-test before handing back the prompt

After the config is written, the wizard runs one live call and prints the reply:
A failed smoke test is a warning, not an error — your config is already saved, so you can run praisonai doctor to diagnose the key or model.
Pass --no-verify to skip the smoke test when running offline or in CI:
The wizard still writes the config; it just doesn’t dial the LLM.

How It Works

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

Credential detection order


Behaviour by Mode


CI / Scripting

In non-interactive environments, PraisonAI exits with code 1 and writes to stderr:
Non-interactive detection: not sys.stdin.isatty() or --output json mode.

GitHub Actions example

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:

Default model on first run

If you run a command like praisonai chat without --model on first use, PraisonAI picks a default that matches the provider credential it finds in your environment — Anthropic key → Claude, Gemini key → Gemini Flash, etc. See Default Model Resolution for the full ladder.

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:
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.
The smoke test is convenient locally but wastes a token round-trip in CI. Skip it with --no-verify on both setup and setup wizard.

Setup Wizard

Interactive wizard for configuring LLM provider credentials

Run Command

Run agents from files or prompts