Slash Commands
PraisonAI CLI provides interactive slash commands for quick actions during your AI coding sessions. Inspired by Gemini CLI, Codex CLI, and Claude Code, these commands give you powerful control without leaving the terminal.Overview
Slash commands start with/ and provide quick access to common operations in interactive mode.
/cmd invokes registered commands. For a one-shot shell command in the same session, use !cmd (or !!cmd to attach output as context) — see Shell Escape. The ! prefix bypasses the command registry entirely.Available Commands (Interactive Mode)
When usingpraisonai chat, these commands are available:
Built-in Tools
Interactive mode includes 5 built-in tools that the AI can use:Usage Examples
Starting Interactive Mode
Using Help
Listing Tools
Using Tools via Natural Language
Python API
You can also use slash commands programmatically:Custom Commands
File-based commands in.praisonai/commands/*.md (and .claude/commands/*.md / .agents/commands/*.md when present) auto-register in interactive mode with kind=CommandKind.CUSTOM. Disable discovery with SlashCommandHandler(discover_custom=False). See Custom Agents & Commands.
Unified Command Registry
Insidepraisonai code (and the REPL / async TUI) a single CommandRegistry aggregates every command source into one /name namespace — built-ins, your .praisonai/commands/*.md files (plus .claude/commands/*.md and .agents/commands/*.md when present), skills, MCP prompts, and pip-installed command packs all appear together.
Custom commands work inside praisonai code
Create .praisonai/commands/mydeploy.md:
praisonai run --command mydeploy staging would — full parity between interactive and CLI invocation.
/help lists every discovered command and command list --all shows the same unified namespace. Later sources override earlier ones on a name collision, matching user/project override semantics.Ship a command pack as a pip package
Register a command source in thepraisonai.commands entry-point group in pyproject.toml:
Command Context
Provide context for commands that need session data:Integration with Interactive Mode
Slash commands are automatically available in interactive mode:Command Reference
/help
Show help information./cost
Display session cost and token statistics./model
Manage the AI model./plan
Toggle a persistent read-only mode — writes, edits, deletions, and shell commands are denied until you leave the mode.[PLAN].
/plan flips the live approval backend into PermissionMode.PLAN, which unconditionally denies write / edit / delete / bash / shell tool calls. Exiting restores the launch-time policy (e.g. accept-edits, bypass) — not default — so a session that started with --approval accept-edits keeps that policy after /plan off.Launch a session already in plan mode with praisonai chat --approval plan (or praisonai code --plan). See Permission Modes for the full mode reference.1
Open on an unfamiliar codebase
Start
praisonai chat with your default policy.2
Enter read-only mode
Type
/plan — the status bar flips to [PLAN] and writes/edits are denied.3
Explore freely
Ask
read src/auth/*.py and summarise the auth flow — the agent uses read-only tools only.4
Plan a fix under enforcement
Type
/plan design a fix for the token-refresh bug — the agent produces a step-by-step plan with no accidental edits mid-plan.5
Exit and execute
Type
/plan off — the status bar clears and your launch-time policy returns. Now apply the plan writes and edits normally./diff
Show workspace file changes made this session, from the session-start baseline to the working directory./diff is backed by the checkpoint engine, so it requires auto-checkpointing: set checkpoints.auto: true in config or PRAISONAI_CHECKPOINTS=on. When disabled, /diff prints an enable hint and does nothing else.
See Checkpoints for the underlying engine and the “In-session
/diff” deep-dive, including the --turn vs. session-scope decision guide./commit
Commit changes with an AI-generated message./profile
Toggle profiling to see timing breakdown./stats
Show session statistics./stats works on every REPL surface — the legacy REPL, the async TUI (praisonai code), and praisonai chat. In the async TUI it shares the same renderer as /cost, so both print the same panel and you don’t need to remember which command works where.
/compact
Compress conversation history to save tokens.- Keeps the last 2 conversation turns intact
- Summarizes older turns using the LLM
- Reduces token usage for long sessions
/undo
Undo the last turn. What/undo restores depends on whether checkpointing and the session store are wired in.
The deep-dive lives in Checkpoints → In-session
/undo and /revert./revert
Revert the last N turns — files and conversation together. Mirrors/undo but takes a turn count.
/revert refuses to run beyond the recorded turn count (Can only revert 1..N turn(s).). Checkpointing is on by default in praisonai interactive mode and praisonai code, so /revert works out of the box.
The deep-dive lives in Checkpoints → In-session
/undo and /revert./export
Export the current conversation to a file — available in the legacy REPL (the surfacepraisonai code runs by default).
/export picks one of two paths automatically:
You don’t need to
--session first — the fallback means /export always produces something useful. See praisonai session export for the same renderer on the CLI.
/queue
Manage the message queue. Queue messages while the AI agent is processing and they’ll be executed in order./tasks
Inspect and cancel background tasks without leaving the conversation — parity with the CLI-onlypraisonai background list.
/tasks reuses the same process-wide runner (get_background_runner()) as praisonai background list, so it shows the same tasks across the REPL, TUI, and bots.
When there are no tasks, it prints the empty state:
cancel stops the underlying future, not just the task record — a running task is actually interrupted.
In bot chats,
/tasks is per-user scoped: a caller only ever sees and cancels tasks whose metadata["user_id"] matches theirs (fail-closed). See Bot Chat Commands → /tasks.Best Practices
- Use aliases -
/his faster than/help - Check costs regularly - Use
/costto monitor spending - Explore unfamiliar code with
/planfirst - Read-only enforcement prevents accidental writes while you form a plan; run/plan offwhen you’re ready to execute - Commit frequently - Use
/commitafter each logical change
Related Features
- Message Queue - Full message queue documentation
- Interactive TUI - Full interactive terminal interface
- Background Tasks -
/tasksandpraisonai background list - Cost Tracking - Detailed cost monitoring
- Git Integration - Git operations

