npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gbits-cli-dev

v0.2.5

Published

The `gbits-cli` tool enables users to send money, view account information, and view transaction histories via the command line.

Downloads

9

Readme

gbits-cli-dev

The gbits-cli tool enables users to send money, view account information, and view transaction histories via the command line.

Setup

To install the gbits-cli-dev, you first need to install Node.js (versions between LTS and v16.4.2). This guide will help you get through the Node.js install process. If you wish to install the CLI via npm, run the command below in your favorite terminal:

npm i -g gbits-cli-dev

Install from Source

To install globally from source, download the latest source from GitHub. Run the following commands in the source code directory:

npm i
npm link

Uninstall

To uninstall gbits-cli-dev, run the following command:

npm un -g gbits-cli-dev

Configuration

gbits-cli-dev configuration file contains option defaults and environment information to make the CLI easier and more robust. The configuration file is formatted using TOML and is located at ~/gbc.config.toml. When you first run gbc it will copy the default config if the file isn't found. Here is an example of the config file:

[hosts]
mock = "http://localhost:22222/mock/"

[paths]
users = "/users/:uid"
send = "/send"

[defaults]
env = "mock"
currency = "GEE"
email = "[email protected]"
uid = "c44dc8f4edb3f2b002145041"
secret = "123456-123"

[settings]
max_amount_prompt = 0

Hosts (Environments)

Hosts is a keyed list of hosts that the CLI can access via the --env option. Selecting an environment switches which host is used when sending HTTP requests.

Paths

Paths is a keyed list containing information about endpoints for the hosts. Different paths are used in various commands and have their own URL parameters.

| Name | Parameters | Description | | --- | --- | --- | | users | :uid | Endpoint for users and user transactions | | send | none | Endpoint for sending money |

Defaults

Defaults is a keyed list for adding default values to options when executing commands. If the option is given explicitly, then the default is ignored.

Settings

| Name | Type | Description | | --- | --- | --- | | max_amount_prompt | number | The maximum amount being sent before being prompt to confirm the transaction. |

Commands

You can find all the information you need on how to use gbits-cli-dev commands below, or by typing the command:

gbc --help

Global Options

| Option | Description | | ------------------ | ------------------------- | | -V, --version | Output the version number | | --verbose | Outputs debug information | | -n, --env <name> | Changes the environment | | -h, --help | Displays global help |

gbc account|acc

Command displays an account's information.

| Option | Description | | --- | --- | | -u, --uid <id> | Finds account using this user id | | -e, --email <email> | Finds account using this email | | -s, --secret <secret> | Secret used instead of default | | -h, --help | Displays help for command |

Note: If the --uid and the --email option are both present, --uid is only used.

gbc txhistory|txh

Command displays an account's transaction history.

| Option | Description | | --- | --- | | -u, --uid <id> | Finds account using this user id | | -e, --email <email> | Finds account using this email | | -s, --secret <secret> | Secret used instead of default | | --show-only <received\|sent> | Show's only received or sent transactions | | -h, --help | Displays help for command |

Note: If the --uid and the --email option are both present, --uid is only used.

gbc send|snd

Command sends money to the recipient.

| Option | Description | | --- | --- | | -u, --uid <id> | Finds account using this user id | | -e, --email <email> | Finds account using this email | | -s, --secret <secret> | Secret used instead of default | | -r, --recipient-email <email> | Email of the recipient | | -a, --amount <amount> | Amount of money to send | | -c, --currency <code> | Currency of the money | | -m, --message <msg> | Message being sent with the money | | -h, --help | Displays help for command |

Note: If the --uid and the --email option are both present, --uid is only used.


  $ gbc send -e [email protected] -r [email protected] -a 9 -c GEE -m "cli-test 5"
Gbits successfully send.

Fat Finger example

$ gbc send -e [email protected] -r [email protected] -a 12000 -c GEE -m "cli-test 7"
Are you sure you want to send 12000 gbits? (Y/n)