feat: add V1 slash commands (list, get, logs, delete)#10
Open
tsaiggo wants to merge 5 commits intodifferent-ai:mainfrom
Open
feat: add V1 slash commands (list, get, logs, delete)#10tsaiggo wants to merge 5 commits intodifferent-ai:mainfrom
tsaiggo wants to merge 5 commits intodifferent-ai:mainfrom
Conversation
- Add src/commands.ts with 4 command templates (list, get, logs, delete) - Add src/commands.test.ts with 9 tests covering command keys, templates, safety - applySchedulerCommands() mutates config.command to inject commands
- Import applySchedulerCommands from ./commands - Add async config(input) hook to plugin return object - Commands injected at plugin load time via config mutation
- Add Slash Commands section with 4 commands in table format - Include autocomplete usage instructions - Chinese descriptions matching src/commands.ts definitions
Author
|
Ref #8 |
Author
|
Hi @benjaminshafii, can you review this PR and leave any comments, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 4 slash commands to the opencode-scheduler plugin, enabling users to interact with scheduled jobs directly via
/scheduler-*commands instead of remembering tool names and argument formats.Why
Currently, users must rely on natural language prompts or know the exact tool names (
list_jobs,get_job, etc.) to manage scheduled jobs. Slash commands provide a discoverable, autocomplete-friendly interface that reduces friction.Commands
/scheduler-listlist_jobs/scheduler-getget_job/scheduler-logsjob_logs/scheduler-deletedelete_jobHow It Works
confighook, which injects command templates intoConfig.commandat plugin load time.$ARGUMENTSplaceholder — OpenCode replaces this with user input and sends it to the LLM, which then calls the corresponding existing tool.Scope (V1)
This is intentionally scoped to read-only + delete operations only. Commands like
schedule,run,update, andcleanupare deferred to a future version.Backward Compatibility
confighook preserves any pre-existing commands via object spread.Testing
delete),$ARGUMENTSplaceholders, config mutation, existing command preservationFiles Changed
src/commands.tsapplySchedulerCommands()src/commands.test.tssrc/index.tsREADME.mdpackage.json