Skip to content

leonsilicon/cli-specs

Repository files navigation

cli-specs

cli-specs is a utility for defining CLI executables that should be called from JavaScript.

Usage

Install cli-specs using your favorite package manager:

npm install cli-specs

Then, import and use cli-specs in your project like in the following example:

import { defineCliExecutable } from 'cli-specs'
import { outdent } from 'outdent'

const git = defineCliExecutable({
  executableName: 'git',
  executablePath: '/usr/bin/git',
  description: outdent`
    \`git\` is the version control system that is needed
    for development.
  `,
  defaultExecaOptions: {
    stdout: 'inherit',
    stderr: 'inherit'
  }
})

await git(['add', '.'])

About

CLIs in JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published