LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

zx

JavaScript toolchain for writing shell scripts

TLDR

Run a zx script file
$ zx [script.mjs]
copy
Run inline with npx
$ npx zx [script.mjs]
copy
Install the package
$ npm install -g zx
copy
Example script header and command execution:
$ #!/usr/bin/env zx
await $`git status`
const branch = await $`git branch --show-current`
copy

SYNOPSIS

zx [*options*] *script*

DESCRIPTION

zx (from Google) makes writing complex shell scripts in JavaScript pleasant. It wraps Node's child_process with the $`cmd` tagged template for safe argument escaping, sensible defaults, and cross-platform behavior. Scripts can use async/await, Promise.all for parallel tasks, and the usual npm ecosystem.Works with Node.js, Bun, Deno, and similar runtimes. Documentation and setup variants (including a lite build) are at https://google.github.io/zx/.

PARAMETERS

*script*

Path to a .mjs/.js (or TypeScript when supported) script. Often starts with #!/usr/bin/env zx.
-h, --help / --version
Help and version (see zx --help for the installed CLI flags).
Inside scripts, the primary API is $`command` plus helpers documented upstream (cd, fetch, question, sleep, nothrow, etc.).

INSTALL

brew install zx
copy
nix profile install nixpkgs#zx
copy

CAVEATS

Not an officially supported Google product. Requires a JS runtime on PATH. Prefer quoting/escaping via $ templates rather than string concatenation to avoid injection. Behavior of the host shell still matters for complex pipelines.

SEE ALSO

node(1), bash(1), npm(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid