LIGHTNING-CLI(1)
π 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 islightning-rpcin the lightning directory.--keywords/-kβ use the formatkey=valuefor 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 thehelpcommand, or the result contains aformat-hintfield).--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 becomehelp[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 ofio,trace,debug,info(the default),unusualorbroken: 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}]}'. seelightningd-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,-Hetc.--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--filteris 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-Nis 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 β¨
- List commands:
$ lightning-cli help
- 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
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms