buzz-cli: --pubkey flags reject npub while --mention accepts it
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
### Problem
Every `--pubkey` flag in `buzz-cli` validates with `validate_hex64` (`crates/buzz-cli/src/validate.rs:29`), so it only accepts 64-char hex. But `messages send --mention` normalizes with `nostr::PublicKey::parse` (`crates/buzz-cli/src/commands/messages.rs:231-232`), which accepts hex *and* bech32 `npub1…`.
The result is an inconsistent surface, and it bites during the most common onboarding path: Buzz Desktop and chat both surface an `npub`, so adding a new member requires a manual bech32 decode before this works:
```
buzz channels add-member --channel --pubkey <64-char-hex> --role member
```
Passing the npub fails with `must be a 64-character hex string: npub1…`, and there is no `npub`↔hex conversion subcommand in the CLI.
### Proposal
Add a `normalize_pubkey` helper that accepts either form and returns lowercase hex, and use it for user-identity flags: `channels add-member`/`remove-member`, `users get`/`presence`, `dms open`/`add-member`, `moderation ban`/`unban`/`timeout`/`untimeout`, `agents archive`/`unarchive`.
Git-protocol pubkey fields (repo owner, patch/PR/issue author and recipient) are copied from CLI output rather than typed by hand, so those can stay hex-only for now.
Contributor guide
Assessment
This issue has not been assessed yet.