resin-cli-visuals is a JavaScript/TypeScript library providing a collection of command-line interface (CLI) widgets designed primarily for the Balena ecosystem's CLI tools. It offers components such as spinners, progress bars, interactive tables (horizontal and vertical), and a drive scanner to dynamically detect storage device changes. The current stable version is 4.0.4, released in March 2026, indicating an active development cadence with several minor and major releases in the last year. Key differentiators include its focus on CLI UX within the Balena context, offering ready-to-use visual components for common CLI interactions, and its recent migration to TypeScript and ESM, ensuring modern JavaScript practices. The library is built to enhance user interaction in console applications, making operations like long-running tasks or data display more visually intuitive.
npm install resin-cli-visualsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating a spinner, displaying data in a horizontal table, and using the DriveScanner to detect drive changes.
Update all `require()` calls to `import` statements. Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json` or `.mjs` file extension) and transpiles TypeScript if necessary.
Ensure your Node.js environment meets or exceeds the minimum version specified (>=20.0 for v4.x). Upgrade Node.js if running an older version.
Replace `new visuals.SpinnerPromise(...)` with `visuals.createSpinnerPromise(...)`.
If you directly used `chalk` via `resin-cli-visuals` exports (which is unlikely as it was an internal dependency) or had custom `chalk` setups interacting with `resin-cli-visuals`, you might need to adjust for `ansis`. Check `ansis` documentation for differences if issues arise.
Ensure `lodash` is explicitly listed as a dependency in your project's `package.json` if your code directly depends on it, rather than relying on transitive inclusion.
Change `const visuals = require('resin-cli-visuals');` to `import { visuals } from 'resin-cli-visuals';`. Ensure your `package.json` has `"type": "module"` or use `.mjs` file extensions.Replace `new visuals.SpinnerPromise(options)` with `visuals.createSpinnerPromise(options)` as it was changed to a factory function.
Check your Node.js version (`node -v`) and ensure it meets the `>=20.0` requirement for v4.x of `resin-cli-visuals`. Upgrade Node.js if needed.