Skip to content

About

Open source command line client for the Minter blockchain

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

minter-cli

minter-cli is a command-line client for the Minter blockchain. It exposes the Minter Node API v2 as api subcommands, provides cmd transaction commands and wallet utilities for generating keys and sending transactions, and manages the CLI configuration. API responses are converted from PIP to BIP by default, can be filtered with JMESPath, and can be printed as formatted or compact JSON.

$ minter-cli -h
Usage: minter-cli [options] [command]

Options:
  -h, --help      display help for command

Commands:
  version         Show app version
  api             Api v2 for Minter Node
  cmd             Blockchain transaction commands
  wallet          Wallet utility functions
  config          Config utilities
  help [command]  display help for command

Features

  • Query candidate info, candidate lists, coin info, address balances and node status through api
  • Send coins or tokens and enable or disable a validator candidate
  • Generate wallets from a BIP39 mnemonic phrase
  • Create and inspect config files without printing secret keys
  • Automatic PIP to BIP conversion for API queries, with an opt-out flag
  • JMESPath filtering and property listing
  • Human-readable or compact JSON output
  • API read subcommands mirror the official Minter Node API v2 endpoint names
  • Cross-platform

Install

Requires Node.js ≥ 20

npm i -g minter-cli

On the first command that needs the config, the CLI creates a user config file automatically. You can also create config.yml in the working directory or use minter-cli config init. See YAML Config.

Run Without Installation

npx minter-cli

Use with AI Agents

The repository includes an agent skill for minter-cli in skills/minter-cli. It teaches agents to run read-only API queries, filter responses with JMESPath, inspect the config safely, and prepare wallet send / cmd set_candidate commands for you to run manually. The skill never sends transactions or prints seed phrases.

Install it with the skills CLI (Node.js ≥ 22.20 for the installer):

npx skills add counters/minter-cli --skill minter-cli -g

Or install directly from the skill folder:

npx skills add https://github.com/counters/minter-cli/tree/main/skills/minter-cli

Choose your agent during installation, or pass -a <agent> explicitly, for example -a opencode.

Basic Usage

minter-cli <command> [subcommand] [arguments] [options]
minter-cli <command> [subcommand] --help

Command Overview

Command Subcommands Description
version — Print the CLI version.
api candidate, candidates, coin, address, status Query API v2.
cmd set_candidate Submit blockchain transactions.
wallet generate, send Generate a wallet or send a transaction.
config init, all, wallet Create or inspect the YAML config.

Common Options

Options shared by more than one command are documented here once. Every command supports -h, --help.

Config

-c, --config <path> — path to the YAML config (default: config.yml). Available on all api and cmd subcommands, wallet send, config all, and config wallet. When the default is used, the CLI looks for config.yml in the working directory first, then in the user config directory, and creates the user config if needed. A non-default path must exist. This option is not available on config init, wallet generate, or version. See YAML Config.

API Output

The following options are available on api candidate, api candidates, api coin, api address, and api status:

  • -p, --patch <jmespath> — apply a JMESPath expression to the response
  • -pl, --patches <boolean> — print the flat list of response property paths instead of the response; pass true explicitly (--patches true)
  • --pretty <boolean> — pretty-print JSON (default: true); pass false for compact output
  • --skip_pip2bip — skip the automatic PIP to BIP conversion

cmd set_candidate supports --config, --patch, --patches, and --pretty, but not --skip_pip2bip. wallet send accepts --config and --pretty, but prints only the transaction hash.

API Query

  • --height <number> — blockchain state height for the request; optional, the node's latest state is used by default. Available on api candidate, api candidates, api coin, and api address
  • --not_show_stakes <boolean> — omit the stakes list (default: true); pass false to include stakes. Available on api candidate and api candidates

Confirmation

-y, --no-interactive — skip the confirmation prompt. Available on cmd set_candidate and wallet send.

Boolean Values

Boolean options are parsed as JSON booleans, so pass an explicit value: --pretty false, --not_show_stakes false, --include_stakes true, --delegated true, --patches true. --skip_pip2bip is a bare flag.

api

minter-cli api <subcommand> [arguments] [options]

api candidate <public_key>

Returns candidate info by public key.

No additional command-specific options.

minter-cli api candidate Mp12345bf7d1c833701ea490c2e77430486922a9fbef713b933cc3b32700f27777

api candidates

Returns a list of candidates.

Additional command-specific options:

  • --include_stakes <boolean> — include stakes (default: false)
  • --candidate_status <status> — filter by all, off, on, or validator
minter-cli api candidates --candidate_status validator

api coin <symbol>

Returns information about a coin by its symbol.

No additional command-specific options.

minter-cli api coin BIP

api address <address>

Returns the coins list, balance, and transaction count of an address.

Additional command-specific options:

  • -d, --delegated <boolean> — include delegated amounts (default: false)
minter-cli api address Mx0903ab168597a7c86ad0d4b72424b3632be0af1b

api status

Returns node status including the public key and latest block.

No command-specific options.

minter-cli api status

cmd

minter-cli cmd <subcommand> [arguments] [options]

cmd set_candidate <public_key> <action>

Enables or disables a validator candidate. action must be on or off. The command uses the wallet from the config, so wallet.seed_phrase or wallet.private_key must be set.

Command-specific options:

  • -y, --no-interactive — skip confirmation
minter-cli cmd set_candidate Mp12345bf7d1c833701ea490c2e77430486922a9fbef713b933cc3b32700f27777 on

wallet

wallet generate

Generates a wallet from a random BIP39 mnemonic phrase and prints the address, mnemonic, and private key. Store this output securely: anyone with the mnemonic or private key controls the wallet.

No command-specific options.

minter-cli wallet generate

wallet send <recipient> <amount> <symbol>

Sends coins or tokens from the configured wallet.

Command-specific options:

  • -y, --no-interactive — skip confirmation

Uses --config and accepts --pretty, but prints only the transaction hash.

minter-cli wallet send Mx0903ab168597a7c86ad0d4b72424b3632be0af1b 1 BIP -y

config

config init creates the user config file if it does not exist and never overwrites an existing file. config all shows the effective config and the path of the file in use. config wallet shows only the wallet section.

config all and config wallet accept -c, --config <path>.

minter-cli config init
minter-cli config all
minter-cli config wallet

version

minter-cli version

Examples

JMESPath filtering

minter-cli api candidates --patch 'candidates[].publicKey'
minter-cli api coin BIP --patch volume --pretty false
minter-cli api candidate Mp12345bf7d1c833701ea490c2e77430486922a9fbef713b933cc3b32700f27777 --not_show_stakes false --patch "stakesList[?owner == 'Mx0903ab168597a7c86ad0d4b72424b3632be0af1b']"

Property paths

minter-cli api candidate Mp12345bf7d1c833701ea490c2e77430486922a9fbef713b933cc3b32700f27777 --patches true

Bash scripts

status=$(minter-cli api candidate Mp12345bf7d1c833701ea490c2e77430486922a9fbef713b933cc3b32700f27777 --patch status --pretty false)
echo "$status"

YAML Config

The default --config value is config.yml. The CLI looks for it in the working directory first, then in the user config directory:

  • Linux/macOS: $XDG_CONFIG_HOME/minter-cli/config.yml, or ~/.config/minter-cli/config.yml when XDG_CONFIG_HOME is not set.
  • Windows: %APPDATA%\minter-cli\config.yml.

If no config is found, the CLI downloads the default minter.urlapi from counters/minter-config and creates the user config file. If the download fails, it falls back to http://127.0.0.1:8843/v2 and prints a warning.

Use minter-cli config init to create the user config explicitly. The command never overwrites an existing file. To use another file, pass --config <path> to a command that accepts it; a non-default path must exist.

The generated config contains the API URL plus a placeholder wallet section (chain_id: 1, seed_phrase: one two ...) that mirrors the remote template:

wallet:
  chain_id: 1
  seed_phrase: one two ... # this SECRET !!!

Replace wallet.seed_phrase (or set wallet.private_key instead) before using wallet send or cmd set_candidate — with the untouched placeholder they fail with Invalid mnemonic phrase. Note the generated chain_id: 1 selects the mainnet, while the code default is 2. Full config example

minter:
  urlapi: 'https://api-minter.mnst.club/v2'
wallet:
  seed_phrase: one two 000 .... # this SECRET !!!

Inspecting the Config

minter-cli config all prints the effective config, including default values, and the path of the file in use. minter-cli config wallet prints only the wallet section.

Neither command ever prints seed_phrase or private_key values: it shows whether each is set and the address derived from it.

$ minter-cli config wallet
Config: /home/user/.config/minter-cli/config.yml

Wallet
chain_id: 2
seed_phrase: set
private_key: not set
Address: Mx0e31...

@TODO (Maybe..)

  • Install a test, local or master node
  • Launching open source applications (example: wallets)
  • Support for modules from other developers

About

Open source command line client for the Minter blockchain

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages