Skip to content

Conversation

@rektide
Copy link
Contributor

@rektide rektide commented Jan 9, 2026

What does this PR do?

This PR proposes a command.execute.before, which allows for plugins to perform dynamic behavior & modification of command runs, including stopping their regular execution flow.

I have opened a discussion on the discord for this as well:
https://discord.com/channels/1391832426048651334/1458986650184060978

How did you verify your code works?

I've been slow to go deep testing this, and doing so has kept me from making a PR or draft. But I saw a call to action, with Dex talking about skills and commands and even though it sort of seems un-wise / a sore topic at the moment, I wanted to share & get this out here.

I'm doing more testing now.

Bikeshed rename for symmetry

I also have a commit in here to rename command.executed to command.execute.after, which makes squares this PR with what see see for tool hooks, which have tool.execute.before / tool.execute.after. I opted to retain command.executed as a hook too, for backwards compatibility stake, but "deprecated" it. This commit is in no way loadbearing, but I appreciate the symmetry it offers!

this matches/symmetricizes command.execute with tool.execute.before / tool.execute.after

but leave command.execute.after still around, deprecated to not break things
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Hey! Your PR title New Plugin Hook: command.execute.before`` doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

The following comment was made by an LLM, it may be inaccurate:

Found potential duplicate:

This PR appears to be directly related or potentially a duplicate. It specifically mentions implementing the command.execute.before hook, which is the exact same feature being proposed in PR #7400. This earlier PR likely already addresses the same functionality.

@rektide rektide changed the title New Plugin Hook: command.execute.before feat: new plugin hook, command.execute.before Jan 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@rektide rektide changed the title feat: new plugin hook, command.execute.before feat(opencode): new plugin hook, command.execute.before Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant