Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikemimik/cli
WIP: Core boilerplate for cli projects
https://github.com/mikemimik/cli
Last synced: 26 days ago
JSON representation
WIP: Core boilerplate for cli projects
- Host: GitHub
- URL: https://github.com/mikemimik/cli
- Owner: mikemimik
- License: mit
- Created: 2019-11-10T19:48:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T10:47:41.000Z (about 2 years ago)
- Last Synced: 2024-10-31T03:42:18.648Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 493 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cli
Core boilerplate for cli projects## Description
This project will allow the fast iteration on other cli projects. It's meant
to be used with the [mikemimik/command](https://github.com/mikemimik/command)
project. This allows for extendable cli's to be created for whatever needs
there may be.## Installation
In your project, run the following command to get the latest version of the
module:```
npm install @mikemimik/cli@latest
```## Usage
```javascript
// index.js'use strict'
const Cli = require('@mikemimik/cli')
// NOTE: exported class of `@mikemimik/command`
const someCmd = require('./commands/some-command')const pkg = require('./package.json')
const cli = new Cli(config)
module.exports = main
function main (argv) {
const context = {
cliVersion: pkg.version
}return cli()
.command(someCmd)
.parse(argv, context)
}```
## Configuration
### new Cli(config)* `config`: configuration object with is passed into factory to generate cli function
* `config.cliName`: short name of cli, used when logging to the terminal