ENVML(1)

πŸ“¦
version 5.7.0 Β· 4 versions
, in arch rolling, centos-stream 10

πŸ’… ENVML(1) β€” the envml page, but make it make sense πŸŽ€

okay bestie, welcome to page one of Modules (like, section 1 of the manual, we're fancy like that) and honestly this one's a little gem. let's get into it ✨


🌸 NAME 🌸

envml β€” run a command inside an environment that Modules set up for u 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

envml [MODULE_ACTION]... [--] COMMAND [ARG]...

like, module actions first, then ur actual command. simple. iconic. periodt πŸ’…


πŸ’– DESCRIPTION πŸ’–

so the envml command configures the environment using whatever Environment Modules actions u give it, and then runs the given command. that's the whole vibe.

it's literally made for running a command in a modified environment without permanently altering ur current shell session. no cap, ur shell stays untouched. main character energy for the command, nothing for ur session 😌

and here's how it decides stuff: envml interprets its first arguments as module actions, then switches over to command execution after either hitting -- or determining that the remaining arguments form the actual command to run. like a vibe check, but for argv.


✨ MODULE_ACTION FORMAT ✨

each module action argument can be one of these forms, ok? one bullet each, no skipping:

  • purge β€” unload all currently loaded modulefiles. all of them. bye πŸ‘‹
  • restore[=coll] β€” restore the module environment from the named collection coll. if u don't give a name, it restores the default collection. defaults slay.
  • unload=mod1[&mod2...] β€” unload one or more specified modulefiles.
  • switch=mod1&mod2 β€” unload mod1 and load mod2. a swap. a glow-up πŸ”
  • [load=]mod1[&mod2...] β€” load one or more specified modulefiles. and guess what, load= can be omitted entirely. lowkey convenient.

multiple MODULE_ACTIONs can be passed in a single argument using the colon (:) separator. and the ampersand (&) is what u use to specify multiple modules in a single action. : between actions, & between modules. that's the whole alphabet soup, iykyk πŸ“


πŸ”₯ COMMAND EXECUTION πŸ”₯

everything following the -- separator is treated as the command to execute in the modified environment. everything. no exceptions.

and if no -- separator is provided? envml assumes the first argument is a MODULE_ACTION and the remaining arguments form the command to execute. so like, it's guessing a little, which is why -- is ur bestie πŸ’œ


πŸŽ€ OPTIONS πŸŽ€

  • --help, -h β€” display usage information and exit. that's it. that's the only option. she's minimal πŸ’…

⭐ EXAMPLES ⭐

restore the default module collection, then run command arg1 arg2:

envml restore command arg1 arg2

purge all modules, then load mod1 and mod2, and run the command:

envml purge:mod1:mod2 command arg1 arg2

use the -- separator to avoid ambiguity (highkey recommended):

envml restore load=mod1&mod2 -- command arg1 arg2

πŸ’€ EXIT STATUS πŸ’€

the envml command returns the exit status of the executed command, or 1 if a module action fails. so if ur command's fine, u get its status. if the module action flops, u get 1. not me getting a 1 😭


πŸ™ˆ DIAGNOSTICS πŸ™ˆ

if the module command is not available in the shell (i.e., it's not a shell function), envml will print an error and exit. so like, make sure module actually exists as a shell function first, bestie. otherwise it's over before it started 🧚


🌈 SEE ALSO 🌈

module <#module-1>, modulecmd <#modulecmd-1>, ml <#ml-1>, modulefile <#modulefile-5> β€” go read ur siblings, they're all slaying in their own ways πŸ‘‘


1996-2026, Modules Contributors β€” legends, fr fr 🫢


okay that's the whole page!! written by the Modules Contributors, version 5.7.0, dated 2026-09-21, and that's on ENVML(1). go run something in a modified environment, u got this πŸ’–βœ¨

πŸ“¦ where this page comes from