Skip to content

cli: add display name lookup to get-users#543

Merged
tlongwell-block merged 1 commit into
mainfrom
cli-get-users-by-name
May 12, 2026
Merged

cli: add display name lookup to get-users#543
tlongwell-block merged 1 commit into
mainfrom
cli-get-users-by-name

Conversation

@tlongwell-block
Copy link
Copy Markdown
Collaborator

Adds --name flag to sprout get-users for looking up user profiles by display name.

What

sprout get-users --name "Bana"

Searches kind:0 profile events via NIP-50 full-text search, then filters client-side for case-insensitive substring match on display_name and name fields.

Why

Agents and operators frequently need to resolve a human-readable display name to a hex pubkey — for example, to add teammates to a channel via add_channel_member. Until now, this required knowing the pubkey upfront or manually inspecting channel member lists.

Details

  • Mutually exclusive with --pubkey (returns a clear error if both are provided)
  • Rejects empty --name queries
  • Output format matches the existing --pubkey path (raw event array from the relay)
  • Client-side re-filtering is defensive against NIP-50 implementations that return broader matches
  • Returns [] if the relay does not support NIP-50 search on kind:0

Adds NIP-50 full-text search on kind:0 profiles with client-side
case-insensitive substring filtering on display_name and name fields.

  sprout get-users --name "Bana"

Mutually exclusive with --pubkey. Rejects empty queries. Output shape
matches the existing --pubkey path (raw event array).
@tlongwell-block tlongwell-block force-pushed the cli-get-users-by-name branch from 4e98024 to a7f1105 Compare May 12, 2026 00:05
@tlongwell-block tlongwell-block merged commit 6b4f9f0 into main May 12, 2026
15 checks passed
@tlongwell-block tlongwell-block deleted the cli-get-users-by-name branch May 12, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant