Use system commands on Guild runs

Guild provides a number of commands to explore runs from a terminal — e.g. guild ls, guild open, guild cat, etc. — but sometimes you just want to use system commands.

As Guild stores runs in standard file system directories, it’s easy to run any system command on run files. You have a few methods:

  • Get the run directory using guild runs info for the run in question. You can copy/paste the run directory in any commands you like. This is straight forward but a bit clumsy.

  • If you’re using a POSIX compatible shell, use command substitution with guild select and the --run-dir option. For example, to execute the find system command on the latest run directory, use:

find `guild select --run-dir`

Back-ticks cause the shell to run the select command, which prints the run directory. That value is used as the argument to find. This method lets you execute commands without copying/pasting a run directory but it relies on command substitution and requires a bit more typing.

  • Use the --shell option with guild open to open a new shell where you can run system commands. Type exit to return to your previous shell and location. This method is the fastest to change to a run directory. As your commands run in a separate shell, you can easily return to your previous location and shell environment with exit.

TLDR; A quick way to execute system commands for a run is with guild open --shell [RUN]. This opens a new shell in the specified run directory (latest run by default) where you can conveniently run system commands. When you’re run, type exit to return to your previous shell/location.