Skip to content

Hooks for commands (Plugin Commands) #2185

Closed

Description

@samholmes

There should be hooks for commands. Hooks to capture the command before it's given to the LLM and after.

This way, plugin developers can utilize commands for controlling their plugin.

It would also be nice if a plugin can define commands instead of requiring commands to be always in the commands directory as a markdown file.

Activity

  1. github-actions commented on Aug 22, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • Hooks support? #1473: Hooks support? - discusses adding hooks for automation, specifically wanting hooks after task completion for CI/CD workflows
    • [feat] lifecycle hooks #573: [feat] lifecycle hooks - proposes comprehensive lifecycle hooks including PreToolUse, PostToolUse, and other events similar to Claude Code's hook system
    • Hooks #1219: Hooks - detailed discussion about bringing Claude Code's hook functionality to opencode, with specific examples of hook types and use cases
    • [feat] custom slash commands #299: [feat] custom slash commands - requests ability to create custom commands as markdown files, which overlaps with your request for plugins to define commands
    • feature request: "agent.finished" plugin event #2021: feature request: "agent.finished" plugin event - specifically requests a plugin event when the agent finishes, complementing your command hook request

    Feel free to ignore if none of these address your specific case.

  2. changed the title [-]Hooks for commands[/-] [+]Hooks for commands (Plugin Commands)[/+] on Aug 22, 2025
  3. thdxr commented on Aug 22, 2025

    @thdxr
    Member

    yep will look into this btw plugins can now hook the config function and override it. so you can insert your own custom commands

  4. cavanaug commented on Sep 13, 2025

    @cavanaug

    Fwiw. I think an interop plugin that supports the exact same Claude code hooks would go a long way in bringing folks to opencode. Many folks write automations/agents for Claude and this would give them an opportunity to leverage those within opencode. Interop/compatibility is the bridge to migration.

  5. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions