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
This discussion summarizes the archived GitHub issue #1448 about executing arbitrary scripts to export environment variables.
Original Issue
Title:env._.run
Description:
Similar to issue #1447, the request was to make it possible to execute arbitrary scripts which "export" environment variables using a syntax like:
[env]
_.run = "./myscript"
Unlike #1447, this would run like any other binary and somehow pull env vars out of it. The issue mentioned that direnv has a trick where they launch direnv inside of the script to pull the env vars out.
Key Discussion Points
Use Cases:
Loading env vars from 1Password
Running docker compose up automatically when entering project directories
Executing scripts on directory change
Single atomic commands for environment setup
Implementation: The feature was implemented through the hooks system in mise, which allows running scripts and sourcing their output to modify the environment.
Alternative Solution - Templating: One user noted that mise's templating system can achieve similar results:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
🤖 AI-Generated Summary of Archived Issue
This discussion summarizes the archived GitHub issue #1448 about executing arbitrary scripts to export environment variables.
Original Issue
Title:
env._.runDescription:
Similar to issue #1447, the request was to make it possible to execute arbitrary scripts which "export" environment variables using a syntax like:
Unlike #1447, this would run like any other binary and somehow pull env vars out of it. The issue mentioned that direnv has a trick where they launch direnv inside of the script to pull the env vars out.
Key Discussion Points
Use Cases:
docker compose upautomatically when entering project directoriesImplementation: The feature was implemented through the hooks system in mise, which allows running scripts and sourcing their output to modify the environment.
Alternative Solution - Templating: One user noted that mise's templating system can achieve similar results:
This works with password managers like Bitwarden CLI as well.
PATH Modification Issue: Some users reported difficulty adding to PATH using hooks, with
MISE_ADD_PATHnot working as expected in hook scripts.Resolution
The feature was implemented through mise's hooks system. Users can now:
exec()for inline command executionSee: https://mise.jdx.dev/hooks.html
Related Documentation
This is an archived issue summary. Issues have been disabled in favor of GitHub Discussions for better community engagement.
Beta Was this translation helpful? Give feedback.
All reactions