You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(bash): add env parameter for setting environment variables #21753
I have verified that this issue has not already been suggested
Enhanced Capability Request
Description
Allow plugins to inject arbitrary environment variables into bash commands.
Use Case
My use case is in a plugin I use I can inject env vars (like AGENT_MODE, AGENT_ID) into bash commands via an optional env parameter on the bash tool. There are many plugins which want to do things like this, this would let any of them do it without requiring weird hacks or special extra features added to opencode.
This would allow a plugin to address #9292 and #15739, among others.
Other
Current Status
This capability is still needed. Current workarounds are causing issues and do not scale well.
The current workaround is to modify the command whenever a bash command is made and add the variable into the command; this can interfere with other features, though, and I've seen the agent get confused by it and start adding additional unneeded variables in for other commands, somehow thinking that it was needed. On three occasions I've seen the agent get confused and start using bad bash syntax as well.
Activity
github-actions commentedon Apr 9, 2026
This issue might be a duplicate of existing issues. Please check:
envparameter to the bash tool so plugins can inject environment variables (same author, same use case withAGENT_MODE/AGENT_ID)Please review those issues before proceeding, as this appears to be a re-submission of #11065.
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.