Overview
PraisonAI functions as a real AI code editor that can:- Edit files on disk
- Run terminal commands (pytest, ruff, etc.)
- Observe failures and fix them
- Converge to green tests
CLI Contract (January 2026)
| Command | Description | Key Flags |
|---|---|---|
praisonai chat | Terminal-native REPL | -m, -w, -f, -c, -s |
praisonai code | Terminal-native code assistant | -m, -w, -f, -c, -s |
praisonai tui | Full TUI interface | -w, -s, -m |
praisonai ui chat | Browser-based chat | --port, --host |
praisonai ui code | Browser-based code | --port, --host |
Key Flags
| Flag | Description |
|---|---|
-m, --model | LLM model to use (default: gpt-4o-mini) |
-w, --workspace | Working directory for file operations |
-f, --file | Attach file(s) to prompt |
-c, --continue | Continue last session |
-s, --session | Resume specific session ID |
--no-acp | Disable ACP tools |
--no-lsp | Disable LSP tools |
Auto-Approval for Automation
SetPRAISON_APPROVAL_MODE=auto to enable non-interactive tool execution:
Prerequisites
AI Code Editor Scenarios
1. Implement Code from Specification
Implement a function and run tests until they pass.- Agent reads the existing file
- Implements the function with the formula
- Runs
pytestto verify - If tests fail, fixes and reruns
2. Fix Division by Zero Bug
Fix a bug that causes test failures.- Agent reads the buggy code
- Adds the zero-check with proper error
- Runs tests to confirm the fix
- Iterates until tests pass
3. Implement Missing Function
Implement a function that’s currently a stub.- Agent reads the stub function
- Implements the logic using Counter or similar
- Runs targeted tests
- Fixes any edge cases
4. Fix Empty List Handling
Add proper error handling for edge cases.- Agent adds input validation
- Raises appropriate error
- Verifies with tests
5. Add CLI Command
Extend a CLI with a new command.- Agent reads the CLI code
- Adds the version subcommand
- Runs the command to verify output
6. Fix Lint Errors
Clean up code style issues.- Agent runs
ruff check . - Reads the error output
- Fixes each issue (unused imports, whitespace, etc.)
- Reruns ruff until clean
7. Implement Temperature Conversion
Implement the reverse conversion function.- Agent implements the function
- Runs targeted tests
- Fixes any precision issues
8. Fix Median Edge Case
Handle empty list in median function.- Agent adds the validation check
- Runs tests to verify
- Ensures existing tests still pass
9. Add Type Hints
Improve code with type annotations.- Agent reads the file
- Adds parameter and return type hints
- Optionally runs mypy to verify
10. Make All Tests Pass
Fix all remaining issues in a project.- Agent runs full test suite
- Identifies all failures
- Fixes each one systematically
- Reruns until 100% pass
Key Flags
| Flag | Description |
|---|---|
-w, --workspace | Set working directory for file operations |
-m, --model | LLM model to use (default: gpt-4o-mini) |
-c, --continue | Continue previous session |
-f, --file | Attach file(s) to prompt |
-s, --session | Resume specific session ID |
The Closed-Loop Workflow
PraisonAI implements a closed-loop workflow similar to OpenCode:- The agent runs commands itself (not you)
- The agent reads test output itself
- The agent iterates until success
Tips for Best Results
- Use Workspace Flag: Always use
-w .to enable file editing - Be Specific: Include file paths and expected behavior
- Request Verification: Ask the agent to run tests after changes
- Use Cheap Models: Start with
gpt-4o-minifor cost efficiency - Continue Sessions: Use
--continuefor multi-step tasks
Troubleshooting
Agent Not Editing Files
Ensure you’re using the workspace flag:Tests Not Running
Make sure pytest is installed in your environment:API Key Issues
Set your API key:Related
- Interactive Runtime - Core runtime details
- Session Management - Session commands
- Chat Command - Chat mode options

