> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PraisonAI Code CLI

> Standalone agentic terminal CLI: run agents, chat, and code without the full wrapper

> `praisonai-code` is the terminal-native agent CLI — install it on its own for a smaller footprint when you only need agentic commands.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Standalone install — no wrapper needed
from praisonaiagents import Agent

Agent(instructions="Summarise this URL").start("https://arxiv.org/abs/2409.12345")
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Same result from the CLI, standalone (PR #2853)
pip install praisonai-code
praisonai-code run "Summarise https://arxiv.org/abs/2409.12345"
```

The user runs a terminal prompt; `praisonai-code` executes the agent in-process and prints the reply.

Interactive `chat` and `code` also run from `praisonai-code` alone — no wrapper (PR #3818):

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai-code
praisonai chat        # opens the split-pane async TUI, no wrapper required
praisonai code        # opens the resident code TUI, no wrapper required
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph pip_code["pip install praisonai-code"]
        A[praisonai-code CLI] --> A1[default run · run --output plain/verbose/silent/actions/json/stream/stream-json · config · doctor · daemon · version · …]
        A --> A2[chat · code · resident TUI]
    end
    subgraph pip_wrapper["pip install praisonai"]
        B[praisonai CLI] --> B1[gateway · bot · onboard · pairing · identity · kanban · claw · dashboard]
        B --> A
    end
    A --> C[praisonaiagents core]

    classDef code fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef wrapper fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef core fill:#10B981,stroke:#7C90A0,color:#fff
    class A,A1,A2 code
    class B,B1 wrapper
    class C core
```

<Note>
  As of [PR #3818](https://github.com/MervinPraison/PraisonAI/pull/3818), `chat` and `code` interactive sessions now run **resident inside `praisonai-code`** — no wrapper required. `pip install praisonai-code` alone delivers a full interactive `chat`/`code` session on the split-pane TUI. Default `run "…"` and every `--output` text mode already ran in-process (PR #2853). When the `praisonai` wrapper **is** installed, it is still detected and the richer legacy interactive dispatch is used; the resident TUI is the fallback when the wrapper is absent.
</Note>

## Which install do I need?

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Start{What do you run?} -->|Any text prompt: default run or --output plain/verbose/silent/actions/json/stream/stream-json| Structured[run "…"]
    Start -->|Interactive terminal chat or coding: resident TUI| Interactive[chat · code]
    Start -->|Bots · gateway · dashboard| Wrapper3[gateway · bot · …]
    Start -->|Warm runtime daemon| Daemon[daemon start]

    Structured --> Code[pip install praisonai-code]
    Interactive --> Code
    Daemon --> Code
    Wrapper3 --> Full[pip install praisonai]

    classDef question fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef code fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef wrapper fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef install fill:#10B981,stroke:#7C90A0,color:#fff
    class Start question
    class Structured,Interactive,Daemon code
    class Wrapper3 wrapper
    class Code,Full install
```

Both `praisonai-code` (console script) and `python -m praisonai_code` call the same entry point: configure logging, register commands, then run the Typer app.

## Interactive Chat & Code (resident TUI)

A single `pip install praisonai-code` is enough for an interactive session — the split-pane async TUI ships inside the package (PR #3818).

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai-code
praisonai chat        # opens the split-pane async TUI, no wrapper required
praisonai code        # opens the resident code TUI, no wrapper required
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Interactive session"
        I[💻 praisonai chat / code] --> C{🔍 wrapper installed?}
        C -->|No| R[🖥️ Resident TUI<br/>praisonai_code.cli.interactive]
        C -->|Yes| L[🎛️ Richer legacy dispatch<br/>PraisonAI._start_interactive_mode]
    end

    classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef decision fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef result fill:#10B981,stroke:#7C90A0,color:#fff

    class I input
    class C decision
    class R,L result
```

| Dimension                                | Resident TUI (`praisonai-code` alone)                          | Richer legacy dispatch (`+ praisonai`)                    |
| ---------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------- |
| Install                                  | `pip install praisonai-code`                                   | `pip install praisonai`                                   |
| Entry point                              | `praisonai_code.cli.interactive`                               | `PraisonAI._start_interactive_mode`                       |
| `code` command                           | Resident split-pane TUI                                        | Preferred richer legacy dispatch                          |
| Instruction loading (`context_files`)    | Native — `praisonai_code.integration.context_files` (PR #4338) | Prefers `praisonai_bot` / `praisonai` copy when installed |
| Async bridge (`praisonai._async_bridge`) | Bridge fallback via `_wrapper_bridge`                          | Direct wrapper implementation                             |

The wrapper is never required for the baseline TUI — it only upgrades `code` to the richer legacy dispatch. Instruction loading is now resident: `praisonai_code.integration.context_files` ships inside the package, so the subtree hook and `--instructions` globs/URLs work standalone without routing through `_wrapper_bridge`. When the wrapper (or `praisonai_bot`) is installed, the CLI prefers that copy.

### Native rules + project instructions

`rules list/add/clear` and subtree instruction loading run natively on a standalone `pip install praisonai-code` (PR #4338) — no `praisonai_bot` or `praisonai` needed.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai-code
praisonai rules add my_rule "Always use type hints"   # workspace-scoped rule
praisonai rules list                                   # native, backed by RulesManager
praisonai rules clear                                  # clears workspace rules only
```

* `rules list/add/clear` run natively via `praisonaiagents.memory.RulesManager`.
* Subtree `AGENTS.md`/`CLAUDE.md` auto-attach and `--instructions` globs/URLs both work standalone via `praisonai_code.integration.context_files`.
* `clear` is scoped to **workspace rules only** — hand-authored `AGENTS.md`/`CLAUDE.md`/`PRAISON.md`, global rules, git-root rules, and nested subdir rules are never removed.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    subgraph "Standalone praisonai-code project-instruction stack"
        USER[👤 User] --> CLI[💻 praisonai-code run / chat / code]
        CLI --> INSTR[🔍 --instructions globs/URLs<br/>+ AGENTS.md walk-up]
        CLI --> RULES[📜 rules list/add/clear]
        INSTR --> RESIDENT[📦 praisonai_code.integration.context_files<br/>resident, stdlib + praisonaiagents.hooks]
        RULES --> RM[🧠 praisonaiagents.memory.RulesManager<br/>PRAISON.md / CLAUDE.md / AGENTS.md / .praison/rules/]
        RESIDENT --> AGENT[🤖 Agent]
        RM --> AGENT
    end

    classDef user fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef cli fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef process fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef native fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef agent fill:#10B981,stroke:#7C90A0,color:#fff

    class USER user
    class CLI cli
    class INSTR,RULES process
    class RESIDENT,RM native
    class AGENT agent
```

Deep dives: [Rules](/docs/features/rules), [Instruction Sources](/docs/features/instruction-sources), and [Context Files](/docs/features/context-files).

## Quick Start

<Steps>
  <Step title="Install standalone">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonai-code
    praisonai-code version
    ```

    The panel lists **PraisonAI Code**, **PraisonAI Agents**, and **Python**. When the full wrapper is installed, a **PraisonAI Wrapper** line appears as well.

    Use `--version` for a quick one-liner (package version only, no panel):

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-code --version
    ```

    Run your first agent:

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-code run "Summarise the top 3 arXiv papers on RAG this week"
    ```

    Every text mode — default `run "…"` and `--output plain|verbose|silent|actions|json|stream|stream-json` — runs standalone via the in-process `Agent` path. As of PR #3818, `chat` and `code` also open their resident interactive TUI standalone — the wrapper adds only the richer legacy dispatch for `code` and the gateway/bot channels.
  </Step>

  <Step title="Upgrade later if you need bots or gateway">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonai
    ```

    The same `praisonai-code` binary keeps working. Wrapper-only commands (`gateway`, `bot`, `onboard`, `pairing`, `identity`, `kanban`, `claw`, `dashboard`) become available through the composed install.
  </Step>
</Steps>

## How It Works

Text-mode `run` always executes in-process via the `Agent` path on a standalone install. When the wrapper **is** present, human-readable modes delegate to its `handle_direct_prompt`; when it is absent, they route through the in-process `Agent` with the matching output preset. `chat` and `code` open their resident TUI standalone (PR #3818); when the wrapper is installed, `code` prefers the richer legacy dispatch (`PraisonAI._start_interactive_mode`). Plugin discovery is vendored inside `praisonai-code`, so plugin-related flows keep working without the wrapper.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant CLI as praisonai-code
    participant Bridge as _wrapper_bridge
    participant Agent as praisonaiagents.Agent
    participant Wrapper as praisonai (optional)

    User->>CLI: praisonai-code run "…"
    CLI->>Bridge: wrapper_available()
    alt wrapper installed
        Bridge-->>CLI: True
        CLI->>Wrapper: handle_direct_prompt
        Wrapper-->>CLI: result
        CLI-->>User: normal output
    else wrapper missing — default / plain / verbose / silent / actions / json / stream / stream-json
        Bridge-->>CLI: False
        CLI->>Agent: in-process run (output preset)
        Agent-->>CLI: result
        CLI-->>User: final text (silent-style presets print the answer)
    end
    Note over User,CLI: chat / code run resident standalone — wrapper only adds richer legacy dispatch
```

Output presets map as `plain` → `plain`, `silent`/default → `silent`, `verbose` → `verbose`; silent-style presets print the final text. `chat` and `code` open their resident interactive TUI standalone (PR #3818) — `pip install praisonai-code` alone delivers full interactive sessions. When the `praisonai` wrapper is installed, `code` prefers its richer legacy dispatch (`PraisonAI._start_interactive_mode`):

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai-code
praisonai-code chat
praisonai-code code "Refactor this function"
```

The vendored `_registry` module means plugins work even without the wrapper installed. Version resolution reads from the `praisonai-code` package metadata directly, not the wrapper.

## Command matrix

Three tiers decide what a command needs: fully standalone, wrapper-boosted (works standalone but gains a richer path with the wrapper), and wrapper-only (not listed without the wrapper).

| Standalone (`pip install praisonai-code`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Wrapper-boosted (works standalone, richer with `praisonai`)          | Wrapper-only (`pip install praisonai`)                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| acp · agent · agents · attach · auth · batch · benchmark · browser · call · `chat` · checkpoint · `code` · command · commit · completion · config · context · debug · deploy · diag · docs · doctor · endpoints · env · eval · examples · flow · github · hooks · init · knowledge · langextract · langfuse · loop · lsp · managed · mcp · memory · models · n8n · obs · package · paths · permissions · plugins · port · profile · publish · rag · realtime · recipe · registry · replay · research · `run "…"` (default) · `run --output plain/verbose/silent/actions/json/stream/stream-json` · rules · sandbox · schedule · serve · session · setup · skills · templates · test · todo · tools · traces · tracker · train · ui · up · validate · version · workflow | code (resident TUI standalone → richer legacy dispatch with wrapper) | bot · claw · daemon · dashboard · gateway · identity · kanban · onboard · pairing |

`chat` and `code` open their resident TUI standalone (PR #3818); `code` prefers the richer legacy dispatch when the wrapper is installed. Wrapper-only names stay out of `--help` entirely and do not load a Typer module.

The 13 stub groups below are a special mixed case — their legacy entry points are wrapper-required, but native subcommands stay standalone-safe. `rules` is **not** in this list — `rules list/add/clear` are native standalone (PR #4338):

| Command                                                                                                                                                                     |       Standalone      | Wrapper-required |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------: | :--------------: |
| Stub groups (`agents`, `workflow`, `registry`, `memory`, `skills`, `hooks`, `eval`, `package`, `templates`, `todo`, `research`, `commit`, `call`) — delegating entry points | ❌ Fail fast with hint |         ✅        |
| Stub groups — native subcommands (`memory learn`, `skills bundle/check/eligible`, `eval list-judges`/`list`)                                                                |           ✅           |         ✅        |

<Note>
  `daemon start` runs standalone in both foreground and `--background` modes — only the bot/gateway daemon sub-apps are wrapper-only.
</Note>

### Standalone limits

On a `pip install praisonai-code`-only install:

| Command                                                 | Works standalone? | Notes                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run --help`, `config`, `doctor`                        | Yes               |                                                                                                                                                                                                                                                                       |
| `run --output actions "…"`                              | Yes               | In-process `Agent` (structured events preset)                                                                                                                                                                                                                         |
| `run --output json "…"`                                 | Yes               | In-process `Agent` (structured JSON output)                                                                                                                                                                                                                           |
| `run --output stream "…"`                               | Yes               | In-process `Agent` (streaming text)                                                                                                                                                                                                                                   |
| `run --output stream-json "…"`                          | Yes               | In-process `Agent` (streaming JSON events)                                                                                                                                                                                                                            |
| `run "…"` (default)                                     | Yes               | In-process `Agent` (silent preset; prints final text)                                                                                                                                                                                                                 |
| `run --output plain/verbose/silent "…"`                 | Yes               | In-process `Agent` (plain/verbose/silent presets)                                                                                                                                                                                                                     |
| `chat`, `code`                                          | Yes               | Run resident on the built-in split-pane TUI (PR #3818); the `praisonai` wrapper adds a richer dispatch mode for `code`                                                                                                                                                |
| `daemon start` (foreground)                             | Yes               |                                                                                                                                                                                                                                                                       |
| `daemon start --background`                             | Yes               | Spawns `python -m praisonai_code.runtime`                                                                                                                                                                                                                             |
| Piped stdin (`type file.log \| praisonai-code run "…"`) | Yes               | Works on Windows as of 2026-07-07 (PR #2705) via a stat-based pipe classifier; also supports `Get-Content file.log \| praisonai-code run "…"`. Interactive terminals skip the stdin read. See [Piped Input](/docs/docs/features/cli-piped-stdin#size-cap--platform-notes). |

`chat`, `code`, and every `run` output mode work on a `praisonai-code`-only install (PR #2853, PR #3818). Installing the wrapper (`pip install praisonai`) adds the richer legacy dispatch for `code`, the gateway, and channel bots — it is no longer required for the baseline interactive experience.

`praisonai-code doctor` returns exit **0** on a healthy standalone install — wrapper-presence checks (`performance_praisonai_import`, `acp_module`, `praisonai_package_structure`, `console_script_execution`) SKIP rather than FAIL ([PR #2851](https://github.com/MervinPraison/PraisonAI/pull/2851)).

### Stub command groups on standalone

Run agents standalone without the wrapper — the SDK works directly:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

Agent(instructions="Summarise this URL").start("https://arxiv.org/abs/2409.12345")
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Same result from the CLI, standalone (in-process)
pip install praisonai-code
praisonai-code run --output actions "Summarise https://arxiv.org/abs/2409.12345"
```

Thirteen command groups — `agents`, `workflow`, `registry`, `memory`, `skills`, `hooks`, `eval`, `package`, `templates`, `todo`, `research`, `commit`, and `call` — delegate to the `praisonai` wrapper for their legacy entry points. `rules` is not among them — `rules list/add/clear` run natively on standalone (PR #4338). On a standalone `pip install praisonai-code` ([PR #2854](https://github.com/MervinPraison/PraisonAI/pull/2854)) those entry points exit `1` with a single-line install hint — no Rich traceback:

```
agents requires the full wrapper. Install the full wrapper: pip install praisonai
```

The `<group>` name changes per command (`workflow requires the full wrapper. …`, `registry requires the full wrapper. …`, and so on).

<Note>
  These groups are **mixed**, not wholly wrapper-only. Their native subcommands keep working standalone — only the legacy delegating entry points fail fast.

  | Group    | Standalone-safe native subcommand(s)                                                                       |
  | -------- | ---------------------------------------------------------------------------------------------------------- |
  | `memory` | `memory learn` (status/show/add/search/clear)                                                              |
  | `skills` | `skills bundle`, `skills check`, `skills eligible`                                                         |
  | `eval`   | `eval list-judges`, `eval list` (alias — PR [#2848](https://github.com/MervinPraison/PraisonAI/pull/2848)) |

  Run `pip install praisonai` to unlock the wrapper-delegating entry points, or use the native standalone-safe subcommand.
</Note>

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    subgraph "praisonai-code stub group on standalone"
        Cmd[User: praisonai-code group sub] --> Kind{Subcommand kind?}
        Kind -->|Native: memory learn · skills bundle/check/eligible · eval list-judges/list| InProc[Runs in-process]
        Kind -->|Delegating stub: agents list · workflow run · registry add| Guard{Wrapper installed?}
        Guard -->|Yes| Wrap[Delegates to praisonai wrapper]
        Guard -->|No| Hint[exit 1 with single-line install hint]
    end

    classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef gate fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef ok fill:#10B981,stroke:#7C90A0,color:#fff
    classDef fail fill:#8B0000,stroke:#7C90A0,color:#fff

    class Cmd,Kind input
    class Guard gate
    class InProc,Wrap ok
    class Hint fail
```

### Wrapper-command loading

Wrapper-only commands (`bot`, `gateway`, `pairing`, `identity`, `onboard`, `kanban`, `dashboard`, `claw`, `daemon`) are Typer sub-apps whose implementations live in the `praisonai` wrapper. When you install `praisonai-code` standalone, these commands are not listed in `--help` and are not resolvable — `get_command()` returns `None` instead of loading a module that doesn't exist in `praisonai_code`.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Standalone install, wrapper-only command
$ pip install praisonai-code
$ praisonai-code bot --help
Error: No such command 'bot'.
```

To use `bot`, `gateway`, `pairing`, `identity`, `onboard`, `kanban`, `dashboard`, `claw`, or `daemon`, install the full wrapper:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai
```

## Configuration and environment

| Variable / command             | Behaviour                                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `LOGLEVEL`                     | Read on CLI entry via `configure_cli_logging` (default `WARNING`). Controls root log verbosity for standalone runs. |
| `praisonai-code version check` | Compares your installed version with PyPI (`https://pypi.org/pypi/praisonai-code/json`).                            |

### Version commands

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-code version
```

Shows the full version panel:

```
PraisonAI Code: 0.0.4
PraisonAI Wrapper: 1.x.x   ← only shown when praisonai is installed
PraisonAI Agents: 1.6.x
Python: 3.12.x
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-code version --json
```

Returns structured JSON:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "praisonai-code": "0.0.4",
  "praisonai": "1.x.x",
  "praisonaiagents": "1.6.x",
  "python": "3.12.x"
}
```

The `praisonai` key is omitted when the wrapper is not installed.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-code version check
```

Queries PyPI and returns update status:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "current": "0.0.4",
  "latest": "0.0.5",
  "update_available": true
}
```

<Note>
  `praisonai-code version check` needs outbound HTTPS to PyPI.
</Note>

## Best Practices

<AccordionGroup>
  <Accordion title="When to use praisonai-code alone">
    Use `praisonai-code` for any `run "…"` prompt (default or any `--output` mode), interactive `chat`/`code` (resident TUI, PR #3818), `config`, `doctor`, or the warm-runtime daemon — smaller install, no gateway/bot deps.
  </Accordion>

  <Accordion title="When to install the full wrapper">
    Install `praisonai` for the richer legacy `code` dispatch (`PraisonAI._start_interactive_mode`), Telegram/Discord/Slack bots, the WebSocket gateway, `kanban`/`dashboard`, and `RunPolicy` for unattended runs. Baseline interactive `chat`/`code` run standalone (PR #3818).
  </Accordion>

  <Accordion title="Monorepo dev install order">
    In dev, `pip install -e src/praisonai-agents && pip install -e src/praisonai-code && pip install -e src/praisonai` (this exact order) — matches the release publish order in `pypi-release.yml`.
  </Accordion>

  <Accordion title="AgentApp is a silent alias for AgentOS">
    `from praisonai import AgentOS` and `from praisonai import AgentApp` both work — `AgentApp` is a backward-compat silent alias for `AgentOS`. No deprecation warning is emitted.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Choose your install" icon="download" href="/docs/installation">
    Compare full wrapper, code-only, and SDK installs
  </Card>

  <Card title="Architecture" icon="layers" href="/docs/concepts/architecture">
    Six-package layout and dependency direction
  </Card>
</CardGroup>
