Vibeleaderboard
Index / tool
Visit google.github.io
Category
Developer Tools
Rank
Pricing
Open Source
Type
TOOL
Builder
google
Latest release
8.8.5
Date

About

Google's JavaScript scripting tool with $`shell` template literals, top-level await, and fetch — a friendlier alternative to Bash for Node.js developers.

What it does

zx turns JavaScript or TypeScript into a practical shell scripting environment. It runs commands through an available shell, safely quotes interpolated arguments, captures process results, and supplies helpers for files, prompts, retries, temporary data, and network requests.

Why it's ranked here

It is a strong choice when shell scripts have outgrown simple command chains. Structured language features, typed package exports, configurable process execution, and automatic argument quoting address common scripting pain without hiding the underlying shell.

What's good

Interpolated values are quoted for the active shell, reducing accidental command parsing. Commands return rich promise-like results with captured output, exit status, signals, timing, piping, timeouts, and abort support. Scripts can also run from standard input, remote URLs, or Markdown code fences.

Tradeoffs

It still requires Bash or PowerShell, so portability depends on the selected shell and installed commands. Remote script execution and optional dependency installation expand the trust boundary. Global injection is convenient but makes dependencies less explicit, while process behavior offers enough options to require careful defaults.

How to use it well

Use zx for deployment scripts, repository automation, and command orchestration when the team already works comfortably in JavaScript or TypeScript. Prefer explicit imports for reusable modules and globals for short scripts. It does not replace the shell, provide missing system commands, or serve as a general workflow scheduler.

Technical notes+

package.json defines an ESM package with CommonJS, ESM, declaration, CLI, globals, and core export surfaces. src/cli.ts parses flags, loads environment files, accepts files, stdin, HTTP URLs, evaluation strings, and Markdown, then imports the prepared script. src/core.ts wraps child-process execution in ProcessPromise and ProcessOutput, using AsyncLocalStorage for scoped options plus configurable spawning, logging, piping, timeouts, signals, and synchronous execution. src/md.ts converts JavaScript fences directly, shell fences into awaited command templates, and other prose into comments. src/deps.ts detects imports and can install npm dependencies without saving them. src/globals.ts exposes the package API through globalThis.

Observed

License
Apache-2.0
Primary language
TypeScript source compiled for JavaScript runtimes
Install surface
Published as the npm package zx and installed with npm
Interfaces
Command-line executable and importable library
Module formats
ESM and CommonJS exports with TypeScript declarations
Platform support
Linux, macOS, and Windows
Runtime support
Node.js, Bun, Deno, and GraalVM Node.js
Shell requirement
Requires Bash or PowerShell

Read from README.md, package.json, src/cli.ts, src/index.ts, src/md.ts, src/log.ts, src/core.ts, src/deps.ts, src/repl.ts, src/util.ts, src/error.ts, src/goods.ts, src/vendor.ts, src/globals.ts, src/versions.ts.

What it can do

  • Execute shell commands with template literals

    JavaScript code with $`shell command` syntaxCommand execution results

  • Run asynchronous operations at top level

    JavaScript code with await statements outside functionsResolved promise values

  • Make HTTP requests

    URLs and request parametersHTTP response data

  • Process command output with JavaScript

    Shell command results and JavaScript processing logicTransformed or filtered data

  • Create cross-platform shell scripts

    JavaScript code using zx utilitiesExecutable scripts that work across operating systems

  • Chain multiple shell commands

    Sequence of shell commands in JavaScript syntaxCombined command execution results

Tags

scriptingbashnodejscligoogle

Tech Stack

Node.jsTypeScript

Media

zx

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.