Skip to content

Shell

zx is not aimed to replace the shell, but to provide a more convenient way to use it through JavaScript enhancements. It supplements the shell with a more powerful and expressive language, so some kind of bash/zsh is still required.

zx provides several functions to help with setup:

You can also set the shell directly via JS API, CLI flags or envars:

js
$.shell = '/bin/zsh'
bash
zx --shell /bin/zsh script.js
bash
ZX_SHELL=/bin/zsh zx script.js

Disclaimer: This is not an officially supported Google product.