-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Add extensible custom slash command support #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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>
3a98864 to
879a005
Compare
✅ Smoke Test ValidationThis change has been validated with the amplifier-bundle-smoke-test recipe. Results
Summary: 11/11 core tests passed
🤖 Validated with Amplifier smoke-test bundle |
The CommandExecutor.execute() method is async but was being called without await, causing the coroutine object to be returned instead of the actual result. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
registry.get_command_dict() already returns keys with / prefix, so adding another / resulted in //review instead of /review. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Smoke Test Results (Post-Changes)All core functionality passed. Summary:
Multi-Provider
Summary: 12 passed, 0 failed, 2 skipped Verdict: ✅ PASS - All configured providers working correctly. Azure and Ollama skipped as expected (not configured on test machine). |
Add support for the custom slash commands directory (~/.amplifier/commands/) in the reset command: - Add "commands" to RESET_CATEGORIES mapping - Include in CATEGORY_ORDER between keys and cache - Add description for interactive UI display - Add to DEFAULT_PRESERVE set (user content preserved by default) - Update docstring and help text examples This ensures user-created custom commands are recognized by reset and protected from accidental deletion unless explicitly requested. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Refactor to follow upstream's pattern of separate behavior builder functions for each category, making future syncs easier. Before: A unified _build_cli_behaviors() function returned all CLI behaviors (modes, slash-commands, notifications) in one list. After: Separate functions following upstream's convention: - _build_modes_behaviors() - returns modes behavior URI - _build_slash_command_behaviors() - returns slash command behavior URI - _build_notification_behaviors() - already existed, unchanged The caller in resolve_bundle_config() now uses extend() calls for each function, matching upstream's architectural pattern. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Today's Changes SummaryThe following commits were added today to address issues discovered during testing and improve code organization: Bug Fixes
Features
Refactoring
Smoke Test Results
|
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)
slash_commandtool at startup/helpunder "Custom Commands:" section/reload-commandsbuilt-in command to refresh commands without restartBehavior Composition (config.py)
_build_cli_behaviors()consolidates CLI-specific behaviorsslash-commandbehavior for interactive sessionsDocumentation (README.md)
How It Works
.mdfiles in.amplifier/commands/or~/.amplifier/commands/$ARGUMENTS,$1,$2, etc./commandname argssubstitutes and executes the templateExample
Usage:
/review src/auth.pyDependencies
Testing
🤖 Generated with Amplifier
Co-Authored-By: Amplifier 240397093+microsoft-amplifier@users.noreply.github.com