Bech32 (`npub...`) から hex に変換するスクリプトを追加しておきました。
https://github.com/susumuota/nostr-keyx/blob/main/bin/npub2hex.ts
npx ts-node-esm bin/npub2hex.ts "nsec..."
npx ts-node-esm bin/npub2hex.ts "npub..."
秘密鍵は環境変数に入れておいたほうがシェルのヒストリに残らないので少し安全かもしれません。
npx ts-node-esm bin/npub2hex.ts $NOSTR_NSEC
npx ts-node-esm bin/npub2hex.ts $NOSTR_NPUB