@powerhousedao/ph-cli 5.1.0-staging.0 → 5.2.0-dev.1

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.
Files changed (74) hide show
  1. package/dist/src/cli.js +1 -1
  2. package/dist/src/cli.js.map +1 -1
  3. package/dist/src/commands/access-token.d.ts +9 -0
  4. package/dist/src/commands/access-token.d.ts.map +1 -0
  5. package/dist/src/commands/access-token.js +110 -0
  6. package/dist/src/commands/access-token.js.map +1 -0
  7. package/dist/src/commands/generate.d.ts.map +1 -1
  8. package/dist/src/commands/generate.js +2 -1
  9. package/dist/src/commands/generate.js.map +1 -1
  10. package/dist/src/commands/index.d.ts +2 -0
  11. package/dist/src/commands/index.d.ts.map +1 -1
  12. package/dist/src/commands/index.js +2 -0
  13. package/dist/src/commands/index.js.map +1 -1
  14. package/dist/src/commands/login.d.ts +12 -0
  15. package/dist/src/commands/login.d.ts.map +1 -0
  16. package/dist/src/commands/login.js +208 -0
  17. package/dist/src/commands/login.js.map +1 -0
  18. package/dist/src/commands/migrate.d.ts +1 -1
  19. package/dist/src/commands/migrate.d.ts.map +1 -1
  20. package/dist/src/commands/migrate.js +1 -1
  21. package/dist/src/commands/migrate.js.map +1 -1
  22. package/dist/src/commands/register-commands.d.ts.map +1 -1
  23. package/dist/src/commands/register-commands.js +4 -0
  24. package/dist/src/commands/register-commands.js.map +1 -1
  25. package/dist/src/commands/switchboard.d.ts.map +1 -1
  26. package/dist/src/commands/switchboard.js +12 -2
  27. package/dist/src/commands/switchboard.js.map +1 -1
  28. package/dist/src/help.d.ts +9 -1
  29. package/dist/src/help.d.ts.map +1 -1
  30. package/dist/src/help.js +164 -9
  31. package/dist/src/help.js.map +1 -1
  32. package/dist/src/services/auth.d.ts +69 -0
  33. package/dist/src/services/auth.d.ts.map +1 -0
  34. package/dist/src/services/auth.js +171 -0
  35. package/dist/src/services/auth.js.map +1 -0
  36. package/dist/src/services/generate.d.ts +2 -1
  37. package/dist/src/services/generate.d.ts.map +1 -1
  38. package/dist/src/services/generate.js +15 -8
  39. package/dist/src/services/generate.js.map +1 -1
  40. package/dist/src/services/migrate.d.ts +7 -0
  41. package/dist/src/services/migrate.d.ts.map +1 -0
  42. package/dist/src/services/{migrate/migrate.js → migrate.js} +16 -12
  43. package/dist/src/services/migrate.js.map +1 -0
  44. package/dist/src/services/switchboard.d.ts +12 -0
  45. package/dist/src/services/switchboard.d.ts.map +1 -1
  46. package/dist/src/services/switchboard.js +10 -1
  47. package/dist/src/services/switchboard.js.map +1 -1
  48. package/dist/src/version.d.ts +1 -1
  49. package/dist/src/version.js +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +10 -8
  52. package/dist/src/services/migrate/migrate.d.ts +0 -7
  53. package/dist/src/services/migrate/migrate.d.ts.map +0 -1
  54. package/dist/src/services/migrate/migrate.js.map +0 -1
  55. package/dist/src/services/migrate/migrations/templates/document-models.d.ts +0 -2
  56. package/dist/src/services/migrate/migrations/templates/document-models.d.ts.map +0 -1
  57. package/dist/src/services/migrate/migrations/templates/document-models.js +0 -6
  58. package/dist/src/services/migrate/migrations/templates/document-models.js.map +0 -1
  59. package/dist/src/services/migrate/migrations/templates/editors.d.ts +0 -2
  60. package/dist/src/services/migrate/migrations/templates/editors.d.ts.map +0 -1
  61. package/dist/src/services/migrate/migrations/templates/editors.js +0 -6
  62. package/dist/src/services/migrate/migrations/templates/editors.js.map +0 -1
  63. package/dist/src/services/migrate/migrations/templates/index.d.ts +0 -2
  64. package/dist/src/services/migrate/migrations/templates/index.d.ts.map +0 -1
  65. package/dist/src/services/migrate/migrations/templates/index.js +0 -7
  66. package/dist/src/services/migrate/migrations/templates/index.js.map +0 -1
  67. package/dist/src/services/migrate/migrations/templates/packageJson.d.ts +0 -55
  68. package/dist/src/services/migrate/migrations/templates/packageJson.d.ts.map +0 -1
  69. package/dist/src/services/migrate/migrations/templates/packageJson.js +0 -55
  70. package/dist/src/services/migrate/migrations/templates/packageJson.js.map +0 -1
  71. package/dist/src/services/migrate/migrations/templates/tsConfig.d.ts +0 -2
  72. package/dist/src/services/migrate/migrations/templates/tsConfig.d.ts.map +0 -1
  73. package/dist/src/services/migrate/migrations/templates/tsConfig.js +0 -45
  74. package/dist/src/services/migrate/migrations/templates/tsConfig.js.map +0 -1
@@ -45,7 +45,7 @@ export declare const serviceHelp = "\nCommand Overview:\n The service command m
45
45
  /**
46
46
  * Help text for the switchboard command
47
47
  */
48
- export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command starts a local Switchboard instance, which acts as the document\n processing engine for Powerhouse projects. It provides the infrastructure for document\n models, processors, and real-time updates.\n\n This command:\n 1. Starts a local switchboard server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Enables real-time document processing\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n \n --config-file <path> Path to the powerhouse.config.js file. Default is \n './powerhouse.config.json'. This configures the switchboard behavior.\n \n --dev Enable development mode to load local packages from the current directory.\n This allows the switchboard to discover and load document models, processors,\n and subgraphs from your local development environment.\n \n --db-path <DB_PATH> Path to the database for storing document data.\n \n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n \n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n \n --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment \n variable used by the server to prefix all routes.\n\nExamples:\n $ ph switchboard # Start switchboard with default settings\n $ ph switchboard --port 5000 # Use custom port 5000\n $ ph switchboard --dev # Enable dev mode to load local packages\n $ ph switchboard --config-file custom.json # Use custom configuration file\n $ ph switchboard --packages pkg1 pkg2 # Load specific packages\n $ ph switchboard --base-path /switchboard # Set API base path to /switchboard\n";
48
+ export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command starts a local Switchboard instance, which acts as the document\n processing engine for Powerhouse projects. It provides the infrastructure for document\n models, processors, and real-time updates.\n\n This command:\n 1. Starts a local switchboard server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Enables real-time document processing\n 5. Can authenticate with remote services using your identity from 'ph login'\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n\n --config-file <path> Path to the powerhouse.config.js file. Default is\n './powerhouse.config.json'. This configures the switchboard behavior.\n\n --dev Enable development mode to load local packages from the current directory.\n This allows the switchboard to discover and load document models, processors,\n and subgraphs from your local development environment.\n\n --db-path <DB_PATH> Path to the database for storing document data.\n\n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n\n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n\n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n\n --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment\n variable used by the server to prefix all routes.\n\nIdentity Options:\n --use-identity Enable identity using the keypair from 'ph login'. This allows the\n switchboard to authenticate with remote drives and services using\n your authorized Ethereum identity.\n\n --keypair-path <path> Path to a custom keypair file. Overrides the default .keypair.json\n in the current directory.\n\n --require-identity Require an existing keypair; fail if not found. Use this when you\n want to ensure the switchboard runs with a valid identity. If no\n keypair exists, run 'ph login' first to create one.\n\nExamples:\n $ ph switchboard # Start switchboard with default settings\n $ ph switchboard --port 5000 # Use custom port 5000\n $ ph switchboard --dev # Enable dev mode to load local packages\n $ ph switchboard --config-file custom.json # Use custom configuration file\n $ ph switchboard --packages pkg1 pkg2 # Load specific packages\n $ ph switchboard --base-path /switchboard # Set API base path to /switchboard\n $ ph switchboard --use-identity # Start with identity from ph login\n $ ph switchboard --require-identity # Require identity, fail if not logged in\n";
49
49
  /**
50
50
  * Help text for the reactor command
51
51
  */
@@ -54,4 +54,12 @@ export declare const reactorHelp = "\nCommand Overview:\n The reactor command s
54
54
  * Help text for the version command
55
55
  */
56
56
  export declare const versionHelp = "\nCommand Overview:\n The version command displays the current version of the Powerhouse CLI tool.\n It helps you track which version you're using and ensure compatibility.\n\n This command:\n 1. Retrieves version information from package.json\n 2. Displays the version number of the CLI tool\n 3. Can be used to verify successful installation or updates\n\nOptions:\n --debug Show additional logs during version retrieval. This provides\n more detailed information about how the version is determined,\n which can be helpful for troubleshooting.\n\nExamples:\n $ ph version # Display the CLI version\n $ ph version --debug # Show version with debug information\n\nAliases:\n $ ph v # Shorthand for version\n\nNotes:\n - The version follows semantic versioning (MAJOR.MINOR.PATCH)\n - Using the correct CLI version is important for compatibility with your project\n - Version information is read from the package.json file of the CLI\n";
57
+ /**
58
+ * Help text for the login command
59
+ */
60
+ export declare const loginHelp = "\nCommand Overview:\n The login command authenticates you with Renown using your Ethereum wallet. This enables\n the CLI to act on behalf of your Ethereum identity for authenticated operations.\n\n This command:\n 1. Generates or loads a cryptographic identity (DID) for the CLI\n 2. Opens your browser to the Renown authentication page\n 3. You authorize the CLI's DID to act on behalf of your Ethereum address\n 4. Stores the credentials locally in ~/.ph/auth.json\n\nOptions:\n --renown-url <url> Specify a custom Renown server URL. Defaults to\n https://www.renown.id\n\n --timeout <seconds> Set the authentication timeout in seconds. The command will\n wait this long for you to complete authentication in the browser.\n Defaults to 300 seconds (5 minutes).\n\n --logout Sign out and clear your stored credentials. Use this when you\n want to switch accounts or revoke local authentication.\n\n --status Show your current authentication status without logging in.\n Displays your CLI DID, ETH address, and when you authenticated.\n\n --show-did Show only the CLI's DID and exit. Useful for scripts.\n\nAuthentication Flow:\n 1. Run 'ph login' - the CLI generates/loads its cryptographic identity (DID)\n 2. A browser window opens to Renown with the CLI's DID\n 3. Connect your Ethereum wallet (MetaMask, etc.)\n 4. Authorize the CLI's DID to act on behalf of your ETH address\n 5. Return to your terminal - authentication is complete!\n\nCredentials Storage:\n All identity files are stored per-project in the current working directory:\n\n .keypair.json The CLI's cryptographic keypair (ECDSA P-256)\n .auth.json Your authentication credentials including:\n - Your Ethereum address (the account you authorized)\n - Your User DID (did:pkh:eip155:chainId:address)\n - CLI DID (did:key:... - the CLI's cryptographic identity)\n - Credential ID for session validation\n\n This allows each project to have its own identity and credentials.\n For CI/CD, provide the keypair via PH_RENOWN_PRIVATE_KEY env variable.\n\nEnvironment Variables:\n PH_RENOWN_PRIVATE_KEY JSON-encoded JWK keypair for the CLI's identity.\n If set, the CLI will use this instead of generating\n or loading from file. Useful for CI/CD environments.\n\nExamples:\n $ ph login # Authenticate with default settings\n $ ph login --status # Check authentication status and CLI DID\n $ ph login --show-did # Print only the CLI's DID\n $ ph login --logout # Sign out and clear credentials\n $ ph login --timeout 600 # Wait up to 10 minutes for authentication\n $ ph login --renown-url http://localhost:3000 # Use local Renown server\n\nNotes:\n - You only need to authenticate once; credentials persist until you log out\n - The CLI's DID remains stable unless you delete .keypair.json from your project\n - If already authenticated, the command will show your current status\n - The browser must remain open until authentication completes\n - Your wallet signature authorizes the CLI's DID to act on your behalf\n";
61
+ /**
62
+ * Help text for the access-token command
63
+ */
64
+ export declare const accessTokenHelp = "\nCommand Overview:\n The access-token command generates a bearer token for API authentication. This token\n can be used to authenticate requests to Powerhouse APIs like reactor-api (Switchboard).\n\n This command:\n 1. Uses your CLI's cryptographic identity (DID) to sign a verifiable credential\n 2. Creates a JWT bearer token with configurable expiration\n 3. Outputs the token to stdout (info to stderr) for easy piping\n\nPrerequisites:\n You must have a cryptographic identity. Run 'ph login' first to:\n - Generate a keypair (stored in .keypair.json)\n - Optionally link your Ethereum address (stored in .auth.json)\n\nOptions:\n --expiry <duration> Set the token expiration time. Supports multiple formats:\n - Days: \"7d\" (default), \"30d\", \"1d\"\n - Hours: \"24h\", \"12h\", \"1h\"\n - Seconds: \"3600\", \"3600s\", \"86400s\"\n Default is 7 days.\n\n --audience <url> Optional. Set the intended audience (aud claim) for the token.\n This can be used to restrict the token to specific services.\n\nToken Details:\n The generated token is a JWT (JSON Web Token) containing:\n - Issuer (iss): Your CLI's DID (did:key:...)\n - Subject (sub): Your CLI's DID\n - Credential Subject: Chain ID, network ID, and address (if authenticated)\n - Expiration (exp): Based on --expiry option\n - Audience (aud): If --audience is specified\n\nOutput:\n - Token information (DID, address, expiry) is printed to stderr\n - The token itself is printed to stdout for easy piping/copying\n\n This allows you to use the command in scripts:\n TOKEN=$(ph access-token)\n curl -H \"Authorization: Bearer $TOKEN\" http://localhost:4001/graphql\n\nExamples:\n $ ph access-token # Generate token valid for 7 days\n $ ph access-token --expiry 30d # Generate token valid for 30 days\n $ ph access-token --expiry 24h # Generate token valid for 24 hours\n $ ph access-token --expiry 3600 # Generate token valid for 1 hour (3600 seconds)\n $ ph access-token --audience http://localhost:4001 # Set audience claim\n $ ph access-token | pbcopy # Copy token to clipboard (macOS)\n $ ph access-token | xclip -selection c # Copy token to clipboard (Linux)\n\nUsage with APIs:\n # Generate token and use with curl\n TOKEN=$(ph access-token --expiry 1d)\n curl -X POST http://localhost:4001/graphql \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -d '{\"query\": \"{ drives { id name } }\"}'\n\n # Export as environment variable\n export PH_ACCESS_TOKEN=$(ph access-token)\n\nNotes:\n - Tokens are self-signed using your CLI's private key\n - No network request is made; tokens are generated locally\n - The recipient API must trust your CLI's DID to accept the token\n - For reactor-api, ensure AUTH_ENABLED=true to require authentication\n";
57
65
  //# sourceMappingURL=help.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB,wzEAgD7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,4oCA0B5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,stDAsC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,k/GA+DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;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AAC"}
package/dist/src/help.js CHANGED
@@ -497,29 +497,42 @@ Command Overview:
497
497
  2. Loads document models and processors
498
498
  3. Provides an API for document operations
499
499
  4. Enables real-time document processing
500
+ 5. Can authenticate with remote services using your identity from 'ph login'
500
501
 
501
502
  Options:
502
503
  --port <PORT> Port to host the API. Default is 4001.
503
-
504
- --config-file <path> Path to the powerhouse.config.js file. Default is
504
+
505
+ --config-file <path> Path to the powerhouse.config.js file. Default is
505
506
  './powerhouse.config.json'. This configures the switchboard behavior.
506
-
507
+
507
508
  --dev Enable development mode to load local packages from the current directory.
508
509
  This allows the switchboard to discover and load document models, processors,
509
510
  and subgraphs from your local development environment.
510
-
511
+
511
512
  --db-path <DB_PATH> Path to the database for storing document data.
512
-
513
+
513
514
  --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
514
-
515
+
515
516
  --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
516
-
517
+
517
518
  --packages <pkg...> List of packages to be loaded. If defined, packages specified
518
519
  in the config file are ignored.
519
-
520
- --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment
520
+
521
+ --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment
521
522
  variable used by the server to prefix all routes.
522
523
 
524
+ Identity Options:
525
+ --use-identity Enable identity using the keypair from 'ph login'. This allows the
526
+ switchboard to authenticate with remote drives and services using
527
+ your authorized Ethereum identity.
528
+
529
+ --keypair-path <path> Path to a custom keypair file. Overrides the default .keypair.json
530
+ in the current directory.
531
+
532
+ --require-identity Require an existing keypair; fail if not found. Use this when you
533
+ want to ensure the switchboard runs with a valid identity. If no
534
+ keypair exists, run 'ph login' first to create one.
535
+
523
536
  Examples:
524
537
  $ ph switchboard # Start switchboard with default settings
525
538
  $ ph switchboard --port 5000 # Use custom port 5000
@@ -527,6 +540,8 @@ Examples:
527
540
  $ ph switchboard --config-file custom.json # Use custom configuration file
528
541
  $ ph switchboard --packages pkg1 pkg2 # Load specific packages
529
542
  $ ph switchboard --base-path /switchboard # Set API base path to /switchboard
543
+ $ ph switchboard --use-identity # Start with identity from ph login
544
+ $ ph switchboard --require-identity # Require identity, fail if not logged in
530
545
  `;
531
546
  /**
532
547
  * Help text for the reactor command
@@ -601,4 +616,144 @@ Notes:
601
616
  - Using the correct CLI version is important for compatibility with your project
602
617
  - Version information is read from the package.json file of the CLI
603
618
  `;
619
+ /**
620
+ * Help text for the login command
621
+ */
622
+ export const loginHelp = `
623
+ Command Overview:
624
+ The login command authenticates you with Renown using your Ethereum wallet. This enables
625
+ the CLI to act on behalf of your Ethereum identity for authenticated operations.
626
+
627
+ This command:
628
+ 1. Generates or loads a cryptographic identity (DID) for the CLI
629
+ 2. Opens your browser to the Renown authentication page
630
+ 3. You authorize the CLI's DID to act on behalf of your Ethereum address
631
+ 4. Stores the credentials locally in ~/.ph/auth.json
632
+
633
+ Options:
634
+ --renown-url <url> Specify a custom Renown server URL. Defaults to
635
+ https://www.renown.id
636
+
637
+ --timeout <seconds> Set the authentication timeout in seconds. The command will
638
+ wait this long for you to complete authentication in the browser.
639
+ Defaults to 300 seconds (5 minutes).
640
+
641
+ --logout Sign out and clear your stored credentials. Use this when you
642
+ want to switch accounts or revoke local authentication.
643
+
644
+ --status Show your current authentication status without logging in.
645
+ Displays your CLI DID, ETH address, and when you authenticated.
646
+
647
+ --show-did Show only the CLI's DID and exit. Useful for scripts.
648
+
649
+ Authentication Flow:
650
+ 1. Run 'ph login' - the CLI generates/loads its cryptographic identity (DID)
651
+ 2. A browser window opens to Renown with the CLI's DID
652
+ 3. Connect your Ethereum wallet (MetaMask, etc.)
653
+ 4. Authorize the CLI's DID to act on behalf of your ETH address
654
+ 5. Return to your terminal - authentication is complete!
655
+
656
+ Credentials Storage:
657
+ All identity files are stored per-project in the current working directory:
658
+
659
+ .keypair.json The CLI's cryptographic keypair (ECDSA P-256)
660
+ .auth.json Your authentication credentials including:
661
+ - Your Ethereum address (the account you authorized)
662
+ - Your User DID (did:pkh:eip155:chainId:address)
663
+ - CLI DID (did:key:... - the CLI's cryptographic identity)
664
+ - Credential ID for session validation
665
+
666
+ This allows each project to have its own identity and credentials.
667
+ For CI/CD, provide the keypair via PH_RENOWN_PRIVATE_KEY env variable.
668
+
669
+ Environment Variables:
670
+ PH_RENOWN_PRIVATE_KEY JSON-encoded JWK keypair for the CLI's identity.
671
+ If set, the CLI will use this instead of generating
672
+ or loading from file. Useful for CI/CD environments.
673
+
674
+ Examples:
675
+ $ ph login # Authenticate with default settings
676
+ $ ph login --status # Check authentication status and CLI DID
677
+ $ ph login --show-did # Print only the CLI's DID
678
+ $ ph login --logout # Sign out and clear credentials
679
+ $ ph login --timeout 600 # Wait up to 10 minutes for authentication
680
+ $ ph login --renown-url http://localhost:3000 # Use local Renown server
681
+
682
+ Notes:
683
+ - You only need to authenticate once; credentials persist until you log out
684
+ - The CLI's DID remains stable unless you delete .keypair.json from your project
685
+ - If already authenticated, the command will show your current status
686
+ - The browser must remain open until authentication completes
687
+ - Your wallet signature authorizes the CLI's DID to act on your behalf
688
+ `;
689
+ /**
690
+ * Help text for the access-token command
691
+ */
692
+ export const accessTokenHelp = `
693
+ Command Overview:
694
+ The access-token command generates a bearer token for API authentication. This token
695
+ can be used to authenticate requests to Powerhouse APIs like reactor-api (Switchboard).
696
+
697
+ This command:
698
+ 1. Uses your CLI's cryptographic identity (DID) to sign a verifiable credential
699
+ 2. Creates a JWT bearer token with configurable expiration
700
+ 3. Outputs the token to stdout (info to stderr) for easy piping
701
+
702
+ Prerequisites:
703
+ You must have a cryptographic identity. Run 'ph login' first to:
704
+ - Generate a keypair (stored in .keypair.json)
705
+ - Optionally link your Ethereum address (stored in .auth.json)
706
+
707
+ Options:
708
+ --expiry <duration> Set the token expiration time. Supports multiple formats:
709
+ - Days: "7d" (default), "30d", "1d"
710
+ - Hours: "24h", "12h", "1h"
711
+ - Seconds: "3600", "3600s", "86400s"
712
+ Default is 7 days.
713
+
714
+ --audience <url> Optional. Set the intended audience (aud claim) for the token.
715
+ This can be used to restrict the token to specific services.
716
+
717
+ Token Details:
718
+ The generated token is a JWT (JSON Web Token) containing:
719
+ - Issuer (iss): Your CLI's DID (did:key:...)
720
+ - Subject (sub): Your CLI's DID
721
+ - Credential Subject: Chain ID, network ID, and address (if authenticated)
722
+ - Expiration (exp): Based on --expiry option
723
+ - Audience (aud): If --audience is specified
724
+
725
+ Output:
726
+ - Token information (DID, address, expiry) is printed to stderr
727
+ - The token itself is printed to stdout for easy piping/copying
728
+
729
+ This allows you to use the command in scripts:
730
+ TOKEN=$(ph access-token)
731
+ curl -H "Authorization: Bearer $TOKEN" http://localhost:4001/graphql
732
+
733
+ Examples:
734
+ $ ph access-token # Generate token valid for 7 days
735
+ $ ph access-token --expiry 30d # Generate token valid for 30 days
736
+ $ ph access-token --expiry 24h # Generate token valid for 24 hours
737
+ $ ph access-token --expiry 3600 # Generate token valid for 1 hour (3600 seconds)
738
+ $ ph access-token --audience http://localhost:4001 # Set audience claim
739
+ $ ph access-token | pbcopy # Copy token to clipboard (macOS)
740
+ $ ph access-token | xclip -selection c # Copy token to clipboard (Linux)
741
+
742
+ Usage with APIs:
743
+ # Generate token and use with curl
744
+ TOKEN=$(ph access-token --expiry 1d)
745
+ curl -X POST http://localhost:4001/graphql \\
746
+ -H "Content-Type: application/json" \\
747
+ -H "Authorization: Bearer $TOKEN" \\
748
+ -d '{"query": "{ drives { id name } }"}'
749
+
750
+ # Export as environment variable
751
+ export PH_ACCESS_TOKEN=$(ph access-token)
752
+
753
+ Notes:
754
+ - Tokens are self-signed using your CLI's private key
755
+ - No network request is made; tokens are generated locally
756
+ - The recipient API must trust your CLI's DID to accept the token
757
+ - For reactor-api, ensure AUTH_ENABLED=true to require authentication
758
+ `;
604
759
  //# sourceMappingURL=help.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDxB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkExB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE9B,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { type IConnectCrypto, type JsonWebKeyPairStorage, type JwkKeyPair } from "@renown/sdk";
2
+ export interface StoredCredentials {
3
+ address: string;
4
+ chainId: number;
5
+ did: string;
6
+ connectDid: string;
7
+ credentialId: string;
8
+ userDocumentId?: string;
9
+ authenticatedAt: string;
10
+ renownUrl: string;
11
+ }
12
+ /**
13
+ * Key storage that supports:
14
+ * 1. PH_RENOWN_PRIVATE_KEY environment variable (JSON-encoded JwkKeyPair)
15
+ * 2. Falls back to file storage at .keypair.json in current working directory
16
+ */
17
+ export declare class KeyStorage implements JsonWebKeyPairStorage {
18
+ #private;
19
+ constructor(filePath?: string);
20
+ loadKeyPair(): Promise<JwkKeyPair | undefined>;
21
+ saveKeyPair(keyPair: JwkKeyPair): Promise<void>;
22
+ }
23
+ /**
24
+ * Load stored credentials from disk
25
+ */
26
+ export declare function loadCredentials(): StoredCredentials | null;
27
+ /**
28
+ * Save credentials to disk (in current working directory)
29
+ */
30
+ export declare function saveCredentials(credentials: StoredCredentials): void;
31
+ /**
32
+ * Clear stored credentials
33
+ */
34
+ export declare function clearCredentials(): boolean;
35
+ /**
36
+ * Check if user is currently authenticated
37
+ */
38
+ export declare function isAuthenticated(): boolean;
39
+ /**
40
+ * Generate a UUID v4 for session IDs
41
+ */
42
+ export declare function generateSessionId(): string;
43
+ /**
44
+ * Default Renown URL
45
+ */
46
+ export declare const DEFAULT_RENOWN_URL = "https://www.renown.id";
47
+ /**
48
+ * Get or create the ConnectCrypto instance
49
+ * Uses PH_RENOWN_PRIVATE_KEY env var if set, otherwise generates/loads from file
50
+ */
51
+ export declare function getConnectCrypto(): Promise<IConnectCrypto>;
52
+ /**
53
+ * Get the DID from ConnectCrypto
54
+ * This is the did:key:... format DID that identifies this CLI instance
55
+ */
56
+ export declare function getConnectDid(): Promise<string>;
57
+ /**
58
+ * Get the issuer for signing credentials
59
+ */
60
+ export declare function getIssuer(): Promise<import("did-jwt-vc").Issuer>;
61
+ /**
62
+ * Get a bearer token for API authentication
63
+ */
64
+ export declare function getBearerToken(driveUrl: string, address?: string, refresh?: boolean): Promise<string>;
65
+ /**
66
+ * Export the keypair to a JSON string suitable for PH_RENOWN_PRIVATE_KEY
67
+ */
68
+ export declare function exportKeyPairToEnv(keyPair: JwkKeyPair): string;
69
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B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kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,171 @@
1
+ import { ConnectCrypto, } from "@renown/sdk";
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ const ENV_KEY_NAME = "PH_RENOWN_PRIVATE_KEY";
5
+ const AUTH_FILE = ".auth.json";
6
+ const KEYPAIR_FILE = ".keypair.json";
7
+ const AUTH_PATH = join(process.cwd(), AUTH_FILE);
8
+ const KEYPAIR_PATH = join(process.cwd(), KEYPAIR_FILE);
9
+ // Singleton instance of ConnectCrypto
10
+ let connectCryptoInstance = null;
11
+ /**
12
+ * Key storage that supports:
13
+ * 1. PH_RENOWN_PRIVATE_KEY environment variable (JSON-encoded JwkKeyPair)
14
+ * 2. Falls back to file storage at .keypair.json in current working directory
15
+ */
16
+ export class KeyStorage {
17
+ #filePath;
18
+ constructor(filePath) {
19
+ this.#filePath = filePath || KEYPAIR_PATH;
20
+ // Ensure directory exists
21
+ const dir = dirname(this.#filePath);
22
+ if (!existsSync(dir)) {
23
+ mkdirSync(dir, { recursive: true });
24
+ }
25
+ }
26
+ async loadKeyPair() {
27
+ // First check environment variable
28
+ const envKey = process.env[ENV_KEY_NAME];
29
+ if (envKey) {
30
+ try {
31
+ const keyPair = JSON.parse(envKey);
32
+ // Validate it has the required structure
33
+ if (keyPair.publicKey && keyPair.privateKey) {
34
+ return keyPair;
35
+ }
36
+ console.warn(`${ENV_KEY_NAME} is set but doesn't contain valid publicKey and privateKey`);
37
+ }
38
+ catch (e) {
39
+ console.warn(`Failed to parse ${ENV_KEY_NAME} as JSON:`, e);
40
+ }
41
+ }
42
+ // Fall back to file storage
43
+ return this.#loadFromFile();
44
+ }
45
+ async saveKeyPair(keyPair) {
46
+ // Don't save if using env var
47
+ if (process.env[ENV_KEY_NAME]) {
48
+ return;
49
+ }
50
+ // Save to file
51
+ this.#saveToFile(keyPair);
52
+ }
53
+ #loadFromFile() {
54
+ try {
55
+ if (!existsSync(this.#filePath)) {
56
+ return undefined;
57
+ }
58
+ const data = readFileSync(this.#filePath, "utf-8");
59
+ const parsed = JSON.parse(data);
60
+ return parsed.keyPair;
61
+ }
62
+ catch {
63
+ return undefined;
64
+ }
65
+ }
66
+ #saveToFile(keyPair) {
67
+ const data = { keyPair };
68
+ writeFileSync(this.#filePath, JSON.stringify(data, null, 2), "utf-8");
69
+ }
70
+ }
71
+ /**
72
+ * Load stored credentials from disk
73
+ */
74
+ export function loadCredentials() {
75
+ try {
76
+ if (!existsSync(AUTH_PATH)) {
77
+ return null;
78
+ }
79
+ const content = readFileSync(AUTH_PATH, "utf-8");
80
+ return JSON.parse(content);
81
+ }
82
+ catch {
83
+ return null;
84
+ }
85
+ }
86
+ /**
87
+ * Save credentials to disk (in current working directory)
88
+ */
89
+ export function saveCredentials(credentials) {
90
+ writeFileSync(AUTH_PATH, JSON.stringify(credentials, null, 2), "utf-8");
91
+ }
92
+ /**
93
+ * Clear stored credentials
94
+ */
95
+ export function clearCredentials() {
96
+ try {
97
+ if (existsSync(AUTH_PATH)) {
98
+ writeFileSync(AUTH_PATH, "{}", "utf-8");
99
+ }
100
+ return true;
101
+ }
102
+ catch {
103
+ return false;
104
+ }
105
+ }
106
+ /**
107
+ * Check if user is currently authenticated
108
+ */
109
+ export function isAuthenticated() {
110
+ const creds = loadCredentials();
111
+ return creds !== null && !!creds.credentialId;
112
+ }
113
+ /**
114
+ * Generate a UUID v4 for session IDs
115
+ */
116
+ export function generateSessionId() {
117
+ // Simple UUID v4 implementation using crypto
118
+ const bytes = new Uint8Array(16);
119
+ crypto.getRandomValues(bytes);
120
+ // Set version (4) and variant bits
121
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
122
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
123
+ const hex = Array.from(bytes)
124
+ .map((b) => b.toString(16).padStart(2, "0"))
125
+ .join("");
126
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
127
+ }
128
+ /**
129
+ * Default Renown URL
130
+ */
131
+ export const DEFAULT_RENOWN_URL = "https://www.renown.id";
132
+ /**
133
+ * Get or create the ConnectCrypto instance
134
+ * Uses PH_RENOWN_PRIVATE_KEY env var if set, otherwise generates/loads from file
135
+ */
136
+ export async function getConnectCrypto() {
137
+ if (!connectCryptoInstance) {
138
+ const keyStorage = new KeyStorage();
139
+ connectCryptoInstance = new ConnectCrypto(keyStorage);
140
+ }
141
+ return connectCryptoInstance;
142
+ }
143
+ /**
144
+ * Get the DID from ConnectCrypto
145
+ * This is the did:key:... format DID that identifies this CLI instance
146
+ */
147
+ export async function getConnectDid() {
148
+ const crypto = await getConnectCrypto();
149
+ return crypto.did();
150
+ }
151
+ /**
152
+ * Get the issuer for signing credentials
153
+ */
154
+ export async function getIssuer() {
155
+ const crypto = await getConnectCrypto();
156
+ return crypto.getIssuer();
157
+ }
158
+ /**
159
+ * Get a bearer token for API authentication
160
+ */
161
+ export async function getBearerToken(driveUrl, address, refresh = false) {
162
+ const crypto = await getConnectCrypto();
163
+ return crypto.getBearerToken(driveUrl, address, refresh);
164
+ }
165
+ /**
166
+ * Export the keypair to a JSON string suitable for PH_RENOWN_PRIVATE_KEY
167
+ */
168
+ export function exportKeyPairToEnv(keyPair) {
169
+ return JSON.stringify(keyPair);
170
+ }
171
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAId,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,SAAS,GAAG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type GenerateOptions = {
23
23
  driveEditorDirName?: string;
24
24
  migrationFile?: string;
25
25
  schemaFile?: string;
26
- tsMorph?: boolean;
26
+ useHygen?: boolean;
27
+ useVersioning?: boolean;
27
28
  };
28
29
  export declare function startGenerate(filePath: string | undefined, options: GenerateOptions): Promise<void>;
29
30
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/services/generate.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC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AAEF,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,eAAe,iBAuGzB"}
@@ -3,7 +3,8 @@ import { getConfig } from "@powerhousedao/config/node";
3
3
  import path from "path";
4
4
  export async function startGenerate(filePath, options) {
5
5
  const baseConfig = getConfig();
6
- const legacy = !options.tsMorph;
6
+ const useVersioning = !!options.useVersioning;
7
+ const useTsMorph = useVersioning || !options.useHygen;
7
8
  const config = {
8
9
  ...baseConfig,
9
10
  ...{
@@ -15,7 +16,8 @@ export async function startGenerate(filePath, options) {
15
16
  ...(options.skipFormat && { skipFormat: options.skipFormat }),
16
17
  ...(options.interactive && { interactive: options.interactive }),
17
18
  ...(options.watch && { watch: options.watch }),
18
- legacy,
19
+ useTsMorph,
20
+ useVersioning,
19
21
  },
20
22
  };
21
23
  const command = {
@@ -40,7 +42,8 @@ export async function startGenerate(filePath, options) {
40
42
  isDragAndDropEnabled: options.isDragAndDropEnabled,
41
43
  migrationFile: options.migrationFile,
42
44
  schemaFile: options.schemaFile,
43
- legacy,
45
+ useTsMorph,
46
+ useVersioning,
44
47
  };
45
48
  if (command.driveEditor) {
46
49
  if (!command.driveEditorName) {
@@ -53,7 +56,7 @@ export async function startGenerate(filePath, options) {
53
56
  allowedDocumentTypes: command.allowedDocumentTypes,
54
57
  isDragAndDropEnabled: command.isDragAndDropEnabled,
55
58
  driveEditorDirName: command.driveEditorDirName,
56
- legacy,
59
+ useTsMorph,
57
60
  });
58
61
  }
59
62
  else if (command.editor) {
@@ -67,7 +70,7 @@ export async function startGenerate(filePath, options) {
67
70
  editorId: command.editorId,
68
71
  specifiedPackageName: command.specifiedPackageName,
69
72
  editorDirName: command.editorDirName,
70
- legacy,
73
+ useTsMorph,
71
74
  });
72
75
  }
73
76
  else if (command.processor && options.processor) {
@@ -88,12 +91,16 @@ export async function startGenerate(filePath, options) {
88
91
  });
89
92
  }
90
93
  else if (filePath) {
91
- await generateFromFile(filePath, config, legacy, {
92
- force: options.force,
94
+ await generateFromFile({
95
+ path: filePath,
96
+ config,
97
+ useTsMorph,
98
+ options,
99
+ useVersioning,
93
100
  });
94
101
  }
95
102
  else {
96
- await generateCode(config, legacy);
103
+ await generateCode(config, useTsMorph, useVersioning);
97
104
  }
98
105
  }
99
106
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/services/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AA8BxB,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA4B,EAC5B,OAAwB;IAExB,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,MAAM,GAAG;QACb,GAAG,UAAU;QACb,GAAG;YACD,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YACvD,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;YAChE,GAAG,CAAC,OAAO,CAAC,cAAc,IAAI;gBAC5B,iBAAiB,EAAE,OAAO,CAAC,cAAc;aAC1C,CAAC;YACF,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;YAC7D,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;YAChE,GAAG,CAAC,OAAO,CA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SACd,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Run all migrations */
2
+ type MigrateOptions = {
3
+ useHygen?: boolean;
4
+ };
5
+ export declare function migrate({ useHygen }: MigrateOptions): Promise<void>;
6
+ export {};
7
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/services/migrate.ts"],"names":[],"mappings":"AAsBA,yBAAyB;AACzB,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,wBAAsB,OAAO,CAAC,EAAE,QAAgB,EAAE,EAAE,cAAc,iBAmBjE"}