Skip to main content

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 using praisonai 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

Inside praisonai 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:
Then invoke it inside the interactive session:
This runs the exact interpolated template that 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 the praisonai.commands entry-point group in pyproject.toml:
The registry discovers it on start — no user code needed. A broken pack is logged and skipped, never taking down the registry. Register programmatic slash commands:

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.
While plan mode is active, the status bar shows [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.
Real-world flow:
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.
When enabled, shows timing after each response:

/stats

Show session statistics.
Output:
/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.
This command:
  • 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.

/revert

Revert the last N turns — files and conversation together. Mirrors /undo but takes a turn count.
A diff preview is shown before restore, and /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.

/export

Export the current conversation to a file — available in the legacy REPL (the surface praisonai 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.
Output when messages are queued:
Type new messages while the agent is processing. They’ll be queued and executed automatically in FIFO order.

/tasks

Inspect and cancel background tasks without leaving the conversation — parity with the CLI-only praisonai 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

  1. Use aliases - /h is faster than /help
  2. Check costs regularly - Use /cost to monitor spending
  3. Explore unfamiliar code with /plan first - Read-only enforcement prevents accidental writes while you form a plan; run /plan off when you’re ready to execute
  4. Commit frequently - Use /commit after each logical change