Neutron CLI
Neutron CLI
neutron-cli is a command-line tool for the Neutron wallet API. Use it to send payments, create invoices, check balances, manage webhooks, and more — directly from your terminal or from inside an AI agent's bash environment.
npm install -g neutron-cliCurrent version: 0.3.3
Setup
The first time you run any command, the CLI walks you through credential setup automatically:
neutron-cli auth
# ⚡ Welcome to Neutron CLI
# No credentials found. Let's set them up.
#
# Get your API key at: https://portal.neutron.me
#
# API Key: ****************
# API Secret: ****************
#
# ✅ Credentials saved to ~/.neutron/config.json
# Permissions set to 600 (private to you)Credentials are saved to ~/.neutron/config.json with 600 file permissions (readable only by you). You won't be prompted again.
You can also set credentials via environment variables — useful for CI, servers, and AI agents:
export NEUTRON_API_KEY=your_api_key
export NEUTRON_API_SECRET=your_api_secretPriority: env vars → ~/.neutron/config.json
Commands
Verify credentials
neutron-cli authCheck balances
neutron-cli balanceCreate a Lightning invoice
neutron-cli invoice --amount 5000
neutron-cli invoice --amount 5000 --memo "order #123"Send a payment — auto-detects type from address
The send command automatically detects the payment type from the destination — no extra flags needed:
# Lightning Address ([email protected])
neutron-cli send --to [email protected] --amount 5000
# Lightning invoice (BOLT11)
neutron-cli send --to lnbc50u1p... --amount 5000
# Bitcoin on-chain
neutron-cli send --to 1A1zP1eP5... --amount 5000
# USDT on TRON
neutron-cli send --to TQn9Y2khEs... --amount 10 --currency USDT
# USDT on Ethereum
neutron-cli send --to 0xAbC123... --amount 10 --currency USDT| Destination format | Detected as |
|---|---|
[email protected] | Lightning Address |
lnbc... | Lightning invoice (BOLT11) |
1..., 3..., bc1... | Bitcoin on-chain |
T... | USDT on TRON |
0x... | USDT on Ethereum |
Get your deposit addresses
neutron-cli address ln # Lightning Address ([email protected])
neutron-cli address btc # Bitcoin on-chain
neutron-cli address usdt # USDT on TRON (default)
neutron-cli address usdt --chain ETH # USDT on EthereumSwap currencies
neutron-cli swap --from BTC --to USDT --amount 1000 # BTC → USDT (amount in sats)
neutron-cli swap --from USDT --to BTC --amount 10 # USDT → BTCFiat payouts
Fiat payouts require KYC verification at portal.neutron.me. The CLI checks automatically and shows a prompt if KYC isn't complete. Bitcoin, USDT, and Lightning payments do not require KYC.
# List banks for a country
neutron-cli fiat institutions --country VN
# Send a fiat payout
neutron-cli fiat payout \
--amount 0.001 \
--from BTC \
--to VND \
--method vnd-instant \
--bank-account 0123456789 \
--bank-code 970422 \
--recipient "LE VAN A" \
--country VNTransactions
neutron-cli tx list
neutron-cli tx list --limit 20 --from 2026-01-01 --to 2026-03-01
neutron-cli tx get txn_abc123Exchange rate
neutron-cli rate
neutron-cli rate --currency thbWebhooks
neutron-cli webhook create --url https://example.com/hook
neutron-cli webhook list
neutron-cli webhook delete wh_abc123Manage config
neutron-cli config init # set up or update credentials
neutron-cli config show # show current credentials (masked)
neutron-cli config test # verify credentials work against the APIUpdate
neutron-cli updateOutput Modes
The CLI defaults to TUI output — colored, human-readable, with spinners and tables.
Add --json to any command for structured machine-readable output:
neutron-cli balance --json
# {"ok":true,"data":{"wallets":[...]}}Errors are written to stderr with a non-zero exit code:
{"error":"Missing credentials","code":"AUTH_MISSING"}This makes it straightforward to use in scripts:
result=$(neutron-cli invoice --amount 1000 --json)
invoice=$(echo $result | jq -r '.data.invoice')For AI Agents
Any AI agent with bash access can use neutron-cli directly — no MCP or SDK setup required.
Set credentials via env vars, then use --json for clean output:
export NEUTRON_API_KEY=your_api_key
export NEUTRON_API_SECRET=your_api_secret
# Create an invoice
neutron-cli invoice --amount 1000 --memo "agent payment" --json
# Send to a Lightning Address
neutron-cli send --to [email protected] --amount 5000 --json
# Check balance
neutron-cli balance --json
# List recent transactions
neutron-cli tx list --limit 5 --jsonWhen credentials are missing and --json is set, the CLI exits immediately with a structured error — no interactive prompts that would block an agent:
{"error":"No credentials found. Set NEUTRON_API_KEY and NEUTRON_API_SECRET env vars, or run: neutron-cli config init","code":"AUTH_MISSING"}Links
- API key: portal.neutron.me
- Full docs: docs.neutron.me
- npm: npmjs.com/package/neutron-cli
- GitHub: github.com/Neutronpay/neutron-cli
- MCP package: neutron-mcp
- SDK: neutron-sdk
Updated 8 days ago
