@open-agent-trust/cli
Advanced tools
+24
-12
@@ -47,3 +47,3 @@ "use strict"; | ||
| try { | ||
| console.log(`Generating Ed25519 keypair for issuer '${options.issuerId}'...\n`); | ||
| console.log(`\nGenerating Ed25519 keypair for issuer '${options.issuerId}'...\n`); | ||
| const privateKeyRaw = ed.utils.randomSecretKey(); | ||
@@ -56,14 +56,26 @@ const publicKeyRaw = await ed.getPublicKeyAsync(privateKeyRaw); | ||
| const kid = `${options.issuerId}-${dateStr}`; | ||
| // Save private key | ||
| const privateKeyPath = path.join(options.outDir, `${options.issuerId}.key`); | ||
| // Save private key with .pem extension (avoid .key which macOS opens as Keynote) | ||
| const privateKeyPath = path.join(options.outDir, `${options.issuerId}.private.pem`); | ||
| fs.writeFileSync(privateKeyPath, privateKeyBase64Url, { mode: 0o600 }); | ||
| console.log(`✅ Success!`); | ||
| console.log(`🔑 Private Key saved to: ${privateKeyPath} (Keep this strictly secret)`); | ||
| console.log(`\nPublic Key Details for Registration:`); | ||
| console.log(`-------------------------------------`); | ||
| console.log(`KID: ${kid}`); | ||
| console.log(`Algorithm: Ed25519`); | ||
| console.log(`Public Key: ${publicKeyBase64Url}`); | ||
| console.log(`-------------------------------------`); | ||
| console.log(`\nYou may now run 'agent-trust register' to scaffold your formal JSON entry.`); | ||
| console.log(`✅ Keypair generated successfully!\n`); | ||
| console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`); | ||
| console.log(` Private Key: ${privateKeyPath}`); | ||
| console.log(` KID: ${kid}`); | ||
| console.log(` Algorithm: Ed25519`); | ||
| console.log(` Public Key: ${publicKeyBase64Url}`); | ||
| console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`); | ||
| console.log(`⚠️ Keep your private key secret. Never commit it to a repo.\n`); | ||
| console.log(`Next steps:\n`); | ||
| console.log(` 1. Add your public key to your agent.json for Tier 3 identity:\n`); | ||
| console.log(` "identity": {`); | ||
| console.log(` "did": "did:web:yourdomain.com",`); | ||
| console.log(` "public_key": "${publicKeyBase64Url}"`); | ||
| console.log(` }\n`); | ||
| console.log(` 2. Host a DID document at https://yourdomain.com/.well-known/did.json`); | ||
| console.log(` (See docs: https://agentinternetruntime.com/spec/agent-json#becoming-tier-3)\n`); | ||
| console.log(` 3. To register as a trusted runtime issuer in the Trust Registry:`); | ||
| console.log(` npx @open-agent-trust/cli register --issuer-id ${options.issuerId} \\`); | ||
| console.log(` --display-name "Your Display Name" --website https://yourdomain.com \\`); | ||
| console.log(` --contact security@yourdomain.com --public-key ${publicKeyBase64Url}\n`); | ||
| console.log(` 4. To read your private key: cat ${privateKeyPath}\n`); | ||
| } | ||
@@ -70,0 +82,0 @@ catch (err) { |
+1
-1
| { | ||
| "name": "@open-agent-trust/cli", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "CLI utilities for the Open Agent Trust Registry", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+26
-13
@@ -13,3 +13,3 @@ import * as ed from '@noble/ed25519'; | ||
| try { | ||
| console.log(`Generating Ed25519 keypair for issuer '${options.issuerId}'...\n`); | ||
| console.log(`\nGenerating Ed25519 keypair for issuer '${options.issuerId}'...\n`); | ||
@@ -26,16 +26,29 @@ const privateKeyRaw = ed.utils.randomSecretKey(); | ||
| // Save private key | ||
| const privateKeyPath = path.join(options.outDir, `${options.issuerId}.key`); | ||
| // Save private key with .pem extension (avoid .key which macOS opens as Keynote) | ||
| const privateKeyPath = path.join(options.outDir, `${options.issuerId}.private.pem`); | ||
| fs.writeFileSync(privateKeyPath, privateKeyBase64Url, { mode: 0o600 }); | ||
| console.log(`✅ Success!`); | ||
| console.log(`🔑 Private Key saved to: ${privateKeyPath} (Keep this strictly secret)`); | ||
| console.log(`\nPublic Key Details for Registration:`); | ||
| console.log(`-------------------------------------`); | ||
| console.log(`KID: ${kid}`); | ||
| console.log(`Algorithm: Ed25519`); | ||
| console.log(`Public Key: ${publicKeyBase64Url}`); | ||
| console.log(`-------------------------------------`); | ||
| console.log(`\nYou may now run 'agent-trust register' to scaffold your formal JSON entry.`); | ||
| console.log(`✅ Keypair generated successfully!\n`); | ||
| console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`); | ||
| console.log(` Private Key: ${privateKeyPath}`); | ||
| console.log(` KID: ${kid}`); | ||
| console.log(` Algorithm: Ed25519`); | ||
| console.log(` Public Key: ${publicKeyBase64Url}`); | ||
| console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`); | ||
| console.log(`⚠️ Keep your private key secret. Never commit it to a repo.\n`); | ||
| console.log(`Next steps:\n`); | ||
| console.log(` 1. Add your public key to your agent.json for Tier 3 identity:\n`); | ||
| console.log(` "identity": {`); | ||
| console.log(` "did": "did:web:yourdomain.com",`); | ||
| console.log(` "public_key": "${publicKeyBase64Url}"`); | ||
| console.log(` }\n`); | ||
| console.log(` 2. Host a DID document at https://yourdomain.com/.well-known/did.json`); | ||
| console.log(` (See docs: https://agentinternetruntime.com/spec/agent-json#becoming-tier-3)\n`); | ||
| console.log(` 3. To register as a trusted runtime issuer in the Trust Registry:`); | ||
| console.log(` npx @open-agent-trust/cli register --issuer-id ${options.issuerId} \\`); | ||
| console.log(` --display-name "Your Display Name" --website https://yourdomain.com \\`); | ||
| console.log(` --contact security@yourdomain.com --public-key ${publicKeyBase64Url}\n`); | ||
| console.log(` 4. To read your private key: cat ${privateKeyPath}\n`); | ||
| } catch (err) { | ||
@@ -42,0 +55,0 @@ console.error('Failed to generate keypair:', err); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
34586
7.56%706
3.52%9
12.5%