@sixty-nine/cli-tools
v1.0.1
Published
A reusable TypeScript library for CLI tools.
Readme
@sixty-nine/cli-tools
Description
A opinionated reusable TypeScript library for CLI tools.
Installation
You can install this package using yarn or npm:
yarn add @sixty-nine/cli-tools
# or
npm install @sixty-nine/cli-toolsUsage
This library provides a set of utilities to build command-line interfaces. Here's how to use it:
import useCli from '@sixty-nine/cli-tools';
const cli = useCli();
cli.title('My Awesome CLI Tool');
cli.subtitle('A list of items');
cli.list(['item 1', 'item 2', 'item 3'], (s) => chalk.white(s));
cli.subtitle('A table of data');
const headers = ['Name', 'Age', 'City'].map((s) => chalk.yellow(s));
const rows = [
['John Doe', 30, 'New York'],
['Jane Doe', 25, 'London'],
];
cli.table(headers, rows);
cli.error('Something went wrong!');Development
To set up the development environment, build, lint, and format the code, use the following commands:
Install dependencies:
yarn installBuild the project:
yarn buildLint the code:
yarn lintFormat the code:
yarn format
Contributing
Contributions are welcome! Please follow the existing code style and ensure your changes pass linting and formatting checks.
License
This project is licensed under the MIT License.
