Context
Upstream PR MervinPraison/PraisonAI#1441 (merged 2026-04-17, closes #1430) added delete/update CLI parity to the praisonai managed command group. There is currently no user-facing documentation for the praisonai managed CLI in PraisonAIDocs — only the Python-SDK ManagedAgent persistence page at docs/features/managed-agent-persistence.mdx, which is scoped to the library-level class, not the CLI.
This issue tracks creating a new feature page that covers the full praisonai managed CLI surface, so users can manage Anthropic-hosted sessions, agents, and environments from the terminal.
What changed upstream (PR #1441)
Four new CLI subcommands were added in src/praisonai/praisonai/cli/commands/managed.py:
| Command |
Args |
Options |
Purpose |
praisonai managed sessions delete <session_id> |
session_id (e.g. sesn_01AbCdEf) |
--yes / -y |
Delete an Anthropic-managed session (with confirmation prompt unless --yes). |
praisonai managed agents delete <agent_id> |
agent_id (e.g. agent_01AbCdEf) |
--yes / -y |
Delete a managed agent. |
praisonai managed envs update <env_id> |
env_id (e.g. env_01AbCdEf) |
--packages / -p (comma-separated pip packages), --networking (full or limited) |
Update environment packages and/or networking. |
praisonai managed envs delete <env_id> |
env_id |
--yes / -y |
Delete an environment. |
Behaviours to document:
- All three
delete commands prompt Are you sure you want to delete <id>? unless --yes/-y is passed. Typing n (or anything non-affirmative) prints Deletion cancelled. and exits 0.
envs update with no --packages and no --networking prints Nothing to update. Pass --packages or --networking. and exits 0.
envs update --networking only accepts full or limited; anything else exits 1 with Error: --networking must be 'full' or 'limited'.
envs update --packages "a, ,b,," trims whitespace and filters empty entries (so it sends ["a", "b"]). If all entries are empty it errors with --packages must include at least one package name and exits 1.
- API errors from the underlying Anthropic client exit
1 and print Error <verb> <resource>: <message>.
- The CLI uses
_get_client(), which reads ANTHROPIC_API_KEY first and falls back to CLAUDE_API_KEY; if neither is set (or the anthropic package isn't installed) the command exits 1.
These sit alongside the already-existing (but also undocumented) subcommands in the same module: sessions list/get/resume, agents list/get/create/update, envs list/get, and the ids save/restore/show helpers. The new page should document the whole praisonai managed surface, not just the PR's four commands, so users get one coherent reference.
Decision: create new content (not update)
docs/features/managed-agent-persistence.mdx is SDK/class-focused (ManagedAgent, ManagedConfig, db(...)). It should not be repurposed.
- There is no
docs/cli/managed.mdx or equivalent. This is net-new.
- Per
AGENTS.md §1.8, new pages go in docs/features/ (never docs/concepts/). Proposed path: docs/features/managed-cli.mdx.
- Add the new page to
docs.json under the Features group (not Concepts). Verify docs.json remains valid JSON after editing.
- Cross-link from
docs/features/managed-agent-persistence.mdx → the new CLI page, and vice versa, under a Related CardGroup.
SDK source to read first (SDK-First Documentation Cycle — AGENTS.md §1.2)
Before writing a single line, the implementing agent must read:
praisonai/cli/commands/managed.py — full command module (synced daily from upstream into this repo at repo-root praisonai/cli/commands/managed.py; also available in the upstream repo at src/praisonai/praisonai/cli/commands/managed.py).
- PR diff: https://github.com/MervinPraison/PraisonAI/pull/1441/files — confirms exact flag names, help strings, error messages, and exit codes.
src/praisonai/tests/unit/cli/test_managed_cli_destructive.py in PR #1441 — 22 tests that document the observable behaviour (confirmation flow, error paths, package trimming, _get_client env-var precedence). Use these as the source of truth for "what does the CLI actually print and exit with."
Do not invent flags or exit codes — copy them from source.
Required page structure (per AGENTS.md §2)
---
title: "Managed CLI"
sidebarTitle: "Managed CLI"
description: "Manage Anthropic-hosted sessions, agents, and environments from the terminal"
icon: "terminal"
---
{/* One sentence: what `praisonai managed` does */}
{/* Hero Mermaid diagram — graph LR, standard color scheme (AGENTS.md §3.1) */}
## Quick Start
<Steps>
<Step title="Authenticate"> # export ANTHROPIC_API_KEY=...
<Step title="Create a session"> # praisonai managed sessions list (shortest useful command)
<Step title="Clean up"> # praisonai managed sessions delete <id> --yes
</Steps>
---
## How It Works
{/* sequenceDiagram: User → CLI → Anthropic API → Response, standard colors */}
---
## Commands
### Sessions
{/* Table of subcommands + one runnable example each. Cover: list, get, resume, delete */}
### Agents
{/* list, get, create, update, delete */}
### Environments
{/* list, get, update, delete — show --packages and --networking clearly */}
### IDs helper
{/* save, restore, show — these are local, no Anthropic call */}
---
## Choosing a subcommand
{/* Decision-tree Mermaid diagram per AGENTS.md §6.1 — "if multiple options, show which to pick when" */}
---
## Safety: confirmation prompts
{/* Callout: all deletes prompt unless --yes; show the exact prompt string */}
---
## Authentication
{/* Explain ANTHROPIC_API_KEY → CLAUDE_API_KEY precedence and the `anthropic` pip dep */}
---
## Common Patterns
{/* 2–3 short shell snippets: cleanup loop, scripted env update, etc. */}
---
## Best Practices
<AccordionGroup>
<Accordion title="Always script with --yes in CI">
<Accordion title="Prefer `envs update --packages` over recreating envs">
<Accordion title="Use `ids save` to checkpoint IDs you care about">
</AccordionGroup>
---
## Related
<CardGroup cols={2}>
<Card href="/docs/features/managed-agent-persistence">ManagedAgent + DB persistence (Python SDK)</Card>
<Card href="/docs/features/sessions">Sessions</Card>
</CardGroup>
Writing-style requirements (AGENTS.md §6)
- Agent-centric and beginner-first. Someone who has never used the Anthropic managed infra should feel "this is just a few commands."
- Each section starts with one sentence.
- No forbidden phrases ("In this section…", "As you can see…", "Please note that…", "The following example shows…").
- Every shell example must be copy-paste runnable; use realistic but fake IDs like
sesn_01AbCdEf, agent_01AbCdEf, env_01AbCdEf (these are the exact examples in the docstrings).
- Include a user-interaction flow showing the confirmation prompt in action (before/after
--yes).
Mermaid diagrams (AGENTS.md §3)
At minimum:
- Hero
graph LR — User → praisonai managed → Anthropic API → Resource (session/agent/env).
sequenceDiagram — delete flow with confirmation branch (User / CLI / Anthropic), showing the --yes short-circuit.
- Decision
graph TB — "Which subcommand do I want?" (list/get/create/update/delete across sessions/agents/envs).
Use the exact colour scheme from AGENTS.md §3.1 (#8B0000, #189AB4, #10B981, #F59E0B, #6366F1, white text, #7C90A0 strokes).
Acceptance checklist (for the implementing agent)
Content:
Structure (AGENTS.md §9):
Quality:
References
/cc @MervinPraison
Context
Upstream PR MervinPraison/PraisonAI#1441 (merged 2026-04-17, closes #1430) added delete/update CLI parity to the
praisonai managedcommand group. There is currently no user-facing documentation for thepraisonai managedCLI in PraisonAIDocs — only the Python-SDKManagedAgentpersistence page atdocs/features/managed-agent-persistence.mdx, which is scoped to the library-level class, not the CLI.This issue tracks creating a new feature page that covers the full
praisonai managedCLI surface, so users can manage Anthropic-hosted sessions, agents, and environments from the terminal.What changed upstream (PR #1441)
Four new CLI subcommands were added in
src/praisonai/praisonai/cli/commands/managed.py:praisonai managed sessions delete <session_id>session_id(e.g.sesn_01AbCdEf)--yes/-y--yes).praisonai managed agents delete <agent_id>agent_id(e.g.agent_01AbCdEf)--yes/-ypraisonai managed envs update <env_id>env_id(e.g.env_01AbCdEf)--packages/-p(comma-separated pip packages),--networking(fullorlimited)praisonai managed envs delete <env_id>env_id--yes/-yBehaviours to document:
deletecommands promptAre you sure you want to delete <id>?unless--yes/-yis passed. Typingn(or anything non-affirmative) printsDeletion cancelled.and exits0.envs updatewith no--packagesand no--networkingprintsNothing to update. Pass --packages or --networking.and exits0.envs update --networkingonly acceptsfullorlimited; anything else exits1withError: --networking must be 'full' or 'limited'.envs update --packages "a, ,b,,"trims whitespace and filters empty entries (so it sends["a", "b"]). If all entries are empty it errors with--packages must include at least one package nameand exits1.1and printError <verb> <resource>: <message>._get_client(), which readsANTHROPIC_API_KEYfirst and falls back toCLAUDE_API_KEY; if neither is set (or theanthropicpackage isn't installed) the command exits1.These sit alongside the already-existing (but also undocumented) subcommands in the same module:
sessions list/get/resume,agents list/get/create/update,envs list/get, and theids save/restore/showhelpers. The new page should document the wholepraisonai managedsurface, not just the PR's four commands, so users get one coherent reference.Decision: create new content (not update)
docs/features/managed-agent-persistence.mdxis SDK/class-focused (ManagedAgent,ManagedConfig,db(...)). It should not be repurposed.docs/cli/managed.mdxor equivalent. This is net-new.AGENTS.md§1.8, new pages go indocs/features/(neverdocs/concepts/). Proposed path:docs/features/managed-cli.mdx.docs.jsonunder the Features group (not Concepts). Verifydocs.jsonremains valid JSON after editing.docs/features/managed-agent-persistence.mdx→ the new CLI page, and vice versa, under aRelatedCardGroup.SDK source to read first (SDK-First Documentation Cycle — AGENTS.md §1.2)
Before writing a single line, the implementing agent must read:
praisonai/cli/commands/managed.py— full command module (synced daily from upstream into this repo at repo-rootpraisonai/cli/commands/managed.py; also available in the upstream repo atsrc/praisonai/praisonai/cli/commands/managed.py).src/praisonai/tests/unit/cli/test_managed_cli_destructive.pyin PR #1441 — 22 tests that document the observable behaviour (confirmation flow, error paths, package trimming,_get_clientenv-var precedence). Use these as the source of truth for "what does the CLI actually print and exit with."Do not invent flags or exit codes — copy them from source.
Required page structure (per AGENTS.md §2)
Writing-style requirements (AGENTS.md §6)
sesn_01AbCdEf,agent_01AbCdEf,env_01AbCdEf(these are the exact examples in the docstrings).--yes).Mermaid diagrams (AGENTS.md §3)
At minimum:
graph LR—User → praisonai managed → Anthropic API → Resource (session/agent/env).sequenceDiagram— delete flow with confirmation branch (User / CLI / Anthropic), showing the--yesshort-circuit.graph TB— "Which subcommand do I want?" (list/get/create/update/delete across sessions/agents/envs).Use the exact colour scheme from AGENTS.md §3.1 (
#8B0000,#189AB4,#10B981,#F59E0B,#6366F1, white text,#7C90A0strokes).Acceptance checklist (for the implementing agent)
Content:
praisonai/cli/commands/managed.pycompletely before writing.managedsubcommands (sessions list/get/resume/delete, agents list/get/create/update/delete, envs list/get/update/delete, ids save/restore/show), not only the four added in #1441.ANTHROPIC_API_KEYandCLAUDE_API_KEY(precedence) and thepip install anthropicdependency.--networkingallowed values (full,limited) and the--packagescomma-separated / whitespace-trimmed behaviour.envs updatewith no flags.Structure (AGENTS.md §9):
title,sidebarTitle,description,icon: "terminal".<Steps>Quick Start,<AccordionGroup>Best Practices,<CardGroup cols={2}>Related.docs/concepts/(violates AGENTS.md §1.8).docs.jsonupdated under Features group; JSON remains valid.docs/features/managed-agent-persistence.mdx.Quality:
your-key-hereplaceholders).classDefdeclared.References
docs/features/managed-agent-persistence.mdxpraisonai/cli/commands/managed.py/cc @MervinPraison