External Agents
PraisonAI provides seamless integration with external AI coding CLI tools, allowing you to use Claude Code, Gemini CLI, Codex CLI, and Cursor CLI as agent tools.Built-in Integrations
These ship with PraisonAI.--external-agent and ExternalAgentsHandler.list_integrations() return these built-ins plus any registered plugins — the set is registry-driven, not fixed. See Register a custom external agent.
Installation
The integrations are included with PraisonAI:Quick Start
Python API
CLI Usage
As Agent Tools
As a native async agent tool
Preferred when the agent runs onagent.astart(...) (or any async entrypoint) — the tool is awaited directly on the running loop with no thread hop.
as_async_tool() was added in PraisonAI PR #4022; as_tool() still works and is now also safe to call from inside an async agent runtime.
CLI Usage: Manager Delegation vs Direct Proxy
PraisonAI now offers two modes for external CLI integration, balancing power and simplicity.Manager Delegation (Default)
When using--external-agent, a manager Agent wraps the external CLI as a subagent tool, providing reasoning and planning capabilities.
- Multi-step tasks requiring planning
- Need reasoning across multiple tools
- Want aggregated responses
- Complex workflows with decision-making
gpt-4o-mini, configurable via --llm or MODEL_NAME environment variable.
Direct Proxy (Escape Hatch)
Use--external-agent-direct for pass-through behavior — fastest execution with no manager overhead.
- Single-shot calls
- Scripting scenarios
- Fastest execution needed
- No manager LLM overhead wanted
Environment Variables
Set the appropriate API keys for each integration:ExternalAgentsHandler
TheExternalAgentsHandler provides a unified interface for managing external integrations:
praisonai-code against a praisonai wrapper predating external_agent_catalog — check_dependencies() returns (False, "…too old…") instead of passing and then yielding an empty catalog:
Performance
All integrations are designed with zero performance impact:Lazy Loading
Integrations are only imported when used:Availability Caching
CLI availability checks are cached at the class level:Streaming
All integrations support streaming output:Error Handling
ValueError) from a version-skewed install (RuntimeError):
Using from PraisonAI UI
Next Steps
Claude Code
Detailed Claude Code integration guide
Gemini CLI
Detailed Gemini CLI integration guide
Codex CLI
Detailed Codex CLI integration guide
Cursor CLI
Detailed Cursor CLI integration guide

