# @solfege/cli

> Command Line Interface of SolfegeJS

Latest version **5.3.18** (published 2020-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @solfege/cli
pnpm add @solfege/cli
yarn add @solfege/cli
bun add @solfege/cli
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.3.18 |
| Published | 2020-07-20 |
| First published | 2018-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 5 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | neolao |
| Maintainers | neolao |

## Links

- npm: https://www.npmjs.com/package/@solfege/cli
- Repository: https://github.com/solfegejs/cli
- Homepage: https://github.com/solfegejs/cli#readme
- Issues: https://github.com/solfegejs/cli/issues
- npm.io page: https://npm.io/package/@solfege/cli

## Dependencies (5)

- [colors](https://npm.io/package/colors.md) ^1.4.0
- [minimist](https://npm.io/package/minimist.md) ^1.2
- [commander](https://npm.io/package/commander.md) 6.0.0
- [word-wrap](https://npm.io/package/word-wrap.md) ^1.2.3
- [pretty-error](https://npm.io/package/pretty-error.md) ^2.1.1

## Recent versions

- 5.3.18 (latest) — 2020-07-20
- 5.3.17 — 2020-07-17
- 5.3.16 — 2020-04-05
- 5.3.15 — 2020-04-05
- 5.3.14 — 2019-12-29
- 5.3.13 — 2019-12-29
- 5.3.10 — 2019-12-28
- 5.3.9 — 2019-12-28
- 5.3.8 — 2019-12-28
- 5.3.5 — 2019-11-16
- 5.3.4 — 2019-08-31
- 5.3.3 — 2019-08-31
- 5.3.2 — 2019-08-31
- 5.3.1 — 2019-08-31
- 5.2.1 — 2019-06-10
- … 4 more at https://npm.io/package/@solfege/cli/versions

## README

@solfege/cli
============

Command Line Interface of SolfegeJS


Installation
------------

The bundle is included by default in SolfegeJS. You don't need to install it.

See [SolfegeJS](https://github.com/solfegejs/solfege)


Available commands
------------------

In order to expore commands, you need to create a `console.js` file:

```javascript
const solfege = require("solfegejs");

// Initialize the application
let application = solfege.factory();

// Start the application
// The first 2 parameters are removed (node and the script)
application.start(process.argv.slice(2));
```


Expose a command
----------------

To expose a command, you have to create a service with a specific tag:

```yaml
services:
    my_command:
        class: "Command/MyCommand"
        tags:
            - { name: "solfege.console.command" }
```

And your class must implement 2 methods (`getName` and `execute`):

```javascript
module.exports = class MyCommand {
  getName() {
    return "my-command";
  }

  async execute(parameters, options) {
    console.log("My command executed");
  }
}
```

Now you can call your command like that:

```bash
node console.js my-command
```

Tests
-----

You need to install peer dependencies first:

```bash
npm install --no-save @solfege/application
```

Then run the following command:

```bash
npm test
```

---
_Source: https://npm.io/package/@solfege/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
