cln-commando-cli 0.1.0

A tiny CLI for calling Core Lightning RPC methods over Commando/LNSocket
cln-commando-cli-0.1.0 is not a library.

cln-commando-cli

cln-commando is a tiny command-line client for calling Core Lightning RPC methods over Commando using the Lightning transport.

It is intended as a remote lightning-cli-style probe/tool when you have:

  • the target node id,
  • a reachable host/port,
  • a Commando rune.

The transport and Commando implementation come from lnsocket.

Install

cargo install cln-commando-cli

Or from a checkout:

cargo install --path .

Usage

cln-commando \
  --connect 02abc...def@example.com:9735 \
  --rune "$RUNE" \
  getinfo

With JSON params:

cln-commando -c 02abc...def@example.com -r "$RUNE" listfunds '{}'
cln-commando -c 02abc...def@example.com -r "$RUNE" listpeers '{"id":"02..."}'
cln-commando -c 02abc...def@example.com -r "$RUNE" invoice '[1000,"label","description"]'

Read params from stdin or a file:

echo '{"id":"02..."}' | cln-commando -c 02abc...def@example.com -r "$RUNE" listpeers -
cln-commando -c 02abc...def@example.com -r "$RUNE" listpeers @params.json

Environment variables are also supported:

export CLN_COMMANDO_CONNECT=02abc...def@example.com:9735
export CLN_COMMANDO_RUNE=...
cln-commando --pretty listfunds

If your rune restricts the caller identity with an id= restriction, provide a persistent client identity:

export CLN_COMMANDO_SECRET_KEY=0123...deadbeef
cln-commando -c 02abc...def@example.com -r "$RUNE" getinfo

Without --secret-key, a fresh random client key is generated for each run.

Monitoring probe example

cln-commando \
  --connect "$NODE_ID@$HOST:9735" \
  --rune "$READONLY_RUNE" \
  --timeout 10 \
  --retries 0 \
  getinfo >/dev/null

That checks that the node accepts a fresh Lightning transport connection, runs Commando, validates the rune, and can execute the chosen RPC.

License

MIT