1Sat CLI
Bun-native command-line interface for 1Sat Ordinals and BSV operations. Binary name: 1sat.
Usage
# Run any command directly — no install needed
bunx @1sat/cli <command>
# Optional: install globally for frequent use
bun add -g @1sat/cli
# Then use the short form: 1sat <command>
Quick Start
# Initialize wallet and configuration
bunx @1sat/cli init
# Check wallet balance
bunx @1sat/cli wallet balance
# List ordinals in wallet
bunx @1sat/cli ordinals list
# Send BSV
bunx @1sat/cli wallet send --to 1Address... --amount 50000
If installed globally (
bun add -g @1sat/cli), replacebunx @1sat/cliwith just1sat.
Configuration
Config directory: ~/.1sat/
Key Management
Keys can be provided in three ways:
- Secure Enclave (macOS arm64): Hardware-protected via
@1sat/vault— keys encrypted with SE P-256 key, decryption requires Touch ID. Used bybap touchid enableandclawnet setup-key. - Environment variable: Set
PRIVATE_KEY_WIFwith your WIF private key - Encrypted keystore: Stored at
~/.1sat/keys.bep(created duringbunx @1sat/cli init)
# Using env var
PRIVATE_KEY_WIF=L1abc... bunx @1sat/cli wallet balance
# Using encrypted keystore (created by init)
bunx @1sat/cli init
bunx @1sat/cli wallet balance
Commands
All examples below use
bunx @1sat/cli. If installed globally, use1satinstead.
Wallet
bunx @1sat/cli wallet balance # Show BSV balance
bunx @1sat/cli wallet send # Send BSV to address
bunx @1sat/cli wallet send-all # Send entire balance
bunx @1sat/cli wallet utxos # List payment UTXOs
Ordinals
bunx @1sat/cli ordinals list # List ordinals in wallet
bunx @1sat/cli ordinals inscribe # Inscribe a file as ordinal
bunx @1sat/cli ordinals transfer # Transfer ordinal to recipient
Marketplace (OrdLock)
bunx @1sat/cli ordinals list-for-sale # List ordinal for sale
bunx @1sat/cli ordinals cancel-listing # Cancel an active listing
bunx @1sat/cli ordinals purchase # Purchase a listed ordinal
Tokens (BSV21)
bunx @1sat/cli tokens balances # Show all token balances
bunx @1sat/cli tokens list # List token UTXOs
bunx @1sat/cli tokens send # Send tokens to recipient
Locks (Timelock)
bunx @1sat/cli locks status # Show lock summary
bunx @1sat/cli locks create # Lock BSV until block height
bunx @1sat/cli locks unlock # Unlock all matured locks
Identity (BAP)
bunx @1sat/cli identity publish # Publish BAP identity
bunx @1sat/cli identity profile # View/update profile
bunx @1sat/cli identity attest # Publish attestation
Social (BSocial)
bunx @1sat/cli social post # Create a social post
bunx @1sat/cli social search # Search posts
OpNS Names
bunx @1sat/cli opns register # Register identity on OpNS name
bunx @1sat/cli opns deregister # Remove identity binding
Sweep / Import
bunx @1sat/cli sweep bsv # Sweep BSV from external WIF
bunx @1sat/cli sweep ordinals # Sweep ordinals from external WIF
bunx @1sat/cli sweep tokens # Sweep BSV21 tokens from external WIF
Action Escape Hatch
Any registered action can be invoked directly by name with a JSON input:
# Run any action from the action registry
bunx @1sat/cli action <name> <json>
# Examples
bunx @1sat/cli action sendBsv '{"requests":[{"address":"1A...","satoshis":5000}]}'
bunx @1sat/cli action lockBsv '{"requests":[{"satoshis":10000,"until":900000}]}'
bunx @1sat/cli action inscribe '{"base64Content":"SGVsbG8=","contentType":"text/plain"}'
This is the escape hatch for any operation supported by the @1sat/actions registry, even those without dedicated CLI subcommands.
Output Modes
# JSON output (for scripting/piping)
bunx @1sat/cli wallet balance --json
# Quiet mode (minimal output)
bunx @1sat/cli wallet send --to 1A... --amount 5000 --quiet
# Auto-confirm prompts (non-interactive)
bunx @1sat/cli wallet send --to 1A... --amount 5000 --yes
Init Flow
bunx @1sat/cli init
The init command:
- Prompts for network selection (mainnet/testnet)
- Generates or imports a private key (WIF)
- Encrypts and stores the key at
~/.1sat/keys.bep - Writes config to
~/.1sat/config.json - Tests connectivity to
api.1sat.app
Requirements
- Bun runtime (not Node.js)
- Network access to
api.1sat.app
Package
# Run without installing
bunx @1sat/cli
# Or install globally
bun add -g @1sat/cli
The CLI wraps @1sat/actions, @1sat/wallet-node, and @1sat/client into a single command-line interface.