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.

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 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, 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

Create an execution plan for a task.

/diff

Show git diff of current changes.

/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:

/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 conversation turn.

/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.

Best Practices

  1. Use aliases - /h is faster than /help
  2. Check costs regularly - Use /cost to monitor spending
  3. Plan before executing - Use /plan for complex tasks
  4. Commit frequently - Use /commit after each logical change