blossom-cli
v0.1.0
Published
A small CLI for basic Blossom server operations using NDK Blossom.
Readme
blossom-cli
blossom-cli is a small command line tool for direct Blossom server operations.
It is designed around real-world flows that work well with https://blossom.primal.net:
- generate a signer when you do not already have an
nsec - upload files
- list a signer's blobs
- check whether a blob exists
- delete a blob
- generate optimized media URLs
Install
npm install -g blossom-cliOr run it without installing:
npx blossom-cli helpQuick Start
If you do not already have an nsec, generate one:
npx blossom-cli keygenThen use the returned nsec for authenticated commands:
BLOSSOM_NSEC='nsec1...' npx blossom-cli upload ./photo.jpg --server blossom.primal.netRead-only commands do not need a signer:
npx blossom-cli exists <sha256> --server blossom.primal.net
npx blossom-cli optimize-url https://blossom.primal.net/<sha256> --width 1024 --format webpCommands
keygen
Generate a disposable Blossom signer:
npx blossom-cli keygenThis is useful when you want to publish a file but do not already have an nsec.
If you want to list or delete blobs later, keep the generated nsec.
upload
BLOSSOM_NSEC='nsec1...' npx blossom-cli upload ./hello.txt --server blossom.primal.netlist
BLOSSOM_NSEC='nsec1...' npx blossom-cli list --server blossom.primal.netYou can also list by --pubkey or --npub.
exists
npx blossom-cli exists <sha256> --server blossom.primal.netdelete
BLOSSOM_NSEC='nsec1...' npx blossom-cli delete <sha256> --server blossom.primal.netoptimize-url
npx blossom-cli optimize-url https://blossom.primal.net/<sha256> --width 768 --format webpNotes
- Server names without a scheme are normalized to
https://. - Authenticated commands use a kind
24242Blossom auth event. - The tool does not require relays for direct server operations.
- The bundled npm package is built so it works under plain
node, which is whatnpxuses.
Skill
This repo also contains a Codex skill for Blossom publishing workflows in blossom-publishing/SKILL.md.
