> ## 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"}}
from praisonaiagents import Agent

agent = Agent(
    name="assistant",
    instructions="You are a helpful coding assistant.",
)
agent.start("Summarise the top 3 arXiv papers on RAG this week")
```

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

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph pip_code["pip install praisonai-code"]
        A[praisonai-code CLI] --> A1[run --output actions · config · doctor · daemon · version · …]
    end
    subgraph pip_wrapper["pip install praisonai"]
        B[praisonai CLI] --> B1[gateway · bot · onboard · pairing · identity · kanban · claw · dashboard]
        B --> B2[default run · chat · code]
        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 code
    class B,B1,B2 wrapper
    class C core
```

<Warning>
  As of praisonai-code **0.0.22**, default `run "…"`, `chat`, and `code` require the `praisonai` wrapper. On a standalone install they emit an install hint. `run --output actions "…"` stays standalone-safe.
</Warning>

## Which install do I need?

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Start{What do you run?} -->|Agentic prompt for CI/scripts| Actions[run --output actions]
    Start -->|Interactive terminal chat or coding| Wrapper1[chat · code]
    Start -->|Plain conversational run| Wrapper2[default run]
    Start -->|Bots · gateway · dashboard| Wrapper3[gateway · bot · …]
    Start -->|Warm runtime daemon| Daemon[daemon start]

    Actions --> Code[pip install praisonai-code]
    Daemon --> Code
    Wrapper1 --> Full[pip install praisonai]
    Wrapper2 --> Full
    Wrapper3 --> Full

    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 Actions,Daemon code
    class Wrapper1,Wrapper2,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.

## 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 --output actions "Summarise the top 3 arXiv papers on RAG this week"
    ```

    Use `--output actions` for the standalone-safe in-process `Agent` path. Default `run "…"` (no `--output actions`) requires the wrapper.
  </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

When a command needs the `praisonai` wrapper, the CLI uses an internal bridge. If the wrapper is missing, you get a clear install hint instead of a silent failure. 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 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 run / chat / code)
        Bridge-->>CLI: False
        CLI-->>User: "Default run mode requires the praisonai wrapper. Install with: pip install praisonai"
    end
    Note over User,CLI: run --output actions "…" stays in-process, no wrapper needed
```

The default `run "…"` guard checks `wrapper_available()` before any credential setup. When the wrapper is absent it prints:

```
Default run mode requires the praisonai wrapper. Install with: pip install praisonai
Standalone alternative: praisonai run --output actions "your prompt"
```

`chat` and `code` raise the parallel hint: `Error: chat requires the praisonai wrapper. Install the full wrapper: pip install praisonai` (and the same for `code`).

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-required (listed on a standalone install but needs the wrapper at runtime), and wrapper-only (not listed without the wrapper).

| Standalone (`pip install praisonai-code`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Wrapper-required (listed, needs `praisonai`) | Wrapper-only (`pip install praisonai`)                                            |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------- |
| acp · agent · agents · attach · auth · batch · benchmark · browser · call · checkpoint · 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 --output actions` · rules · sandbox · schedule · serve · session · setup · skills · templates · test · todo · tools · traces · tracker · train · ui · up · validate · version · workflow | `run "…"` (default) · chat · code            | bot · claw · daemon · dashboard · gateway · identity · kanban · onboard · pairing |

Wrapper-required commands are listed in `--help` but fail fast with an install hint when the wrapper is missing. Wrapper-only names stay out of `--help` entirely and do not load a Typer module.

<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`                                                                                                                                                                                                                                                    |
| `run "…"` (default)                                     | No                | Requires `pip install praisonai`                                                                                                                                                                                                                                      |
| `chat`, `code`                                          | No                | TUI / interactive legacy live in wrapper                                                                                                                                                                                                                              |
| `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/features/cli-piped-stdin#size-cap--platform-notes). |

For full terminal UX (`chat`, `code`, default `run`), install the wrapper: `pip install praisonai`.

### 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` when you only need `run --output actions`, `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 interactive `chat`/`code`, default conversational `run "…"`, Telegram/Discord/Slack bots, the WebSocket gateway, or `kanban`/`dashboard`.
  </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">
    Three-package layout and dependency direction
  </Card>
</CardGroup>
