Skip to main content
The 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

Options

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.
Prompt argument is merged first, piped body second (joined with \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

See Custom Agents & Commands for profile definitions and Thinking for budget levels.

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.

Workspace directory

praisonai code runs its file, edit, search, and shell tools inside one workspace directory. Everything the agent reads and writes is contained there.

Pick a workspace explicitly

Everything the agent reads or writes stays inside ./src.

Pick a workspace with an environment variable

PRAISONAI_WORKSPACE is the canonical name. The older PRAISON_WORKSPACE still works for backwards compatibility, but PRAISONAI_WORKSPACE wins when both are set.

Resume back into the same directory

Launch praisonai code --continue from any shell — the tools re-root into the directory the session was created in, so the conversation stays consistent. If the recorded directory no longer exists you’ll see a warning and the tools fall back to the current directory:
An explicit --workspace always wins over the resumed directory.

Windows Automation

For Windows automation scenarios, use the --no-acp flag and set UTF-8 encoding. The -w flag is now honored end-to-end, so the agent’s tools operate inside the directory you pass:
See the Windows Automation section in Real-world Examples for complete setup instructions.

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

Interactive slash commands

Type these inside a praisonai code REPL when --checkpoints is active: Both commands show a diff preview before restoring and refuse to run while a turn is still in progress.

One-shot revert from CLI

Shows the diff preview and restores the workspace, then exits.

Project config

Enable checkpointing for all praisonai code sessions in a project:
Precedence: PRAISONAI_CHECKPOINTS=on (env) > checkpoints.auto (config) > default (off). See Checkpoints for the full checkpoint feature reference.

See Also