When to Use: Shell scripts, CI/CD pipelines, batch processing, or when you need language-agnostic recipe invocation without running a server.
How It Works
The CLI model spawns a subprocess to run recipes. Output is captured via stdout in JSON format for easy parsing.Pros & Cons
- Pros
- Cons
- Language-agnostic - Works from any language that can spawn processes
- Simple JSON output - Easy to parse in any language
- No SDK dependency - Calling app doesn’t need praisonai installed
- Process isolation - Recipe runs in separate process
- Easy debugging - Run commands manually to test
Step-by-Step Tutorial
1
Verify CLI Installation
2
List Available Recipes
3
Get Recipe Info
4
Run Recipe with JSON Output
5
Parse Output in Your Application
Production-Ready Example
CI/CD Integration
GitHub Actions
GitLab CI
Troubleshooting
Command not found: praisonai
Command not found: praisonai
Add praisonai to your PATH or use the full path:
JSON parse error
JSON parse error
Ensure you’re using the
--json flag and only parsing stdout:Exit code non-zero
Exit code non-zero
Check stderr for error details:Common exit codes:
1: General error2: Validation error7: Recipe not found
Environment variables not passed
Environment variables not passed
Explicitly pass environment variables:
Security & Ops Notes
Security Considerations
- Input sanitization: Never pass unsanitized user input directly to CLI
- Shell injection: Use list form of subprocess.run, not shell=True
- API keys: Pass via environment variables, not command line arguments
- Timeouts: Always set timeouts to prevent hanging processes
CLI Reference
Next Steps
- Local HTTP Sidecar - For HTTP-based integration
- Remote Managed Runner - For production deployments
- Use Cases - Real-world implementation patterns

