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 #11065
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Issue Description
Problem
Plugins cannot inject environment variables into bash commands. There are a number of current feature requests which could be done with plugins if that was allowed, and it's a cheap / low risk fix.
Use Case
I want to build a plugin that sets AGENT_MODE=primary|secondary and AGENT_ID=<session_id> on all bash commands. This allows tracking whether commands run in the main agent or subagent sessions, as well as letting me keep track of some state in an external tool.
Currently, the only workaround is prepending VAR=value to commands, which is hacky and unreliable.
Proposed Solution
Add an optional env parameter to the bash tool that accepts a record of environment variables to set for the spawned process.
While these issues have different specific use cases, they all request the ability to set/inject environment variables for bash commands. Your proposal for an env parameter in the bash tool schema would be a general solution that could address all of these needs.
Feel free to ignore if your specific implementation is sufficiently different from these existing requests.
I love it how this closes it but when you open a new one you have to promise it hasn't been suggested before... but it has been, it was just automatically closed
Activity
github-actions commentedon Jan 29, 2026
This issue might be a duplicate of existing issues. Please check:
While these issues have different specific use cases, they all request the ability to set/inject environment variables for bash commands. Your proposal for an
envparameter in the bash tool schema would be a general solution that could address all of these needs.Feel free to ignore if your specific implementation is sufficiently different from these existing requests.
github-actions commentedon Mar 30, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
taxilian commentedon Apr 9, 2026
I love it how this closes it but when you open a new one you have to promise it hasn't been suggested before... but it has been, it was just automatically closed
Mart-Bogdan commentedon Sep 13, 2026
DAMN! This is really needed feature!