| name | cli |
| description | This skill should be used when working with the 1Sat CLI tool for BSV operations from the terminal -- running wallet commands, minting ordinals, managing tokens, creating listings, locking BSV, sweeping assets, managing identity, OR running the wallet-storage RPC server (`1sat serve`) from the same binary. Triggers on '1sat CLI', 'command line wallet', '1sat init', '1sat wallet', '1sat ordinals', '1sat tokens', '1sat lock', '1sat sweep', '1sat action', '1sat serve', '1sat serve wallet', '1sat serve monitor', 'wallet server', 'BRC-100 storage server', 'bunx @1sat/cli', or 'terminal BSV operations'. Uses @1sat/cli and @1sat/wallet-server packages. |
1Sat CLI
Bun-native command-line interface for 1Sat Ordinals and BSV operations. Binary name: 1sat.
Usage
bunx @1sat/cli <command>
bun add -g @1sat/cli
Quick Start
bunx @1sat/cli init
bunx @1sat/cli wallet balance
bunx @1sat/cli ordinals list
bunx @1sat/cli wallet send --to 1Address... --sats 50000
If installed globally (bun add -g @1sat/cli), replace bunx @1sat/cli with just 1sat.
Configuration
Config directory: ~/.1sat/cli/ (file: config.json).
Config command
1sat config show
1sat config set <dotted.path> <value>
1sat config unset <dotted.path>
1sat config path
Values are stored in their native JSON type when the raw argument is valid JSON (numbers, booleans, arrays, objects, quoted strings); bare words fall back to string. Examples:
1sat config set chain main
1sat config set server.port 8100
1sat config set server.accounts.enabled true
1sat config set server.accounts.freeIdentityKeys '["02aa...","02bb..."]'
Nested subtrees (like server / server.storage / server.accounts) are created automatically on set and persist as JSON objects in the file.
Monitor (Background Sync)
The CLI runs the wallet's transaction-lifecycle Monitor once on every invocation when local storage is active. The Monitor services pending broadcasts, merkle proofs, and related tasks. Individual tasks self-throttle on their own intervals, so running many CLI commands in rapid succession does not trigger repeated work — it's a cheap no-op once each task's interval is satisfied.
There is no user-facing monitor configuration. No interval knob, no disable flag — nothing to tune. If a remote is the active storage, the server runs its own monitor and the CLI skips firing one client-side.
Database Locations
- Wallet DB:
~/.1sat/data/wallet-main.db (or wallet-test.db for testnet)
- Sync DB:
~/.1sat/data/sync-<identityKeyPrefix>.db
- Config:
~/.1sat/config.json
- Keys:
~/.1sat/keys.bep
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 by bap touchid enable and clawnet setup-key.
- Environment variable: Set
PRIVATE_KEY_WIF with your WIF private key
- Encrypted keystore: Stored at
~/.1sat/keys.bep (created during bunx @1sat/cli init)
PRIVATE_KEY_WIF=L1abc... bunx @1sat/cli wallet balance
bunx @1sat/cli init
bunx @1sat/cli wallet balance
Commands
All examples below use bunx @1sat/cli. If installed globally, use 1sat instead.
Wallet
bunx @1sat/cli wallet balance
bunx @1sat/cli wallet address
bunx @1sat/cli wallet address --count 5 --start-index 0
bunx @1sat/cli wallet address --prefix mcp --count 3
bunx @1sat/cli wallet send --to 1A... --sats 5000
bunx @1sat/cli wallet send --script <hex> --sats 5000
bunx @1sat/cli wallet send --data-asm "deadbeef cafe"
bunx @1sat/cli wallet send-all --to 1A...
bunx @1sat/cli wallet sync --prefix mcp --count 5
bunx @1sat/cli wallet info
wallet send modes are mutually exclusive: --to (P2PKH), --script (custom hex), or --data-asm (OP_RETURN, 0 sats — rejects --sats). The ASM string is passed straight to Script.fromASM('OP_0 OP_RETURN ' + asm), so multiple space-separated hex pushes are supported in one output.
BRC-100 interface
Lower-level BRC-100 wallet operations are also exposed:
bunx @1sat/cli wallet list-outputs --basket <name> [--tags <t1,t2>] [--limit <n>] [--include-tags]
bunx @1sat/cli wallet relinquish-output --basket <name> --output <txid.vout>
bunx @1sat/cli wallet list-actions [--labels <l1,l2>] [--limit <n>]
bunx @1sat/cli wallet create-action '<json>'
bunx @1sat/cli wallet sign-action '<json>'
bunx @1sat/cli wallet abort-action --reference <ref>
bunx @1sat/cli wallet list-certificates [--certifiers <c1,c2>] [--types <t1,t2>] [--limit <n>]
bunx @1sat/cli wallet relinquish-certificate --type <t> --serialNumber <s> --certifier <c>
Remote Storage
bunx @1sat/cli remote add <url>
bunx @1sat/cli remote list
bunx @1sat/cli remote delete <url>
bunx @1sat/cli remote set-active <url>
bunx @1sat/cli remote set-active local
bunx @1sat/cli remote status [url]
bunx @1sat/cli remote topup [url]
Ordinals
bunx @1sat/cli ordinals list
bunx @1sat/cli ordinals mint --file image.png
bunx @1sat/cli ordinals mint --file note.txt --type text/plain
bunx @1sat/cli ordinals mint --file image.png --map '{"name":"NFT 1"}'
bunx @1sat/cli ordinals mint --file image.png --sign-with-bap
bunx @1sat/cli ordinals transfer --outpoint <op> --to <addr>
Marketplace (OrdLock)
bunx @1sat/cli ordinals sell --outpoint <txid.vout> --price <sats>
bunx @1sat/cli ordinals cancel --outpoint <txid.vout>
bunx @1sat/cli ordinals buy --outpoint <txid.vout>
bunx @1sat/cli ordinals burn --outpoints <op1,op2,...>
Tokens (BSV21)
bunx @1sat/cli tokens balances
bunx @1sat/cli tokens list [--token-id <id>]
bunx @1sat/cli tokens send --token-id <id> --amount <n> --to <addr>
bunx @1sat/cli tokens deploy-mint --symbol <ticker> --amount <total-supply>
bunx @1sat/cli tokens deploy-auth --symbol <ticker>
bunx @1sat/cli tokens mint --token-id <id> --amount <n>
bunx @1sat/cli tokens buy --outpoint <txid.vout> --token-id <id> --amount <n>
tokens send destination is one of --to <address>, --counterparty <pubkey-hex>, or --locking-script <hex>. Paymail recipients are not supported for BSV21 transfers — there is no ecosystem spec for paymail-delivered token outputs. Use --to <address> instead. deploy-mint/deploy-auth/mint accept --decimals <0-18>, --icon <url-or-data-uri>, and the same destination flags; mint also takes --auth-to/--auth-counterparty/--auth-locking-script and --end-minting.
Locks (Timelock)
bunx @1sat/cli locks info
bunx @1sat/cli locks lock --sats <amount> --blocks <n>
bunx @1sat/cli locks unlock
Identity (BAP)
bunx @1sat/cli identity create
bunx @1sat/cli identity info
bunx @1sat/cli identity update-profile --profile '{"name":"..."}'
bunx @1sat/cli identity sign --message "hello"
bunx @1sat/cli identity sign --message 68656c6c6f --encoding hex
identity sign uses BSM (Bitcoin Signed Message) compact format. --encoding accepts utf8 (default), hex, or base64 — it only controls how --message is decoded to bytes; the same bytes always produce the same signature. identity verify exists in the command tree but is marked unavailable (not yet implemented).
Social (BSocial)
bunx @1sat/cli social post --content "hello world"
bunx @1sat/cli social post --content "# heading" --content-type text/markdown
bunx @1sat/cli social post --content "ordinals drop" --tags bsv,ordinals,nft
bunx @1sat/cli social post --content "..." --app my-app
Tags (--tags a,b,c) land on the on-chain post's MAP payload and on the wallet output as tag:<value>, so wallet list-outputs --tags tag:bsv finds your own posts by tag. --content-type accepts text/plain (default) or text/markdown.
OpNS Names
bunx @1sat/cli opns register --outpoint <txid.vout>
bunx @1sat/cli opns deregister --outpoint <txid.vout>
bunx @1sat/cli opns lookup
Sweep / Import
bunx @1sat/cli sweep scan --wif <key>
bunx @1sat/cli sweep import --wif <key>
sweep import branches internally by asset type — it sweeps funding (BSV), ordinals, and each active BSV21 token in separate transactions. RUN token outputs are detected and excluded (not sweepable).
Transaction Utilities
bunx @1sat/cli tx decode <hex>
Serve (Wallet Storage RPC Server)
The same binary can run a BRC-100 wallet storage RPC server backed by the same wallet instance the CLI commands use.
1sat serve
1sat serve wallet
1sat serve monitor
1sat serve messagebox
Key properties:
- Same wallet instance —
serve wraps the wallet created by createNodeWallet using the exact same config inputs (chain, dataDir, storageIdentityKey, activeRemote, backups) as 1sat wallet <command>. There's one wallet on disk at ~/.1sat/data/wallet-${chain}.db; HTTP and CLI access the same one.
- Server identity = CLI identity — loaded via
loadKey() (PRIVATE_KEY_WIF env or keys.bep + ONESAT_PASSWORD). No separate server key.
- Storage provider — defaults to
bun-sqlite. Set server.storage.provider to pg for Postgres deployments.
- Accounts layer (opt-in) — per-identity capacity metering on billable writes. Reads always free. Over-capacity writes get an HTTP
507 Insufficient Storage with a JSON body describing deficit + pricing. Top-up via POST /account/payment (BRC-29 payment body). Toggle via 1sat config set server.accounts.enabled true.
Server-specific settings live under server.* in the config — edit via 1sat config set:
1sat config set server.port 8100
1sat config set server.host 0.0.0.0
1sat config set server.accounts.enabled true
1sat config set server.accounts.baselineBytes 1073741824
1sat config set server.accounts.purchaseUnitBytes 1073741824
1sat config set server.accounts.satsPerUnit 1000000
1sat config set server.accounts.durationBlocks 4383
Pricing model: new payments charge unitsCharged × satsPerUnit (rounded up to a whole chunk) for durationBlocks from now, minus a prorated refund credit for unused time on the prior payment. One active payment row per account at a time.
Defaults when keys are unset:
server.host → 127.0.0.1
server.port → 8100
server.storage.provider → bun-sqlite
server.accounts.enabled → false
server.accounts.baselineBytes → 1073741824 (1 GB)
server.accounts.purchaseUnitBytes → 1073741824 (1 GB)
server.accounts.satsPerUnit → 1000000
server.accounts.durationBlocks → 4383
Action Escape Hatch
Any registered action can be invoked directly by name with a JSON input:
bunx @1sat/cli action <name> <json>
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.
Origin Tag Resolution
When working with ordinal outputs from ordinals list --json, the tags array indicates origin relationships for building content URLs:
"origin" (bare tag, no colon) — This output IS the origin. Use the output's own outpoint for content URLs.
"origin:<txid.vout>" (tag with colon and outpoint) — This is a transfer. Use the origin outpoint from the tag for content URLs.
Example:
{
"outpoint": "5148d8dae125c2851283ca90519eae787ab24baca5a008ee72c03ba3c290def4.1",
"tags": ["origin:04fc3e5f92004f89c7efe94fb97113bd672faa87708f9e0cd67fdef861767c2c.0", ...]
}
→ Content URL: .../content/04fc3e5f92004f89c7efe94fb97113bd672faa87708f9e0cd67fdef861767c2c.0 (from tag)
{
"outpoint": "a70be5c136d23ab10fbe1e4344552797faa5017ff7f5a58c4b9bf14e7a3e1006.0",
"tags": ["origin", ...]
}
→ Content URL: .../content/a70be5c136d23ab10fbe1e4344552797faa5017ff7f5a58c4b9bf14e7a3e1006.0 (own outpoint)
Outpoint format: Always use the outpoint as-is (txid.vout or txid_vout). Do NOT modify the separator.
Global Flags
| Flag | Description |
|---|
--json | Output as JSON (for scripting/piping) |
--quiet, -q | Suppress output |
--yes, -y | Skip confirmations |
--chain <main|test> | Network (default: main) |
--help, -h | Show help |
--version, -v | Show version |
Output Modes
bunx @1sat/cli wallet balance --json
bunx @1sat/cli wallet send --to 1A... --sats 5000 --quiet
bunx @1sat/cli wallet send --to 1A... --sats 5000 --yes
Init Flow
bunx @1sat/cli init
The init command:
- Prompts for network selection (mainnet/testnet)
- Generates or imports a private key (WIF)
- Sets a password and encrypts the key to
~/.1sat/keys.bep
- On macOS arm64, optionally enables Touch ID to cache the password via
@1sat/vault
- Optionally configures a primary remote storage URL (local becomes backup)
- Writes config to
~/.1sat/config.json (chain, generated storageIdentityKey, activeRemote)
Requirements
- Bun runtime (not Node.js)
- Network access to
api.1sat.app
Package
bunx @1sat/cli
bun add -g @1sat/cli
The CLI wraps @1sat/actions, @1sat/wallet-node, @1sat/client, and @1sat/wallet-server (for the serve subcommand) into a single command-line interface.