Skip to content
Itokiana Rafidinarivo edited this page Jan 21, 2023 · 6 revisions

This page will guide you through the use of the command-line a.k.a. CLI for ergpy.

---
title: Ergpy CLI features
---
flowchart TD
    subgraph implemented
    wallet-address
    box-info
    version
    simple
    token
    end

    ergpy([ergpy]):::root
    ergpy --> get:::command
    ergpy --> create:::command
    ergpy --> send:::command
    ergpy --> version:::command

    get --> wallet-address
    get --> box-info

    send --> simple
    send --> token

    create --> nft
    create --> token
    create --> gensis-box
    create --> issuer-box
Loading

Getting started

(recommended) Setup a virtual environment

In order to properly use the command-line ergpy make sure to set up a virtual environment. In order to do so you can type the following command :

python -m venv env

Note

This command will create a folder within the path you are currently located at.

After you made sure that the folder was created, use this virtual environment. In order to do so you can use the command source env/bin/activate.

Note

Personal I see a (env) appear in front of my terminal input after typing the command. But you can also type which python, this command should print something like <your-path>/ergpy/env/bin/python.

# Installation

First things first, to make sure that your environment takes into account the command, we will install the package with the following command :

python -m pip install -e .

Note

This will make sure that the entry point (ergpy) is taken into the PATH.

To check if the installation is properly done, check the next section

Usage

The CLI is very simple and straightforward, check the help like this :

$ ergpy --help
Usage: ergpy [OPTIONS] COMMAND [ARGS]...

  ergpy official CLI

Options:
  --help  Show this message and exit.

Commands:
  create  create issuer box, NFT, token...
  get     Retrieve information about wallet address, box info...
  send    simple send or send token

In addition to that if you want to check the detail about a specific command :

$ ergpy --help
Usage: ergpy get [OPTIONS] COMMAND [ARGS]...

 Retrieve information about wallet address, box info...

Options:
 --help  Show this message and exit.

Commands:
 box-info        Retrieve informations about box.
 wallet-address  Retrieve informations about (a) wallet address(es).

...can we go further with the details though? Yes

Usage: ergpy get wallet-address [OPTIONS]

  Retrieve informations about (a) wallet address(es).

Options:
  --amount INTEGER          Amount of addresses
  --wallet-mnemonic TEXT    Wallet mnemonic
  --mnemonic-password TEXT  Password for the mnemonic
  --node-url TEXT           MainNet or TestNet
  --help                    Show this message and exit.

Examples

Show package version

$ ergpy version
ergpy 0.1.10.0 

Note

The output should be blue if your terminal supports it!

Clone this wiki locally