# @dapplets/cli

> Dapplets CLI utility.

Latest version **0.2.11** (published 2023-09-14) · MIT license · 0 weekly downloads

## Install

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

Provides the command `dapplets`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.11 |
| Published | 2023-09-14 |
| First published | 2019-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 250 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dapplets Project |
| Maintainers | alsakhaev, dapplets-org |
| Keywords | dapplet, dapplets, augmentation |

## Links

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

## Dependencies (6)

- [jszip](https://npm.io/package/jszip.md) ^3.10.1
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [semver](https://npm.io/package/semver.md) ^7.5.4
- [commander](https://npm.io/package/commander.md) ^11.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.2

## Recent versions

- 0.2.11 (latest) — 2023-09-14
- 0.2.10 — 2023-09-14
- 0.2.9 — 2023-09-13
- 0.2.8 — 2023-09-12
- 0.2.7 — 2023-09-12
- 0.2.6 — 2023-09-11
- 0.2.5 — 2023-09-08
- 0.2.4 — 2023-09-07
- 0.2.3 — 2023-09-07
- 0.2.2 — 2023-09-07
- 0.2.1 — 2023-09-07
- 0.2.0 — 2023-09-07
- 0.1.10 — 2020-04-28
- 0.1.9 — 2020-02-06
- 0.1.8 — 2020-02-04
- … 8 more at https://npm.io/package/@dapplets/cli/versions

## README

# Dapplets CLI

Toolkit for deploying dapplet modules in registries.

## Installation

### Install Globally

```bash
npm install -g @dapplets/cli
```

### Install Locally

```bash
npm install --save-dev @dapplets/cli
```

## Usage

```bash
Usage: dapplets [options] [command]

Dapplets CLI utility.

Options:
  -V, --version                   output the version number
  -k, --eth-private-key <key>     Ethereum private key (env: ETH_PRIVATE_KEY)
  -r, --target-registry <url>     Target registry (env: TARGET_REGISTRY)
  -i, --ipfs-gateway-url <url>    Ipfs gateway URL (env: IPFS_GATEWAY_URL)
  -I, --ipfs                      save module to IPFS
  -b, --module-branch             Module branch to deploy
  -h, --help                      display help for command

Commands:
  deploy [options] [module-name]  Deploy module: FEATURE, CONFIG, and INTERFACE.
  help [command]                  display help for command
```

```bash
Usage: dapplets deploy [options] [module-name]

Deploy module: FEATURE, CONFIG, and INTERFACE.

Arguments:
  module-name                 Module name to deploy

Options:
  -d, --dev-server-url <url>  Developer server URL (env: DEV_SERVER_URL)
  -n, --module-name [name]    The name of the module to be deployed (env: MODULE_NAME)
  -h, --help                  display help for command
```

## Examples

Run `module` (`dapplet`, `adapter` or `virtual adapter`) from a project root directory containing a manifest.json file.

The following global parameters can be filled using environment variables:

| Parameter                      | Environment Variable |
| ------------------------------ | -------------------- |
| `-k, --eth-private-key <key>`  | `ETH_PRIVATE_KEY`    |
| `-r, --target-registry <url>`  | `TARGET_REGISTRY`    |
| `-i, --ipfs-gateway-url <url>` | `IPFS_GATEWAY_URL`   |
| `-d, --dev-server-url <url>`   | `DEV_SERVER_URL`     |
| `-n, --module-name [name]`     | `MODULE_NAME`        |

Example of Windows command line:

```bash
$ set ETH_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 && set TARGET_REGISTRY=test.v3.registry.dapplet-base.eth && set IPFS_GATEWAY_URL=https://ipfs-gateway.mooo.com && set DEV_SERVER_URL=https://localhost:3000/dapplet.json && dapplets deploy test-dapplet --ipfs
```

When the variables have already been set:

```bash
$ dapplets deploy <MODULE_NAME> --ipfs
```

If you prefer to set MODULE_NAME environment variable:

```bash
$ dapplets deploy -I
```

## CI/CD

You can use [concurrently](https://www.npmjs.com/package/concurrently) or similar tool to run the module and deploy it with a single npm script in the `package.json`:

```json
"scripts": {
    "cd": "concurrently -c \"yellow,green\" -n \"dapplet,cli\" \"npm start\" \"npx @dapplets/cli@latest deploy -I\" -ks \"command-cli\""
  },
```

Use it in your CI/CD. The examples of GitHub Actions workflows:

-   for one dapplet: https://github.com/dapplets/tipping-dapplet/blob/develop/.github/workflows/cd.yml
-   for monorepo use a reusable workflow: https://github.com/dapplets/modules-monorepo/blob/develop/.github/workflows/cd.yml

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