-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feature Request: Support for Custom Commands #409
Labels
Comments
/bounty $100 |
💎 $100 bounty • Tailcall Inc.Steps to solve:
🙏 Thank you for contributing to antinomyhq/forge!
|
💡 @onyedikachi-david submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
amitksingh1490
added a commit
that referenced
this issue
Mar 13, 2025
- Add Command::Dispatch variant for '/dispatch-event_name value' format - Update command parsing to recognize and extract event names and values - Add dispatch method to API trait and implement in ForgeAPI - Update UI to handle dispatch commands - Add tests for verifying dispatch command parsing - Add documentation for feature in CUSTOM_COMMANDS.md
amitksingh1490
added a commit
that referenced
this issue
Mar 13, 2025
amitksingh1490
added a commit
that referenced
this issue
Mar 13, 2025
amitksingh1490
added a commit
that referenced
this issue
Mar 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request: Support for Custom Commands
Overview
Currently, Code-Forge supports built-in commands like
/new
and/info
. This feature request proposes extending the command system to support a standardized format for custom commands that can trigger custom event handling.For example:
/dispatch-gh-issue Create an issue to update the version of tokio
would fire an event with name "gh-issue" and value "Create an issue to update the version of tokio", which could then trigger custom handling.Background
Built-in commands are currently handled through the
Command
enum and parsed in theCommand::parse
method. We need to extend this to support custom commands with a consistent interface using the/dispatch-event_name value
format.User Experience
Users would be able to:
/dispatch-gh-issue Update tokio version
in the consoleCommand Format Specification
Format:
/dispatch-event_name value
/dispatch-
up to the first space (or end of string) is the event nameEvent Name Requirements:
Event Value Behavior:
Examples:
/dispatch-gh-issue Create new issue
→ name: "gh-issue", value: "Create new issue"/dispatch-notify
→ name: "notify", value: "" (empty)/dispatch-log-error Error message with spaces
→ name: "log-error", value: "Error message with spaces" (spaces preserved)Proposed Implementation Changes
API Layer Changes
dispatch
method to theAPI
trait to handle custom command eventsForgeAPI
to properly handle dispatch eventsCommand System Changes
Update the
Command
enum with a newDispatch
variant that includes:name
: The event name portionvalue
: The event value portionEnhance the command parser to recognize the
/dispatch-
prefix and properly extract the event name and valueOrchestrator Changes
Main Application Flow Changes
Dispatch
command variantdispatch
API method to process these commandsFiles to Modify
crates/forge_api/src/lib.rs
- Add thedispatch
method to theAPI
traitcrates/forge_api/src/api.rs
- Implement thedispatch
method inForgeAPI
crates/forge_main/src/model.rs
- Update theCommand
enum andparse
methodcrates/forge_main/src/main.rs
(or wherever the main loop is) - Update to handle dispatch commandscrates/forge_domain/src/dispatch_event.rs
- Potentially enhance to make custom event handling more robustRust Best Practices
anyhow::Result
Considerations
Suggested Implementation Timeline
API::dispatch
method and implement it inForgeAPI
Command
enum with the newDispatch
variantEncouragement
When implementing this feature, consider using Code-Forge itself! The codebase is well structured for iterative development, and you can use Code-Forge to:
Additional Ideas for Future
The text was updated successfully, but these errors were encountered: