Skip to content

download

Download files from the nostr network for a given public key.

Usage

bash
nsyte download [options]

Options

  • -o, --output <dir> — Output directory to save files (default: ./downloads)
  • -r, --relays <relays> — Nostr relays to query (comma-separated)
  • -s, --servers <servers> — Blossom servers to download from (comma-separated)
  • --sec <secret> — Secret for signing (auto-detects: nsec, nbunksec, bunker://, hex)
  • -p, --pubkey <npub> — Public key to download files from (npub or hex)
  • -d, --name <name> — Site identifier for named sites. If not provided, downloads root site
  • --overwrite — Overwrite existing files (default: false)
  • -v, --verbose — Verbose output showing detailed download progress (default: false)

Examples

Download files to default directory (./downloads):

bash
nsyte download

Download to custom directory:

bash
nsyte download -o ./backup

Download files for a specific public key:

bash
nsyte download -p npub1... -o ./backup

Download a named site:

bash
nsyte download -d blog -o ./blog-backup

Download with overwrite enabled:

bash
nsyte download -o ./backup --overwrite

Download with verbose output:

bash
nsyte download -v -o ./backup

How it Works

  1. Discovers site: Queries relays for site manifest (kind 15128 or 35128)
  2. Fetches file list: Retrieves all files from the manifest
  3. Resolves servers: Uses servers from --servers if provided, otherwise from the project's .nsite/config.json
  4. Downloads concurrently: Downloads up to 3 files in parallel
  5. Preserves structure: Recreates directory structure in output folder
  6. Skips existing: By default, won't overwrite existing files unless --overwrite is used

Performance

  • Concurrent downloads: Downloads 3 files at a time by default
  • Smart skipping: Skips files that already exist (unless --overwrite)
  • Multiple sources: Tries multiple blossom servers for reliability
  • Progress tracking: Shows download progress with file counts

Output Summary

After downloading, displays:

  • Success count: Files successfully downloaded
  • Skipped count: Files that already existed
  • Failed count: Files that couldn't be downloaded
  • Saved paths: List of all downloaded file paths

Authentication

Authentication is optional for downloading public files. Provide authentication if:

  • Downloading from private/restricted relays
  • Need to access gated content
  • Want to use project-configured relays

Use --sec with any supported format or rely on project config bunker.

See Also

Inherits global options. See global options.

Published to the decentralized web with nsyte.