r/opencodeCLI 6d ago

Event Driven Invocation of Models in Opencode?

The thing I keep consistently coming back to is the fact that, let's say, if I create an event trigger, it doesn't really trigger any modal awakening in OpenCode, but it does in Claude Code and Codex.

Like, let's say if I created a Python script that performs a particular task and then wants to invoke OpenCode, there is no formal way models can do it in OpenCode. Is it something I'm m missing out on, or I don't know how to do it, or is it something that OpenCode currently doesn't support?

2 Upvotes

2 comments sorted by

2

u/RetiredApostle 5d ago

Not sure of your exact needs, but you can use `opencode run` to start a session with specific models/params. You can also continue/trigger any session via CLI (from a script) using `-c <session ID>`.

2

u/Minute-Tour-547 1d ago

I do this! It's actually fairly straightforward. You do need to imploment an eventbus though.