@imagxp/protocol 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import { generateKeyPair, exportPrivateKey, exportPublicKey } from './crypto.js';
3
+ async function main() {
4
+ const args = process.argv.slice(2);
5
+ const command = args[0];
6
+ if (command === 'generate-identity') {
7
+ console.log('Generating new IMAGXP Identity...');
8
+ const keyPair = await generateKeyPair();
9
+ const privateKey = await exportPrivateKey(keyPair.privateKey);
10
+ const publicKey = await exportPublicKey(keyPair.publicKey);
11
+ console.log('\n--- IMAGXP IDENTITY ---');
12
+ console.log(`IMAGXP_PRIVATE_KEY="${privateKey}"`);
13
+ console.log(`IMAGXP_PUBLIC_KEY="${publicKey}"`);
14
+ console.log('-----------------------\n');
15
+ console.log('Save these to your .env file immediately!');
16
+ }
17
+ else {
18
+ console.log('Usage: imagxp generate-identity');
19
+ process.exit(1);
20
+ }
21
+ }
22
+ main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imagxp/protocol",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "TypeScript reference implementation of IMAGXP v1.1",
5
5
  "keywords": [
6
6
  "imagxp",
package/src/cli.ts ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { generateKeyPair, exportPrivateKey, exportPublicKey } from './crypto.js';
3
+ declare const process: any;
4
+
5
+ async function main() {
6
+ const args = process.argv.slice(2);
7
+ const command = args[0];
8
+
9
+ if (command === 'generate-identity') {
10
+ console.log('Generating new IMAGXP Identity...');
11
+ const keyPair = await generateKeyPair();
12
+ const privateKey = await exportPrivateKey(keyPair.privateKey);
13
+ const publicKey = await exportPublicKey(keyPair.publicKey);
14
+
15
+ console.log('\n--- IMAGXP IDENTITY ---');
16
+ console.log(`IMAGXP_PRIVATE_KEY="${privateKey}"`);
17
+ console.log(`IMAGXP_PUBLIC_KEY="${publicKey}"`);
18
+ console.log('-----------------------\n');
19
+ console.log('Save these to your .env file immediately!');
20
+ } else {
21
+ console.log('Usage: imagxp generate-identity');
22
+ process.exit(1);
23
+ }
24
+ }
25
+
26
+ main().catch(console.error);