# binder-client

> command-line tool to manage binder services

Latest version **1.0.3** (published 2016-07-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install binder-client
pnpm add binder-client
yarn add binder-client
bun add binder-client
```

Provides the command `binder`.

## 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 | 1.0.3 |
| Published | 2016-07-10 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jeremy Freeman |
| Maintainers | andrewosh |
| Keywords | docker, binder, reproduction, container, environment, jupyter |

## Links

- npm: https://www.npmjs.com/package/binder-client
- Repository: https://github.com/binder-project/binder-client
- Homepage: https://github.com/binder-project/binder-client#readme
- Issues: https://github.com/binder-project/binder-client/issues
- npm.io page: https://npm.io/package/binder-client

## Dependencies (8)

- [lodash](https://npm.io/package/lodash.md) ^4.3.0
- [request](https://npm.io/package/request.md) ^2.69.0
- [jsonfile](https://npm.io/package/jsonfile.md) ^2.2.3
- [url-join](https://npm.io/package/url-join.md) 0.0.1
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [string-format](https://npm.io/package/string-format.md) ^0.5.0
- [binder-logging](https://npm.io/package/binder-logging.md) ^1.0.0
- [binder-protocol](https://npm.io/package/binder-protocol.md) ^1.2.0

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-07-10
- 1.0.2 — 2016-04-21
- 1.0.1 — 2016-03-30
- 1.0.0 — 2016-03-25

## README

# binder-client

Command line tool for managing Binder services: build, register, launch. Implements both a programmatic interface and a CLI interface for the protocol specification in [`binder-protocol`](https://github.com/binder-project/binder-protocol). 

Make it easy to mix and match use cases and environments: local or cloud deployment, building images or launching images directly, etc.

### install
```
npm install binder-client -g
```

### usage

This module can be imported as a module, or used directly from the CLI (and the usage is pretty much the same in both cases). Every method that's exposed by the client takes at least a host and a port as parameters, and authorized endpoints also require an API key. 

#### as CLI utility

The client can communicate with any endpoint in the Binder API using the following format (see examples): 
```
binder (build|registry|deploy) (command) [options] 
```

#### as an imported module
```
binder.(build|registry|deploy).(command)(options, function (err, result) {
  ...
})
```

### CLI examples

Unauthorized commands don't require an API token
```
binder deploy deploy binder-project-example-requirements --host='deploy.mybinder.org' --port=8084'
```

Endpoints are specified as camel-case in [`binder-protocol`](https://github.com/binder-project/binder-protocol), but they should be translated to kebab-case before use with the client:
```
binder registry fetch-all --host='build.mybinder.org' --port=8082 --api-token
```

If an endpoint has GET query parameters (i.e. `binder registry fetch`) they are specified as additional CLI arguments
```
binder registry fetch binder-project-example-requirements <deploy-id> --host='local' -api-token='blah'
```

### imported module

Translating CLI commands into programmatic API commands is straightforward (CLI arguments just need to be inserted into an options object):

To start building an image/template for a repository:
```
var buildOpts = {
  host: '<build server host>',
  port: 8082,
  apiKey: <api key>,
  repository: '<repo name>'
}
binder.build.start(buildOpts, function (err, status) {
  ...
})
```

To query the status of a single build:
```
var buildOpts = {
  host: '<build server host>',
  port: 8082,
  apiKey: <api key>,
  repository: '<repo name>'
}
binder.build.status(buildOpts, function (err, status) {
  ...
})
```

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