Installer Internals

How the PraisonAI install.sh works — uv/pipx detection, uv bootstrap, and PATH management

The PraisonAI installer picks a tool manager (uv tool → pipx → bootstrap uv) so you get a working praisonai CLI in an isolated environment without touching your global Python. Windows has its own install.ps1 that installs praisonai[all] into a per-user venv.

Diagram
flowchart TD
    S{Which OS?}:::agent
    S -->|macOS / Linux / WSL| A[curl install.sh | sh]:::tool
    S -->|Windows| W[iwr install.ps1 | iex]:::tool

    A --> B[Detect platform via uname]:::agent
    B --> C{Have uv?}:::agent
    C -->|Yes| U[uv tool install --force praisonai]:::tool
    C -->|No| D{Have pipx?}:::agent
    D -->|Yes| P[pipx install --force praisonai]:::tool
    D -->|No| E[Bootstrap uv from astral.sh]:::process
    E --> U
    U --> H[Wire ~/.local/bin onto PATH]:::process
    P --> H
    H --> K[Print Get started panel]:::success

    W --> WV[Create ~/.praisonai/venv]:::process
    WV --> WI[pip install praisonai[all]]:::tool
    WI --> WP[Prepend venv Scripts to PATH]:::process
    WP --> WO[Run praisonai setup wizard]:::process
    WO --> K

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef process fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef success fill:#10B981,stroke:#7C90A0,color:#fff

install.sh (macOS / Linux / WSL)

Run it with:

bash
curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh

How It Works

  1. Detect platform

    Reads uname -s / uname -m to report the OS and architecture.

  2. Require curl

    Errors out immediately if curl is not available.

  3. Check PRAISONAI_INSTALLER override

    If set to uv or pipx, forces that manager. pipx errors if not installed; uv bootstraps itself when missing. Any other value errors.

  4. Pick a tool manager

    In auto mode: use uv tool if uv is present → else pipx if present → else bootstrap uv.

  5. Bootstrap uv (only if neither exists)

    Downloads https://astral.sh/uv/install.sh to a temp file first, so a failed or empty download fails loudly instead of a later uv: command not found. Runs it, then verifies uv is on PATH.

  6. Install praisonai
    • uv: uv tool install --force praisonai
    • pipx: pipx install --force praisonai + pipx ensurepath

    Add PRAISONAI_VERSION=x.y.z to install praisonai==x.y.z.

  7. Wire ~/.local/bin onto PATH

    Appends an idempotent block (grepped for the bin dir before writing) to the correct rc file(s): – zsh → ~/.zshrc – fish → ~/.config/fish/config.fish (fish_add_path when available, POSIX-safe fallback otherwise) – bash → both ~/.bashrc and the applicable login profile (~/.bash_profile → ~/.bash_login → ~/.profile, first that exists) – anything else → ~/.profile

  8. Print Get started panel

    Points at praisonai setup, praisonai upgrade, praisonai upgrade --check, and praisonai uninstall.


User Interaction Flow

Diagram
Shell rcManager (uv/pipx)InstallerUserShell rcManager (uv/pipx)InstallerUsercurl install.sh | shdetect platform, require curluv tool / pipx install praisonaibinary at ~/.local/bin/praisonaiappend PATH block (idempotent)“Get started: praisonai setup / upgrade / uninstall”

Environment Variables (the only knobs)

The installer has no CLI flags. Its only inputs are three environment variables.

VariableValuesBehaviour
PRAISONAI_VERSIONx.y.zPin a specific version. Appended as praisonai==VERSION (default: latest from PyPI).
PRAISONAI_INSTALLERuv \pipxForce a tool manager. pipx errors if not installed; uv bootstraps itself if missing. Any other value errors.
PRAISONAI_NONINTERACTIVEany truthyNon-interactive/CI mode (only changes an info message during uv bootstrap; the script never prompts).
bash
# Pin a version
PRAISONAI_VERSION=0.14.0 curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh

# Force pipx
PRAISONAI_INSTALLER=pipx curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh

Power-User Alternatives (No Installer Needed)

These are first-class supported paths — no installer required:

bash
# Zero-install one-shot via uv
uvx praisonai "2+2"

# Isolated persistent install
pipx install praisonai

# Install into the active Python environment
pip install praisonai

Manage Your Install

After installation, the installer’s “Get started” panel points at these self-management commands:

bash
praisonai upgrade          # update in place
praisonai upgrade --check  # is a newer version available?
praisonai uninstall        # remove cleanly

See praisonai upgrade and praisonai uninstall.


Choosing a Manager

Diagram

Yes

No

Yes

No

Which manager?

Have uv?

uv tool — fastest,\nzero extra install

Have pipx?

pipx — well-known,\nbroad ecosystem

bootstrap uv —\nauto-installed


CI/CD Usage

GitHub Actions

yaml
- name: Install PraisonAI
  run: curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh
  env:
    PRAISONAI_NONINTERACTIVE: "1"

GitLab CI

yaml
install:
  script:
    - curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh
  variables:
    PRAISONAI_NONINTERACTIVE: "1"

Docker

dockerfile
FROM python:3.12-slim
RUN apt-get update && apt-get install -y curl \
  && curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh

Uninstall

Use the built-in self-management command, which removes the managed install via the detected manager:

bash
praisonai uninstall        # confirms first
praisonai uninstall --yes  # CI-safe, no prompt

See the praisonai uninstall page for details and JSON output.


Troubleshooting

praisonai not found after install

Restart your terminal or source your shell rc:

bash
source ~/.zshrc   # zsh
source ~/.bashrc  # bash

Or add ~/.local/bin to PATH manually:

bash
export PATH="$HOME/.local/bin:$PATH"
Force a specific manager
bash
PRAISONAI_INSTALLER=pipx curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh
I have both uv and pipx — which runs?

The installer picks uv first. Override with PRAISONAI_INSTALLER=pipx.

uv bootstrap failed (network/DNS)

The installer downloads astral.sh/uv/install.sh to a temp file and fails loudly if the download is empty or the network is unreachable. Install uv or pipx manually, then re-run:

bash
# https://docs.astral.sh/uv/getting-started/installation/
curl -fsSL https://raw.githubusercontent.com/MervinPraison/PraisonAI/main/install.sh | sh

install.ps1 (Windows)

Run it with:

powershell
iwr -useb https://praison.ai/install.ps1 | iex

To pass parameters, use the script-block form so the params are honoured:

powershell
& ([scriptblock]::Create((iwr -useb https://praison.ai/install.ps1))) -Extras "ui,chat"

How It Works

  1. Detect Python

    Requires Python >= 3.10. If missing, tries winget install Python.Python.3.12 → choco install python → scoop install python.

  2. Ensure pip

    Bootstraps pip via ensurepip, falling back to get-pip.py.

  3. Create venv

    Creates a venv at %USERPROFILE%\.praisonai\venv (unless -NoVenv).

  4. Install praisonai[all]

    Installs praisonai[all] into the venv — this is the PR #3029 fix. Previously it installed praisonaiagents, leaving the praisonai wrapper absent.

  5. Wire PATH

    Prepends <venv>\Scripts to the user Path environment variable.

  6. Verify

    Confirms the install can import praisonaiagents and (if on PATH) praisonai --version.

  7. Run onboarding

    Runs python -m praisonai setup. Skipped if -NoOnboard, -DryRun, PRAISONAI_NO_PROMPT is set, or the session is non-interactive / stdin-redirected.

  8. Print Next steps

    Prints the venv activate command, a quick-start Python one-liner, the docs link, and an OPENAI_API_KEY reminder.

Parameters

ParameterEnv varDefaultBehaviour
-Version <x.y.z>PRAISONAI_VERSIONlatestPins a specific version. Appended as praisonai[all]==<x.y.z>.
-Extras <csv>PRAISONAI_EXTRAS(none — install is praisonai[all])Comma-separated extras. Overrides the default [all] to [<csv>]. If the extras include ui, chat, or code, the wrapper is also installed with those extras.
-NoVenvPRAISONAI_SKIP_VENV=1offSkip creating %USERPROFILE%\.praisonai\venv. Installs into the detected Python instead.
-NoOnboardPRAISONAI_NO_ONBOARD=1offSkip the interactive python -m praisonai setup wizard.
-Python <path>PRAISONAI_PYTHONauto-detectUse a specific Python executable. Otherwise the script probes python, python3, py -3.12, py -3.11, py -3.10, py.
-DryRunPRAISONAI_DRY_RUN=1offPrint every command that would run without making changes.
-Help——Print the built-in help panel and exit.

Choosing Extras

Diagram

Yes

No

Yes

No

Which extras?

Want the full stack?

default &[all&] — everything included

Need a lean install?

-Extras core — minimal footprint

-Extras ui,chat,code — pick what you use


Related