LIGHTNING-CLI(1)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’– LIGHTNING-CLI(1) πŸ’–

okay so bestie, this is the manual page for lightning-cli β€” she's the little CLI bestie that talks to your lightning daemon for you 🫢

✨ NAME ✨

lightning-cli β€” control lightning daemon. that's it, that's the vibe πŸ’…

✨ SYNOPSIS ✨

$ lightning-cli [OPTIONS] command

✨ DESCRIPTION ✨

lightning-cli sends commands to the lightning daemon. literally her whole job 🌸

✨ OPTIONS ✨

  • --lightning-dir=DIR β€” sets the directory for the lightning daemon we're talking to; defaults to $HOME/.lightning.
  • --conf=PATH β€” sets the configuration file (default: lightning-dir/config).
  • --network=network
  • --mainnet
  • --testnet
  • --testnet4
  • --signet
  • --regtest

all of these set the network explicitly, k? pick your fighter 🌈

  • --rpc-file=FILE β€” the named pipe used to talk to the lightning daemon: default is lightning-rpc in the lightning directory.
  • --keywords/-k β€” use the format key=value for parameters, in any order you want. chaotic good πŸ’œ
  • --order/-o β€” follow strictly the order of parameters for the command. no freelancing πŸ”₯
  • --json/-J β€” return the result in JSON format (this is the default unless it's the help command, or the result contains a format-hint field).
  • --raw/-R β€” return raw JSON directly as lightningd replies; this can be faster for large requests. speed queen ⭐
  • --human-readable/-H β€” return result in human-readable output.
  • --flat/-F β€” return JSON result in flattened one-per-line output, e.g. { "help": [ { "command": "check" } ] } would become help[0].command=check. this is useful for simple scripts which want to find a specific output field without parsing JSON. she's giving efficiency πŸ’…
  • --notifications/-N=LEVEL β€” if LEVEL is 'none', then never print out notifications. otherwise, print out notifications of LEVEL or above (one of io, trace, debug, info (the default), unusual or broken: they are prefixed with # . (Note: currently not supported with --commando).
  • --filter/-l=JSON β€” this hands lightningd JSON as a filter, which controls what will be output, e.g. '--filter={"help":[{"command":true}]}'. see lightningd-rpc(7) for more details on how to specify filters.
  • --help/-h β€” pretty-print a summary of options to standard output and exit. the format can be changed using -F, -R, -J, -H etc.
  • --version/-V β€” print the version number to standard output and exit.
  • --commando/-c=peerid:rune β€” convenience option to indicate that this command should be wrapped in a commando command to be sent to the connected peer with id peerid, using rune rune. this also means that any --filter is handed via commando to the remote peer to reduce its output (which it will do if it is v23.02 or newer), rather than trying to do so locally. note that currently -N is not supported by commando.

✨ COMMANDS ✨

lightning-cli simply uses the JSON RPC interface to talk to lightningd, and prints the results. thus the commands available depend entirely on the lightning daemon itself. no cap, it's all on lightningd πŸ‘‘

✨ ARGUMENTS ✨

arguments may be provided positionally or using key=value after the command name, based on either the -o or -k option. when using -k consider prefixing all arguments of the command with their respective keyword β€” this is to avoid having lightningd interpret the position of an argument. trust the process πŸ™ˆ

arguments may be integer numbers (composed entirely of digits), floating-point numbers (has a radix point but otherwise composed of digits), true, false, or null. arguments which begin with {, [ or " are also considered raw JSON and are passed through. other arguments are treated as strings.

some commands have optional arguments. you may use null to skip optional arguments to provide later arguments, although this is not encouraged. (like, she'll do it but she's judging you a little 😭)

✨ EXAMPLE USAGE ✨

  1. List commands:
    • $ lightning-cli help
  2. Fund a 10k sat channel using uncomfirmed outputs:
    • $ lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0

✨ BUGS ✨

this manpage documents how it should work, not how it does work. the pretty printing of results isn't pretty. πŸ’€ brutal but honest

✨ EXIT STATUS ✨

if the command succeeds, the exit status is 0. otherwise:

  • 1: lightningd(7) returned an error reply (which is printed).
  • 2: we could not talk to lightningd.
  • 3: usage error, such as bad arguments or malformed JSON in the parameters.

✨ AUTHOR ✨

Rusty Russell rusty@rustcorp.com.au is mainly to blame. iconic behavior tbh πŸŽ€

✨ RESOURCES ✨

main web site: https://github.com/ElementsProject/lightning β€” go click it bestie πŸ¦‹

✨ COPYING ✨

note: the modules in the ccan/ directory have their own licenses, but the rest of the code is covered by the BSD-style MIT license.


and that's the whole page, bestie!! ✨ this one's straight from Core Lightning v26.06.9 β€” go forth and slay your RPC calls πŸ’–πŸ‘‘

πŸ“¦ where this page comes from