Useful ToolsSlash Command
DocsUseful ToolsSlash Command

SlashCommand

Load and execute custom commands from markdown files.

Quick Start

main.py
from connectonion import SlashCommand # Load command cmd = SlashCommand.load("today") # Get prompt prompt = cmd.prompt # List all commands commands = SlashCommand.list_all()

Want to customize? Run co copy slash_command to get an editable copy.

Command File Format

Create .co/commands/today.md:

code
--- name: today description: Daily email briefing tools: - Gmail.search_emails - WebFetch --- Summarize my important emails from today. Focus on: - Urgent requests - Meeting invites - Follow-ups needed

YAML Frontmatter

FieldRequiredDescription
nameYesCommand name
descriptionYesShort description
toolsNoAllowed tools (all if omitted)

Tool Filtering

Limit which tools the command can use:

code
tools: - Gmail.search_emails # Specific method - WebFetch # Whole class - my_function # Standalone function

Locations

Commands are loaded from:

  1. .co/commands/*.md (user commands - priority)
  2. commands/*.md (built-in commands)

API

main.py
# Load single command cmd = SlashCommand.load("today") cmd.name # "today" cmd.description # "Daily email briefing" cmd.prompt # "Summarize my important..." cmd.tools # ["Gmail.search_emails", "WebFetch"] # Filter tools for command filtered = cmd.filter_tools(all_tools) # List all available commands commands = SlashCommand.list_all() for cmd in commands: print(f"/{cmd.name} - {cmd.description}")

Star us on GitHub

If ConnectOnion saves you time, a ⭐ goes a long way — and earns you a coffee chat with our founder.