Skip to main content

praisonai-code

Agentic terminal CLI for PraisonAI — the terminal-native agent product (run, chat, code, warm runtime, CLI backends) extracted from the praisonai wrapper.

Analogues: opencode, codex, gemini-cli.

Status

C0–C5 complete. C6 integration gate verified — see src/praisonai/tests/C6_VERIFICATION.md.

Step Scope Status
C0 Scaffold Done
C1 runtime/ + cli_backends/ Done
C2 interactive/, execution/, ui/, output/, state/ Done
C3 Agentic commands Done
C4 Agentic features Done
C5 main.py, app.py, config/session/utils + shims Done
C6 Integration gate + sign-off Done
C7 Hot-path standalone (agentic CLI without wrapper import) Done
  • praisonai_code.runtime — warm local runtime (daemon + thin client).
  • praisonai_code.cli_backends — CLI backend implementations (e.g. Claude Code).
  • praisonai_code.llm — endpoint resolution, credentials, model catalogue.
  • praisonai_code.tool_resolver — YAML tool name resolution.

See src/praisonai/tests/C7_VERIFICATION.md for the hot-path sign-off checklist.

Dependency rules

praisonai (main)  →  depends on  praisonai-code
praisonai-code    →  depends on  praisonaiagents (core SDK)

praisonai-code also pulls in its own third-party runtime deps (rich, typer, click, textual, PyYAML, python-dotenv, litellm, mcp, pydantic — see pyproject.toml). The rules above govern the inter-package direction.

C7 (hot path complete): Standalone pip install praisonai-code supports core agentic terminal commands without importing the wrapper on the hot path. Approval backends resolve locally via praisonai_code.cli.features._approval_bridge (channel bots delegate to the wrapper). Optional features (observability sinks, framework adapters, bots/gateway) remain wrapper-only via praisonai_code._wrapper_bridge.

Standalone limits (pip install praisonai-code only)

The terminal-native commands (run, chat, code, doctor, daemon) live in praisonai_code.cli.commands.* and resolve via LazyCommandGroup without importing the wrapper. Only commands in _WRAPPER_RESIDENT_COMMANDS (see praisonai_code/cli/app.py) require pip install praisonai.

Command Works standalone? Notes
praisonai-code --version Yes
run --help, config, doctor Yes
run --output actions "…" Yes In-process Agent (structured events). run modes: silent (default), plain, actions, verbose, json, stream, stream-json
run --output json/stream/stream-json "…" Yes In-process Agent (structured output)
run "…" (default) Needs praisonai Human-readable text run delegates to the wrapper's handle_direct_prompt; standalone gates with an install hint pointing to --output actions
run --output plain/verbose/silent "…" Needs praisonai Same text path as default; standalone gates with an install hint
chat --output plain "…" Yes One-shot; interactive REPL also in code package. chat modes: actions (default), plain, verbose, json, silent
code --help Yes Full code assistant command registered
daemon start (foreground) Yes
daemon start --background Yes Spawns python -m praisonai_code.runtime
batch, docs, langfuse, flow, n8n, train, … No _WRAPPER_RESIDENT_COMMANDS — needs pip install praisonai
bot, gateway, pairing, … No Needs praisonai bot package

Known limitations:

  • praisonai-code --help may crash on Windows (cp1252) due to emoji in command descriptions — tracked separately.
  • Piped stdin (file | run) is not yet supported on Windows.

For bots, gateway, batch, observability sinks, and the wrapper-resident commands above, install the full wrapper: pip install praisonai.

Completed C7 steps:

  • praisonai_code._registry — vendored plugin registry (no wrapper import)
  • praisonai_code._version / runtime/descriptor.py — version from praisonai-code
  • praisonai_code.__main__ + praisonai-code console script — standalone entry
  • praisonai_code._logging — CLI logging without wrapper dependency
  • praisonai_code.llm.* — env, credentials, catalogue, config
  • praisonai_code._framework_availability, _safe_loader, tool_resolver — execution helpers
  • Namespace cleanup — praisonai_code.cli.features.* local imports on agentic path

Backward compatibility is preserved via PEP 562 shims at the old praisonai.* import paths, so pip install praisonai and from praisonai.cli.main import PraisonAI keep working unchanged.

Install

Recommended (includes wrapper + bots/gateway):

pip install praisonai

Standalone code package (agentic CLI only):

pip install praisonai-code
praisonai-code --version
python -m praisonai_code --help

Development / monorepo:

pip install -e src/praisonai-agents
pip install -e src/praisonai-code
pip install -e src/praisonai
python -c "import praisonai_code; print(praisonai_code.__version__)"

PyPI: Published as praisonai-code after praisonaiagents in the three-package release order (see pypi-release.yml).

Shell execution (PRAISON_SHELL)

execute_command runs argv directly (shell=False) as a prompt-injection defence. Shell operators — &&, ||, |, >, >>, ;, `, $( — are therefore not interpreted, and a command containing one is refused rather than run with the operator silently dropped. (Dropping it and returning exit 0 gives the model nothing to correct on; a redirect that creates no file must not report success.)

PRAISON_SHELL Behaviour
unset / off (default) Shell syntax is refused with an explanation. Plain commands run as before.
sandboxed A real /bin/sh -c runs inside OS-native containment — Seatbelt (sandbox-exec) on macOS, bubblewrap on Linux — restricted to the workspace plus the temp dir, network denied.
unsafe A real /bin/sh -c with no containment. Opt-in only; never used as a fallback.

sandboxed mode measures enforcement before trusting it: it runs a probe child that tries to write outside the writable set, and refuses to run at all if that write succeeds. It never degrades quietly to an uncontained shell. Approval is unchanged — the real-shell path is gated by the same require_approval(risk_level="critical") guard, under the same execute_command tool identity.

Session commands

Command Does
/compact [strategy] Compact the conversation context (frees tokens). Runs automatically at a turn boundary when the session nears the model's budget.
/compact-display (/dense) Toggle compact output rendering — the old meaning of /compact.
/map [path] Ranked repository map (tree-sitter symbol extraction).
/git-status, /git-diff, /git-log [n], /git-commit [msg], /git-undo Git from inside the session. /git-commit generates a message from the staged diff when none is given.

MCP servers declared under mcp.servers in project config are loaded into the code session's tool set. Disable with PRAISON_TOOLS_DISABLE=mcp.

Trust gate. Project-declared local (stdio) MCP servers spawn a subprocess on the host, so a cloned repository could run a repo-controlled script the moment the session opens. They are therefore not started automatically: set PRAISONAI_MCP_TRUST=1 to allow the current workspace to start its local MCP subprocesses. Remote (URL) servers spawn no local process and are unaffected. Config is resolved from the selected --workspace, not the process working directory.

Metadata

Release files for praisonai-code 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for praisonai-code 0.1.5
File Size Uploaded
praisonai_code-0.1.5.tar.gz 951.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for praisonai-code 0.1.5
File Interpreter ABI Platform
praisonai_code-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 2.1 MB

Release files / praisonai_code-0.1.5.tar.gz

Download URL praisonai_code-0.1.5.tar.gz
Size 951.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9ffa2a41b454599d4ee777b3d760ce7242554019d0ff2568d443702bb7d27b84
BLAKE2b-256 checksum
How to use checksums
fd257f302ab036184d961b546fd25eecf3237439c1f3d3819597318fbcf80479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / praisonai_code-0.1.5-py3-none-any.whl

Download URL praisonai_code-0.1.5-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
321df0c7ff9ff3a1fa23a76140dd64cf7d647cbd5697db920f1e5218d406c9e7
BLAKE2b-256 checksum
How to use checksums
7e961b8da3010a6506ab760488e9dc66d22000b134ad108a861eb29a6284abb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.64

2 release files

0.0.63

2 release files

0.0.62

2 release files

0.0.57

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page