{"id":18235692,"url":"https://github.com/rkalis/electrum-cli","last_synced_at":"2026-01-07T04:55:22.536Z","repository":{"id":55886427,"uuid":"316478051","full_name":"rkalis/electrum-cli","owner":"rkalis","description":"Quickly make requests to an electrum server with a simple CLI","archived":false,"fork":false,"pushed_at":"2020-12-09T13:58:41.000Z","size":44,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-19T00:07:24.001Z","etag":null,"topics":["bitcoin","bitcoin-cash","cli","electrum"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkalis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-27T11:04:44.000Z","updated_at":"2025-02-15T12:54:44.000Z","dependencies_parsed_at":"2022-08-15T08:40:24.250Z","dependency_job_id":null,"html_url":"https://github.com/rkalis/electrum-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkalis%2Felectrum-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkalis%2Felectrum-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkalis%2Felectrum-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkalis%2Felectrum-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkalis","download_url":"https://codeload.github.com/rkalis/electrum-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123059,"owners_count":20887258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bitcoin-cash","cli","electrum"],"created_at":"2024-11-05T00:02:44.106Z","updated_at":"2026-01-07T04:55:22.499Z","avatar_url":"https://github.com/rkalis.png","language":"JavaScript","funding_links":[],"categories":["Libraries \u0026 SDKs"],"sub_categories":["Javascript"],"readme":"# electrum-cli\n\n`electrum-cli` is a very simple CLI tool that allows you to quickly make requests to an electrum server.\n\n## Installation\n\n```\nnpm install -g electrum-cli\n```\n\n## Usage\n\n```\nUsage: electrum-cli [options] \u003cmethod\u003e [methodArgs...]\n\nOptions:\n  --server \u003cserver\u003e    electrum server to connect to over SSL ({host}:{port})\n  --version \u003cversion\u003e  electrum protocol version to use (default: \"1.4\")\n  --btc                use default server for BTC (electrumx-core.1209k.com:50002)\n  --bch                use default server for BCH (bch.imaginary.cash:50002)\n  --help               display help for command\n```\n\n`electrum-cli` can be used to call any of the protocol methods supported by the specified electrum version and server and will output the response from the server.\n\nTo inspect the full specification, see the [ElectrumX documentation](https://electrumx-spesmilo.readthedocs.io/) for the general documentation, or the [Fulcrum documentation](https://electrum-cash-protocol.readthedocs.io/) for Bitcoin Cash specific methods.\n\n### Supported chains\n`electrum-cli` allows you to specify a custom server and protocol version. As such, it is compatible with all cryptocurrencies that support the electrum protocol, such as BTC, BCH and LTC. For convenience, you can use the `--btc` or `--bch` flags to connect to a default electrum server for the BTC and BCH networks, respectively. These default servers are `electrumx-core.1209k.com:50002` for BTC and `bch.imaginary.cash:50002` for BCH.\n\n### Shell aliases\nIf you find yourself using the same requests often, it can be useful to set up aliases in your Bash/Zsh/Fish config.\n\n```bash\nalias get-bch-tx=\"electrum-cli --bch blockchain.transaction.get\"\nalias get-btc-block-header=\"electrum-cli --btc blockchain.block.header\"\n```\n\n### Examples\n\n#### Request the genesis block header on BTC\n```\n$ electrum-cli --btc blockchain.block.header 0\n0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c\n```\n\n#### Request the Hal Finney transaction on BCH\n```\n$ electrum-cli --bch blockchain.transaction.get f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16\n0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901ffffffff0200ca9a3b00000000434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee0000000043410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000\n```\n\n```json\n$ electrum-cli --bch blockchain.transaction.get f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16 true\n{\n  \"txid\": \"f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16\",\n  \"hash\": \"f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16\",\n  \"version\": 1,\n  \"size\": 275,\n  \"vsize\": 275,\n  \"weight\": 1100,\n  \"locktime\": 0,\n  \"vin\": [\n    {\n      \"txid\": \"0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9\",\n      \"vout\": 0,\n      \"scriptSig\": {\n        \"asm\": \"304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09[ALL]\",\n        \"hex\": \"47304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901\"\n      },\n      \"sequence\": 4294967295\n    }\n  ],\n  \"vout\": [\n    {\n      \"value\": 10,\n      \"n\": 0,\n      \"scriptPubKey\": {\n        \"asm\": \"04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_CHECKSIG\",\n        \"hex\": \"4104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac\",\n        \"type\": \"pubkey\"\n      }\n    },\n    {\n      \"value\": 40,\n      \"n\": 1,\n      \"scriptPubKey\": {\n        \"asm\": \"0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3 OP_CHECKSIG\",\n        \"hex\": \"410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac\",\n        \"type\": \"pubkey\"\n      }\n    }\n  ],\n  \"hex\": \"0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901ffffffff0200ca9a3b00000000434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee0000000043410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000\",\n  \"blockhash\": \"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee\",\n  \"confirmations\": 658741,\n  \"time\": 1231731025,\n  \"blocktime\": 1231731025\n}\n```\n\n#### Broadcast a transaction on BTC using a custom server\n```\n$ electrum-cli --server btc.litepay.ch:50002 blockchain.transaction.broadcast 0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901ffffffff0200ca9a3b00000000434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee0000000043410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000\nf4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16\n```\n\n#### List all UTXOs for an address on BCH using a custom version\n```json\n$ electrum-cli --bch --version 1.4.3 blockchain.address.listunspent bitcoincash:prc3anhlptnca2pc7p8c7700546d5kamgsklagnkrs\n[\n  {\n    \"height\": 0,\n    \"tx_hash\": \"26511b1110aa16fcaefd703c8daee5b2e9932559f5cbf234aad57aec879d2029\",\n    \"tx_pos\": 0,\n    \"value\": 21000000\n  }\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkalis%2Felectrum-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkalis%2Felectrum-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkalis%2Felectrum-cli/lists"}