Skip to content

Conversation

@robotdad
Copy link
Member

Summary

Adds support for extensible custom slash commands in the interactive CLI, enabling users to define reusable prompt templates as /commands.

Changes

Core Integration (main.py)

  • CommandProcessor now loads custom commands from slash_command tool at startup
  • Custom commands appear in /help under "Custom Commands:" section
  • /reload-commands built-in command to refresh commands without restart
  • Template execution returns substituted prompt to REPL for LLM processing

Behavior Composition (config.py)

  • New _build_cli_behaviors() consolidates CLI-specific behaviors
  • Always composes slash-command behavior for interactive sessions
  • Refactored notification behaviors to be called from new function

Documentation (README.md)

  • Quick start guide for creating custom commands
  • Command locations and precedence rules
  • Template syntax documentation

How It Works

  1. Users create .md files in .amplifier/commands/ or ~/.amplifier/commands/
  2. Files define prompt templates with $ARGUMENTS, $1, $2, etc.
  3. Typing /commandname args substitutes and executes the template

Example

<!-- ~/.amplifier/commands/review.md -->
---
name: review
description: Code review for a file
---
Review this file for bugs, security issues, and improvements: $ARGUMENTS

Usage: /review src/auth.py

Dependencies

Testing

  • Shadow environment validation confirmed feature branch structure
  • Existing unit tests pass

🤖 Generated with Amplifier

Co-Authored-By: Amplifier 240397093+microsoft-amplifier@users.noreply.github.com

robotdad and others added 4 commits January 13, 2026 14:37
Integrate with slash_command module to support user-defined commands:

- CommandProcessor now loads custom commands from slash_command tool
- Custom commands appear in /help alongside built-in commands
- Add /reload-commands to refresh commands from disk
- Custom command templates are substituted and executed as prompts

Commands are discovered from:
- .amplifier/commands/ (project-level)
- ~/.amplifier/commands/ (user-level)

Requires: robotdad/amplifier-module-tool-slash-command
Fixes 'No module named pygments.lexers.markup' error.
The markup lexers module requires Pygments 2.12+.
Documents:
- Quick start for creating custom commands
- Command locations and precedence
- Template syntax (, , {{default}})
- Built-in commands (/help, /reload-commands)
- Link to full documentation
Adds slash-command behavior to CLI's compose_behaviors, enabling
extensible /commands for interactive sessions.

Changes:
- Add _build_cli_behaviors() to consolidate CLI-specific behaviors
- Always compose slash-command behavior for interactive CLI
- Refactor to call _build_notification_behaviors() from new function

The slash_command tool is now automatically available, providing:
- Custom commands from .amplifier/commands/ (project) and ~/.amplifier/commands/ (user)
- Template substitution with $ARGUMENTS, $1, $2, etc.
- Integration with existing CommandProcessor in main.py

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant