# breaker

> Host

Latest version **0.1.2** (published 2015-08-18) · 0 weekly downloads

## Install

```sh
npm install breaker
pnpm add breaker
yarn add breaker
bun add breaker
```

Provides the command `breaker`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2015-08-18 |
| First published | 2013-02-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.11.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Cliffano Subagio |
| Maintainers | cliffano |
| Keywords | ssh, parallel, remote, cli, shell, script |

## Links

- npm: https://www.npmjs.com/package/breaker
- Repository: http://github.com/cliffano/breaker
- Issues: http://github.com/cliffano/breaker/issues
- npm.io page: https://npm.io/package/breaker

## Dependencies (6)

- [ssh2](https://npm.io/package/ssh2.md) ^0.4.10
- [async](https://npm.io/package/async.md) ^1.4.2
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [bagofcli](https://npm.io/package/bagofcli.md) ^0.2.3
- [fs.extra](https://npm.io/package/fs.extra.md) ^1.3.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-08-18
- 0.1.1 — 2015-06-21
- 0.1.0 — 2014-09-09
- 0.0.7 — 2013-10-31
- 0.0.6 — 2013-07-01
- 0.0.5 — 2013-03-02
- 0.0.4 — 2013-02-27

## README

<img align="right" src="https://raw.github.com/cliffano/breaker/master/avatar.jpg" alt="Avatar"/>

[![Build Status](https://img.shields.io/travis/cliffano/breaker.svg)](http://travis-ci.org/cliffano/breaker)
[![Dependencies Status](https://img.shields.io/david/cliffano/breaker.svg)](http://david-dm.org/cliffano/breaker)
[![Coverage Status](https://img.shields.io/coveralls/cliffano/breaker.svg)](https://coveralls.io/r/cliffano/breaker?branch=master)
[![Published Version](https://img.shields.io/npm/v/breaker.svg)](http://www.npmjs.com/package/breaker)
<br/>
[![npm Badge](https://nodei.co/npm/breaker.png)](http://npmjs.org/package/breaker)

Breaker
-------

Breaker is a utility tool for other server management tools.

This is handy when you want to remotely execute shell command via SSH on multiple hosts. Also useful when you want to format various host files (<a href="http://www.debianadmin.com/ssh-on-multiple-servers-using-cluster-ssh.html">clusterssh config</a>, <a href="http://ansible.cc/docs/patterns.html#hosts-and-groups">Ansible inventory</a>, <a href="http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/">SSH config</a>) from a single .breaker.json configuration file.

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

    npm install -g breaker 

Usage
-----

Create sample Breaker hosts file:

    breaker init
    
Format hosts info into clusterssh config:

    breaker -t clusterssh format

Format hosts info into Ansible inventory:

    breaker -t ansible format

Format hosts info into SSH config:

    breaker -t sshconfig format

Format selected hosts info into clusterssh config:

    breaker -t clusterssh -l label1,label2 format

Remotely execute shell command via SSH in series:

    breaker ssh <command>

remember to wrap command in quotes, e.g. `"pwd; df -kh; uname -a;"`

Remotely execute shell command via SSH on selected hosts in series:

    breaker -l label1,label2 ssh <command>

Filter label using regular expressions

    breaker -l .*dev.*,^prod,backup$ ssh <command>

Configuration
-------------

.breaker.json contains an array of host objects.

For standard SSH (current user, default port, no key), only host needs to be specified, labels are useful for filtering hosts by labels:

    [
      { "host": "dev1.com", "labels": [ "dev" ] },
      { "host": "dev2.com", "labels": [ "dev" ] },
      { "host": "prod1.com", "labels": [ "prod" ] }
    ]

For SSH with specific key, user, and port (all optionals):

    [
      { "host": "dev1.com", "labels": [ "dev" ],
        "ssh":
          [
            { "user": "user1", "port": 2222, "key": "path/to/key1" },
            { "user": "user2", "port": 2223, "key": "path/to/key2" }
          ]
        }
    ]

Colophon
--------

[Developer's Guide](http://cliffano.github.io/developers_guide.html#nodejs)

Build reports:

* [Code complexity report](http://cliffano.github.io/breaker/complexity/plato/index.html)
* [Unit tests report](http://cliffano.github.io/breaker/test/buster.out)
* [Test coverage report](http://cliffano.github.io/breaker/coverage/buster-istanbul/lcov-report/lib/index.html)
* [Integration tests report](http://cliffano.github.io/breaker/test-integration/cmdt.out)
* [API Documentation](http://cliffano.github.io/breaker/doc/dox-foundation/index.html)

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