Skip to content

Routstr/routstrd-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

routstrd-client

Small NIP-98 client for managing routstrd clients and admin npubs.

Setup

bun install
cp .env.example .env

Edit .env:

NSEC=nsec1...
HOST_URL=http://localhost:8008

NSEC is the Nostr private key used for NIP-98 admin requests. HOST_URL must be the public base URL that routstrd-auth sees, because NIP-98 signs the exact request URL.

Usage

# Add a client, then list clients
bun run start -- --name "My Laptop"

# List clients only
bun run start

# JSON output
bun run start -- --json

CLI flags can override .env values:

bun run start -- --url http://localhost:8008 --key nsec1... --name "My Laptop"

Admin npubs

The client understands routstrd-auth's /npubs endpoints.

# List configured admin npubs. This does not require a key.
bun run start -- --list-npubs

# Add an admin npub/pubkey.
# If no admins exist yet, this first add is unauthenticated.
# Once admins exist, --key must belong to an existing admin.
bun run start -- --add-npub npub1...
bun run start -- --key nsec1... --add-npub npub1...

# Delete an admin npub/pubkey. Requires --key from an existing admin.
bun run start -- --key nsec1... --delete-npub npub1...

When normal client management is run with --key, the CLI checks /npubs first. If no admin npubs are configured, it automatically bootstraps the public npub for --key as the first admin before calling /clients/add or /clients.

Disable that automatic first-admin bootstrap with:

bun run start -- --no-bootstrap-admin --key nsec1...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors