Loading...
Loading...
Use when writing shell scripts, automation, build tools, file processing, or ad-hoc CLI tasks with Google's zx library. Covers command execution, process control, file operations, and scripting patterns.
npx skill4agent add damusix/skills google-zx-scriptingzx.mjs#!/usr/bin/env npx zx
import { $, fs, path, glob, chalk } from 'zx/core';
const files = await glob('src/**/*.ts');
await $`eslint ${files}`;chmod +x script.mjs && ./script.mjs
# or
npx zx script.mjszx/corezx/corezx$`...`$`echo ${userInput}`$`echo "${userInput}"`$`cmd ${arrayOfArgs}`ProcessOutputnothrow.nothrow()grepwithin()within()$.cwd$.env.pipe()$`cmd1`.pipe($`cmd2`)glob()findfscatcpmvfetch()curlcd()cd()$.cwdwithin()$({cwd: '/path'}).mjs.mjsawait| Need | File |
|---|---|
| |
| Ad-hoc scripts, CLI tools, build scripts, deployment, project scaffolding | |
| File processing, data pipelines, batch ops, AI scripts, log analysis | |
references/scripting-patterns.mdreferences/scripting-patterns.mdreferences/processing-recipes.md$references/core-api.md// Core — always start here
import { $, fs, path, glob, chalk } from 'zx/core';
// Additional utilities (import individually as needed)
import { spinner, retry, question, echo, sleep, within,
stdin, tmpdir, tmpfile, which, ps, kill,
quote, YAML, argv, fetch } from 'zx/core';#!/usr/bin/env npx zx$.nothrowchalkspinner()argvminimisttmpdir()tmpfile()Promise.all()within()