From aa2ab543b64a0b05980c080273bc3b95c65a5072 Mon Sep 17 00:00:00 2001 From: Chad Miller Date: Mon, 5 Jan 2026 08:40:13 -0800 Subject: [PATCH] feat: add credentials file output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .gitignore | 1 + scripts/setup.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/.gitignore b/.gitignore index 41a2578..de39e73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .wrangler/ node_modules/ +credentials-*.json diff --git a/scripts/setup.js b/scripts/setup.js index ef0c855..2907ea7 100644 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -10,6 +10,7 @@ */ import { webcrypto } from 'crypto' +import { writeFileSync } from 'fs' // === ARGUMENT PARSING === @@ -388,6 +389,12 @@ async function notifyRelay(relayUrl, pdsHostname) { return true } +// === CREDENTIALS OUTPUT === + +function saveCredentials(filename, credentials) { + writeFileSync(filename, JSON.stringify(credentials, null, 2)) +} + // === MAIN === async function main() { @@ -440,6 +447,29 @@ async function main() { console.log(' Relay notified!') } console.log('') + + // Step 6: Save credentials + const credentials = { + handle: fullHandle, + did, + privateKeyHex: bytesToHex(keyPair.privateKey), + didKey, + pdsUrl: opts.pds, + createdAt: new Date().toISOString() + } + + const credentialsFile = `./credentials-${opts.handle}.json` + saveCredentials(credentialsFile, credentials) + + // Final output + console.log('Setup Complete!') + console.log('===============') + console.log(`Handle: ${fullHandle}`) + console.log(`DID: ${did}`) + console.log(`PDS: ${opts.pds}`) + console.log('') + console.log(`Credentials saved to: ${credentialsFile}`) + console.log('Keep this file safe - it contains your private key!') } main().catch(err => { -- 2.51.2