significance / swarm-cli

CLI tool for Swarm and Bee client operations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swarm-CLI

Node.js tests Dependency Status standard-readme compliant js-standard-style

Warning: This project is in alpha state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.

Description

Command line interface tool for manage Bee node and utilize its functionalities

The goal of this project is to handle most of the Swarm operations through CLI at some point in the future. For currently supported operations, see Commands section.

Commands

swarm-cli can perform commands:

  • upload # upload files (even directories) to Swarm network by passing the file's path
  • identity # manage keys (which can be compatible with Ethereum V3 keystore standard) that you can use mostly for signing chunks

for more info execute swarm-cli --help after installation.

Config

The configuration file is placed in a hidden folder named swarm-cli. In case of Unix-based systems this config path will be: $HOME/.swarm-cli On Windows systems: $HOME\AppData\swarm-cli

The configuration file is saved with 600 file permission.

On first run, this configuration will be generated with default values, that you are able to change on your demand under the before mentioned path.

Assignment priority

It is possible to set value of particular parameters in different ways.

The assignment priority of how option gets its value in question is the following:

  1. passed CLI option value (with e.g. --option-example-1)
  2. env variable for that option in form of either OPTION_EXAMPLE_1 or SWARM_CLI_OPTION_EXAMPLE_1 (if it is available)
  3. CLI configuration value of that option (if it is available)
  4. option's default fallback value (or it is required to define by #1)

System environment

With specific system environment variables you can alter the behaviour of the CLI

  • BEE_API_URL - API URL of Bee client
  • SWARM_CLI_CONFIG_FOLDER - full path to a configuration folder

Install

npm

 $ npm install -g @ethersphere/swarm-cli

Compile code

Install project dependencies with

 $ npm i

In order to compile NodeJS code run

 $ npm run compile

and you can try out the swarm-cli CLI after run command

 $ npm link

in your project folder.

Contribute

There are some ways you can make this module better:

  • Consult our open issues and take on one of them
  • Help our tests reach 100% coverage!

Maintainers

License

BSD-3-Clause

About

CLI tool for Swarm and Bee client operations

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:TypeScript 92.7%Language:JavaScript 6.9%Language:HTML 0.5%