CLI

_images/cli.png

Symbol CLI is an Open Source command-line interface to interact with the blockchain. The source code is available at GitHub.

Installation

Symbol CLI is distributed using the node package manager npm.

Note

Symbol CLI requires node.js 12 LTS to run. It is recommended that you install node.js using nvm.

Execute the following command in a new terminal:

npm install --global symbol-cli

Configuration

To start using Symbol CLI, configure a profile. Profiles are used to set a base NODE_URL and account to sign transactions.

symbol-cli profile import --private-key <PRIVATE_KEY> --network TEST_NET --url <NODE_URL> --password <PASSWORD> --profile <PROFILE_NAME>

By default, Symbol CLI will always use the default profile. To use a named profile with any other command, add the --profile option to the command.

symbol-cli account info --profile <PROFILE_NAME>

If you are going to use named profile for multiple commands, you can change the default profile with the following command.

symbol-cli profile setdefault --profile <PROFILE_NAME>

If you do not have a private key to create a profile, you can generate a new account, add a node URL and save it as default or named profile.

symbol-cli account generate --network TEST_NET --url <NODE_URL> --password <PASSWORD> --profile <PROFILE_NAME> --save

Commands

Symbol CLI is deprecated. These are the available commands for the latest Symbol CLI.

Find out which CLI version do you have installed by running symbol-cli from the command line.