Skip to main content

CLI Commands

Reference for bitcoin-cli and bitcoind command-line usage.

bitcoind

Start the Bitcoin daemon:

bitcoind [options]

Common Options

# Run as daemon
bitcoind -daemon

# Specify data directory
bitcoind -datadir=/path/to/data

# Specify config file
bitcoind -conf=/path/to/bitcoin.conf

# Regtest mode
bitcoind -regtest

# Testnet mode
bitcoind -testnet

# Signet mode
bitcoind -signet

bitcoin-cli

Interact with a running node:

bitcoin-cli [options] <command> [args]

Connection Options

# Specify RPC credentials
bitcoin-cli -rpcuser=user -rpcpassword=pass <command>

# Specify RPC port
bitcoin-cli -rpcport=8332 <command>

# Specify wallet
bitcoin-cli -rpcwallet=mywallet <command>

# Use cookie authentication
bitcoin-cli -rpccookiefile=/path/to/.cookie <command>

Useful Commands

# Quick status
bitcoin-cli -getinfo

# Stop node
bitcoin-cli stop

# Get help
bitcoin-cli help
bitcoin-cli help <command>

bitcoin-qt

GUI application:

bitcoin-qt [options]

GUI Options

# Use a specific Qt widget style (generic Qt flag)
bitcoin-qt -style=fusion

# Start minimized (minimizes to tray only if enabled in settings)
bitcoin-qt -min

# Reset GUI settings
bitcoin-qt -resetguisettings
note

Knots dark mode is native and follows your system theme automatically — no flag needed. -style=fusion merely selects a Qt widget style.

bitcoin-tx

Transaction utility:

bitcoin-tx [options] <hex-tx> [commands]

Examples

# Decode transaction
bitcoin-tx -json <hex>

# Create transaction
bitcoin-tx -create in=txid:vout out=addr:amount

bitcoin-wallet

Offline wallet tool:

bitcoin-wallet [options] <command>

Commands

# Create wallet
bitcoin-wallet -wallet=new create

# Get wallet info
bitcoin-wallet -wallet=existing info

# Dump wallet records (requires -dumpfile)
bitcoin-wallet -wallet=existing -dumpfile=/path/to/wallet.dump dump

Pointing Tools at the Right Node

There are no environment variables for this — use command-line options instead:

# Use a non-default data directory
bitcoin-cli -datadir=/path/to/data <command>

# Use a specific config file
bitcoind -conf=/path/to/bitcoin.conf

# Use a specific RPC auth cookie
bitcoin-cli -rpccookiefile=/path/to/.cookie <command>

See Also