Slash Commands

Copair includes built-in slash commands for common actions and supports user-defined custom commands with prompt templates.

Built-in Commands

CommandDescription
/helpShow available commands and usage hints
/model [name]Switch to a different AI model mid-session
/clearClear the current conversation history
/costShow token usage and estimated cost for the session
/exitEnd the session
/session listList all sessions for the current project
/session resume [id]Resume a previous session
/session rename <name>Rename the current session
/session delete <id>Delete a stored session
/session saveForce a mid-session save/snapshot
/session infoShow current session details (identifier, messages, tokens)
/workflow <name>Run a named workflow
/commandsList all custom commands from ~/.copair/commands/ and .copair/commands/

Tab Completion

Press Tab to auto-complete:

  • Commands: /ses + Tab → /session
  • Subarguments: /session re + Tab → /session resume
  • File paths: relative to your working directory
  • Model names: from your configured providers
  • Session identifiers: for /session resume

Press Tab twice to see all available completions.

Custom Commands

Define reusable commands with prompt templates that automate repetitive tasks.

Defining Commands

Create markdown files with YAML frontmatter in your project or global config directory:

<!-- .copair/commands/review.md -->
---
name: review
description: Code review the current changes
args:
  - name: focus
    description: "Area to focus on: security, performance, style, or general"
    default: general
---

Review the git diff for the current branch against main.
Focus area: {{focus}}

Check for:
- Logic errors and edge cases
- Security concerns
- Performance implications

Provide specific, actionable feedback.

Variable Interpolation

Use {{variable}} placeholders in the markdown body. Variables come from the args defined in the frontmatter:

<!-- .copair/commands/test.md -->
---
name: test
description: Run tests for a specific file
args:
  - name: file
    description: Path to the file to test
    required: true
---

Run the tests for {{file}} and fix any failures.
After fixing, run the tests again to confirm they pass.

Usage:

> /test file=src/auth.ts

Additional built-in variables: {{env.VAR_NAME}}, {{model}}, {{cwd}}, {{branch}}.

Discovery

All commands — built-in and custom — are discoverable via /help and tab completion. Custom commands appear alongside built-in ones in the command list.

Next Steps

Last updated May 12, 2026