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. Installed skills and your custom .praisonai/commands/*.md files appear in the same / menu alongside these built-ins.

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

Type / at the interactive prompt to see every registered command in one menu — built-ins first, then your .praisonai/commands/*.md files, then installed skills (SkillCommandSource), then MCP prompts, then any praisonai.commands pack. A skill named my-skill shows up as /my-skill with the skill’s own description from SKILL.md frontmatter, and pressing Enter runs it (the skill body renders as a prompt with any args appended). 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. Not every installed skill appears in the / menu. A skill whose SKILL.md frontmatter sets user-invocable: false is treated as model-only: the LLM can still auto-trigger it from the system-prompt listing, but it is absent from the completion menu and typing /<name> falls through to “Unknown command”. See Skills → Invocation Policy for the full visibility truth table.

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.

Skills work inside praisonai code

Type / at the prompt and your installed skills appear in the completion menu next to built-ins and custom commands:
/my-skill renders SKILL.md’s body with the user’s args appended, matching praisonai "/my-skill extra context" --skills ./skills/my-skill.
/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.
Browse and run installed skills from the same menu — see Skill Invocation → Discover skills in the interactive menu.

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.

/clear and /new

Reset the conversation. As of PR #4943 both clear the agent’s conversation memory as well as the screen — the old behaviour only wiped the display, leaving the model still holding the prior turns.

/import

Restore a conversation from a file into both the screen and the agent’s state.
Previously /import printed Imported N messages and then answered as though none of them existed — the transcript was restored on screen but never plumbed into the agent. It now goes through the same persist + rebuild path as /continue.

/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

Compact the model’s own chat_history to free context tokens.
This command:
  • Compacts the model’s chat_history, not just the transcript pane.
  • Reports what it freed (for example: 120 messages, 240,483 → 94,191 tokens).
  • Runs automatically at the turn boundary when the session nears its context budget, instead of waiting for the provider to reject the request.
/compact used to be a display toggle. That behaviour now lives under /compact-display (alias /dense). See Compaction.

/compact-display

Toggle compact output display mode — the old /compact behaviour.

Git operator commands

Five git operator commands run directly, without the agent deciding to commit. They’re operator commands, not agent tools.
See Git Integration → Operator slash commands.

/map

Show the repository map — an operator overview of an unfamiliar repo, not an agent tool.
See Repository Map.

/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