GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(plugin commands): allows for code execution on plugin registered slash commands by spoons-and-mirrors · Pull Request #4411 · anomalyco/opencode

Conversation

@spoons-and-mirrors

@spoons-and-mirrors spoons-and-mirrors commented Nov 17, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR adds a powerful new plugin hook to opencode making it possible to run plugins through custom /commands registered by the plugin itself allowing for code execution

needs sdk rebuild to test

cd packages/sdk/js
bun run script/build.ts

As a proof of concept, this PR allowed me to create a plugin with a "/prune" command that prunes all tool outputs from the session

This could also allow to turn a plugin on/off, create composable workflows and many more things i'm sure

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Tarquinen, shamilhaqeem, Mishkun, towry, nielpattin, ariane-emory, djismgaming, and cyypherus reacted with thumbs up emoji einarpersson, arsham, Tarquinen, stevoland, shuv1337, nielpattin, dev-abhirup-sc, ariane-emory, and djismgaming reacted with heart emoji
All reactions
  • 👍 8 reactions
  • ❤️ 9 reactions
@spoons-and-mirrors
spoons-and-mirrors force-pushed the feat/plugin-command branch from 6d58bf1 to 840e61b Compare November 17, 2025 22:48
@einarpersson

einarpersson commented Nov 20, 2025

Copy link
Copy Markdown

YES! I was just about to do this feature request. I reaaaaally hope this get merged!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@riatzukiza riatzukiza mentioned this pull request Nov 20, 2025
Feature: richer Codex metrics and request inspection commands open-hax/codex#6
Closed
@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f1dc981 to 3e15a39 Compare November 22, 2025 18:07
@thdxr
thdxr force-pushed the dev branch from 3e15a39 to a0831ea Compare November 22, 2025 18:11
@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f8ee907 to 6a9856d Compare November 27, 2025 01:29
This was referenced Nov 28, 2025
[FEATURE]: droid-like custom slash commands in arbitrary languages using shebang lines #4839
Closed
feat: configurable compaction #4149
Closed
@Tarquinen Tarquinen mentioned this pull request Dec 1, 2025
Feature request: Option to choose the model and manual trigger of pruning Tarquinen/opencode-dynamic-context-pruning#3
Closed
@rekram1-node
rekram1-node force-pushed the dev branch from 398b39a to 5013d64 Compare December 5, 2025 05:13
@spoons-and-mirrors
spoons-and-mirrors force-pushed the feat/plugin-command branch from 840e61b to 63696ee Compare December 14, 2025 14:01
@shuv1337 shuv1337 mentioned this pull request Dec 15, 2025
feat: Integrate plugin commands from upstream PR #4411 shuv1337/shuvcode#132
Closed
14 tasks
@spoons-and-mirrors
spoons-and-mirrors force-pushed the feat/plugin-command branch from 74e3d5e to ae96976 Compare December 15, 2025 18:35
@spoons-and-mirrors spoons-and-mirrors mentioned this pull request Dec 16, 2025
plugin(hook): add task tool execution hooks and command context tracking #5642
Merged
@spoons-and-mirrors
spoons-and-mirrors force-pushed the feat/plugin-command branch from ae96976 to a0f2d19 Compare December 17, 2025 22:35
@spoons-and-mirrors
spoons-and-mirrors marked this pull request as draft December 17, 2025 22:57
spoons-and-mirrors added 2 commits December 18, 2025 01:02
@spoons-and-mirrors
feat(plugin): add command registering to use plugins through slash co…
6442833
…mmands
@spoons-and-mirrors
sdk
b5511f7
@spoons-and-mirrors
spoons-and-mirrors force-pushed the feat/plugin-command branch from 7a00b05 to b5511f7 Compare December 18, 2025 00:21
@rekram1-node rekram1-node mentioned this pull request Dec 18, 2025
[FEATURE]: Plugin Hook for Instant TUI Commands #5305
Closed
1 task done
@spoons-and-mirrors
add support for drop-in of a single command file in command/ folder
dc57ca2
@spoons-and-mirrors

spoons-and-mirrors commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

Added support for command drop-in in command/ folder as suggested by #5305

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

spoons-and-mirrors added 2 commits December 19, 2025 02:13
@spoons-and-mirrors
bug fix: plugin command receive arguments + explicit typing + docs up…
6be99dc
…date
@spoons-and-mirrors
docs fix
abd91db
@spoons-and-mirrors
spoons-and-mirrors marked this pull request as ready for review December 19, 2025 02:10
@malhashemi

malhashemi commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

Hi @spoons-and-mirrors Thanks for making that happen, seems that a few cleanups still needed to pass tests and solve merge conflicts. While it is really powerful to run commands directly from the TUI (I know that I suggested that myself) but the more I think about it a better approach could be to run these server side. This way these slash commands can be triggered from any client (including the new desktop client) what are you thoughts here? Could need more work to make that happen

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spoons-and-mirrors

spoons-and-mirrors commented Dec 21, 2025

Copy link
Copy Markdown
Contributor Author

hey @malhashemi, this implementation does run server side. The TUI just wraps around it calling sdk.client.session.command().

as for the merge conflicts, they happen quite alot in this repo heh, I will get to it at some point.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@malhashemi

malhashemi commented Dec 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@spoons-and-mirrors a question that just came to mind, would this work with desktop or any custom WebUI like CodeNomad, not that I use any of these, but was just thinking about how would this register. Could be already working there but would be nice to verify if you are doing any manual testing. additionally does it support sending arguments? something like /command "arg1" "arg2" etc. Finally how far away are we from a merge-able state haha

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spoons-and-mirrors

spoons-and-mirrors commented Dec 24, 2025

Copy link
Copy Markdown
Contributor Author

Yes to both. Can work with other clients, passes args

malhashemi reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@malhashemi

malhashemi commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

@spoons-and-mirrors how are we looking with this one? if you are too busy I'd be happy to help if you grant write access

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rektide

rektide commented Jan 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I have a somewhat less invasive alternative, that allows plugins to hook a command.execute.before to modify commands: #7400.

If they want to do something, they are free to react as they please, and they can add a stop property to prevent execution from continuing.

Usage is a little weirder, as the plugin still has to register a custom command normally, even if it only intends to handle the actual command itself & not inject it into the session.

Very interested to see something afforded to plugin devs, however this goes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spoons-and-mirrors

spoons-and-mirrors commented Jan 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

yeah that's a valid point command.execute.before could be just enough... I have it in this PR also #6478

I think you're right tho, this approach is overkill and probably more invasive than it needs, Aiden had some reservations about it as well, shuv also had a go at implementing this but went with an invasive way too if I remember correctly

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Jan 10, 2026
feat(opencode) plugin commands #7563
Closed
@ariane-emory

ariane-emory commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Yes, please! Me want, gimme!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spoons-and-mirrors

spoons-and-mirrors commented Jan 18, 2026

Copy link
Copy Markdown
Contributor Author

all the pieces are already in opencode to do this now, with the latest addition being #9267
closing the PR

DanielusG reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@spoons-and-mirrors spoons-and-mirrors closed this Jan 18, 2026
@graoke graoke mentioned this pull request May 19, 2026
[FEATURE]:Allow plugins to intercept slash commands and return results directly (skip LLM), plus register custom dialogs #28292
Closed
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@spoons-and-mirrors @einarpersson @malhashemi @rektide @ariane-emory
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.