This package provides a set of reusable utilities and wrappers for working with CLI commands and processes in Node.js and TypeScript projects. It's designed to help you build robust, scriptable command-line tools and automate system tasks, with a focus on composability and reliability.
You can install the package via npm:
npm install @ac-essentials/cli
Or via yarn:
yarn add @ac-essentials/cli
Here's a categorized summary of the main utilities available in this package (see source for full details):
buildx/buildx-build
: Run Docker Buildx builds programmatically with tag support.container/container-rm
: Remove one or more Docker containers by name or ID, with options for force, link, and volumes.container/container-run
: Run a Docker container with advanced options (env, ports, name, detach, etc.).context/context-show
: Show the current Docker context.context/context-use
: Switch the active Docker context.image/image-rm
: Remove one or more Docker images by ID, with options for force and no-prune.types
: Type aliases for Docker container identifiers.status-v1
: Get the status of a Git repository in porcelain v1 format, with support for ignored files and custom exec options.ps
: List and filter running processes using the ps
command, with rich filtering and field selection.You can import and use the utilities in your project as follows:
import { docker, exec } from '@ac-essentials/cli';
await docker.run(['build', '.']);
const { stdout } = await exec('ls -la');
console.log(stdout);
For more detailed documentation and examples, please refer to the official documentation.
Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository.