deploy¶
Deploy files from a directory to configured relays and blossom servers.
Usage¶
<folder>: The directory to deploy (required)
Options¶
-f, --force— Force publishing even if no changes were detected (default: false)-s, --servers <servers>— The blossom servers to use (comma separated)-r, --relays <relays>— The nostr relays to use (comma separated)-k, --privatekey <nsec>— The private key (nsec/hex) to use for signing-b, --bunker <url>— The NIP-46 bunker URL to use for signing--nbunksec <nbunksec>— The NIP-46 bunker encoded as nbunksec-p, --purge— Delete online file events that are not used anymore (default: false)-v, --verbose— Verbose output (default: false)-c, --concurrency <number>— Number of parallel uploads (default: 4)--publish-server-list— Publish the list of blossom servers (Kind 10063) (default: false)--publish-relay-list— Publish the list of nostr relays (Kind 10002) (default: false)--publish-profile— Publish the app profile for the npub (Kind 0) (default: false)--app-handler— Publish NIP-89 app handler announcement (Kind 31990) (default: false)--handler-kinds <kinds>— Event kinds this nsite can handle (comma separated)--publish-file-metadata— Publish NIP-94 file metadata events for releases (default: false)--version <version>— Version tag for the release (required when using --publish-file-metadata)--release-artifacts <paths>— Comma-separated paths to existing archives to publish as release artifacts--fallback <file>— An HTML file to copy and publish as 404.html-i, --non-interactive— Run in non-interactive mode (default: false)
Examples¶
Deploy the dist directory:
Deploy with custom relays and servers:
Deploy with force and purge options:
Deploy with metadata events:
Deploy with app handler announcement:
Deploying Releases¶
Deploy with release artifacts:
nsyte deploy dist --publish-file-metadata --version v1.0.0
nsyte deploy dist --publish-file-metadata --version v1.0.0 --release-artifacts dist.tar.gz,dist.zip
How it Works¶
The deploy command:
- Scans your local directory for files
- Compares with previously deployed files (using SHA256 hashes)
- Uploads only changed or new files to Blossom servers
- Publishes file events (NIP-96) to configured relays
- Optionally publishes metadata events for discovery
Authentication¶
The deploy command requires authentication to sign nostr events. You can provide authentication through:
- Private key: Use
--privatekeywith an nsec or hex key - Bunker: Use
--bunkerwith a bunker URL - nbunksec: Use
--nbunksecwith an encoded bunker secret - Project config: If configured during
nsyte init
Performance¶
- Smart diffing: Only uploads changed files
- Parallel uploads: Use
--concurrencyto control parallel uploads - Progress tracking: Shows upload progress with visual indicators
Metadata Publishing¶
Profile (Kind 0)¶
Use --publish-profile to publish a nostr profile for your npub. This helps with discovery.
Relay List (Kind 10002)¶
Use --publish-relay-list to publish your preferred relays. This helps clients know where to find your content.
Server List (Kind 10063)¶
Use --publish-server-list to publish your Blossom servers. This helps clients know where to download files.
App Handler (Kind 31990)¶
Use --app-handler to announce your nsite as a NIP-89 application handler. Specify which event kinds your app can handle with --handler-kinds.
File Metadata (Kind 1063)¶
Use --publish-file-metadata with --version to publish release metadata. This is useful for distributing software releases.
Error Handling¶
- Network errors: Automatically retried with exponential backoff
- Authentication errors: Clear messages about missing or invalid credentials
- Upload failures: Detailed error messages for each failed file
- Relay rejections: Shows which relays accepted or rejected events
See Also¶
nsyte init- Initialize a new nsyte projectnsyte ls- List deployed filesnsyte browse- Interactive file browsernsyte purge- Remove deployed filesnsyte serve- Serve files locally for testing