code command starts a code assistant session optimized for programming tasks.
praisonai code is safe by default: file writes and shell commands prompt for approval on first call. Pass --no-safe or --dangerously-skip-approval to restore the legacy ungated behaviour. See Tool Approval.Usage
Arguments
| Argument | Description |
|---|---|
PROMPT | Code-related prompt or question |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--model | -m | LLM model to use | gpt-4o-mini |
--verbose | -v | Verbose output | false |
--tools | -t | Comma-separated tool names (e.g. web_search,github) or a tools.py file path | |
--workspace | -w | Workspace directory | |
--file | -f | Attach file(s) to context | |
--no-acp | Disable ACP tools (file operations) | false | |
--no-lsp | Disable LSP tools (code intelligence) | false | |
--safe / --no-safe | Safe mode: prompt before file writes and shell commands (default: on). Use --no-safe to disable. | true | |
--dangerously-skip-approval | Skip all tool approval prompts and export PRAISONAI_TOOL_SAFETY=off for the subprocess tree | false | |
--session | -s | Session ID to resume | |
--continue | -c | Continue last session | false |
--no-context | Disable AGENTS.md/CLAUDE.md auto-loading into system prompt | false | |
--agent | -a | Named custom agent profile from .praisonai/agents/ (tools + permission scope) | |
--thinking | Reasoning effort for this invocation: off, minimal, low, medium, high | ||
--checkpoints / --no-checkpoints | Auto-checkpoint the workspace before each file-mutating turn, enabling in-session /undo and /revert | --no-checkpoints | |
--revert <ref> | One-shot: restore workspace to a prior checkpoint (id, short id, or last) and exit | — |
Safe mode (
--safe) is on by default as of PR #2369. Dangerous built-in tools ask for approval in interactive sessions and are denied in non-interactive (CI) sessions. Use --no-safe to opt out, or --dangerously-skip-approval for a complete bypass. See Approval for full details.Piped Input
praisonai code reads piped stdin when the prompt is provided in the shell pipeline.
\n). See Piped Input.
Examples
Start code assistant
Ask a coding question
Specify language context
Disable safe mode (opt out of approval prompts)
Full bypass (no approval prompts, applies to subprocess tree)
Reasoning effort (per invocation)
Custom agent profile
Project context
By default,praisonai code walks up from the current directory to your git root and prepends any AGENTS.md / CLAUDE.md / agents.md / .agents/AGENTS.md it finds to the agent’s system prompt, layered on top of ~/.praisonai/AGENTS.md. Pass --no-context (or set PRAISON_NO_CONTEXT=true) to disable. See Context Files for details.
Windows Automation
For Windows automation scenarios, use the--no-acp flag and set UTF-8 encoding:
Auto checkpointing & in-session undo
Workspace checkpointing is off by default. Enable it with--checkpoints to auto-snapshot before each file-mutating turn, unlocking /undo and /revert inside the coding REPL.
How /undo differs by mode
| Mode | What /undo does |
|---|---|
| Checkpointing off (default) | Removes the last assistant+user message from history only |
Checkpointing on (--checkpoints or checkpoints.auto: true) | Removes the last turn from history and restores workspace files to the pre-turn checkpoint (diff preview first) |
Interactive slash commands
Type these inside apraisonai code REPL when --checkpoints is active:
| Command | What it does |
|---|---|
/undo | Undo the last turn: remove from history and restore workspace files |
/revert | Same as /revert 1 — roll back 1 turn |
/revert 2 | Roll the workspace back 2 turns |
One-shot revert from CLI
Project config
Enable checkpointing for allpraisonai code sessions in a project:
PRAISONAI_CHECKPOINTS=on (env) > checkpoints.auto (config) > default (off).
See Checkpoints for the full checkpoint feature reference.
See Also
- Chat - General chat mode
- LSP Code Intelligence - Language server integration
- Approval - Tool approval and safety defaults
- Checkpoints - Workspace checkpointing and undo

