@powerhousedao/ph-cli 6.0.0-dev.16 → 6.0.0-dev.161

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 (173) hide show
  1. package/dist/assign-env-vars-CzHgn5ax.mjs +15 -0
  2. package/dist/assign-env-vars-CzHgn5ax.mjs.map +1 -0
  3. package/dist/auth-BeA5gDPQ.mjs +23 -0
  4. package/dist/auth-BeA5gDPQ.mjs.map +1 -0
  5. package/dist/build-BflSHYLP.mjs +33 -0
  6. package/dist/build-BflSHYLP.mjs.map +1 -0
  7. package/dist/cli.d.mts +1 -0
  8. package/dist/cli.mjs +731 -0
  9. package/dist/cli.mjs.map +1 -0
  10. package/dist/connect-build-CrnmJlav.mjs +21 -0
  11. package/dist/connect-build-CrnmJlav.mjs.map +1 -0
  12. package/dist/connect-preview-4Xe7Lm1V.mjs +27 -0
  13. package/dist/connect-preview-4Xe7Lm1V.mjs.map +1 -0
  14. package/dist/connect-studio-38_NrT_a.mjs +28 -0
  15. package/dist/connect-studio-38_NrT_a.mjs.map +1 -0
  16. package/dist/connect-studio-DuH6WcoA.mjs +3 -0
  17. package/dist/generate-CMQGYRrW.mjs +2 -0
  18. package/dist/generate-Dq80G8n4.mjs +58 -0
  19. package/dist/generate-Dq80G8n4.mjs.map +1 -0
  20. package/dist/inspect-nPp5CN8a.mjs +45 -0
  21. package/dist/inspect-nPp5CN8a.mjs.map +1 -0
  22. package/dist/migrate-DzLTX506.mjs +245 -0
  23. package/dist/migrate-DzLTX506.mjs.map +1 -0
  24. package/dist/scripts/generate-commands-docs.ts +45 -0
  25. package/dist/switchboard-BclxuF4j.mjs +72 -0
  26. package/dist/switchboard-BclxuF4j.mjs.map +1 -0
  27. package/dist/switchboard-DXF1APL1.mjs +2 -0
  28. package/dist/switchboard-migrate-Cwx-8MnF.mjs +50 -0
  29. package/dist/switchboard-migrate-Cwx-8MnF.mjs.map +1 -0
  30. package/dist/utils-DbFSkp_Q.mjs +161 -0
  31. package/dist/utils-DbFSkp_Q.mjs.map +1 -0
  32. package/dist/vetra-CjawXTZJ.mjs +360 -0
  33. package/dist/vetra-CjawXTZJ.mjs.map +1 -0
  34. package/package.json +34 -33
  35. package/dist/scripts/generate-commands-md.d.ts +0 -2
  36. package/dist/scripts/generate-commands-md.d.ts.map +0 -1
  37. package/dist/scripts/generate-commands-md.js +0 -72
  38. package/dist/scripts/generate-commands-md.js.map +0 -1
  39. package/dist/scripts/generate-commands-md.ts +0 -84
  40. package/dist/scripts/generate-version.d.ts +0 -2
  41. package/dist/scripts/generate-version.d.ts.map +0 -1
  42. package/dist/scripts/generate-version.js +0 -13
  43. package/dist/scripts/generate-version.js.map +0 -1
  44. package/dist/scripts/generate-version.ts +0 -22
  45. package/dist/src/cli.d.ts +0 -3
  46. package/dist/src/cli.d.ts.map +0 -1
  47. package/dist/src/cli.js +0 -42
  48. package/dist/src/cli.js.map +0 -1
  49. package/dist/src/commands/access-token.d.ts +0 -9
  50. package/dist/src/commands/access-token.d.ts.map +0 -1
  51. package/dist/src/commands/access-token.js +0 -110
  52. package/dist/src/commands/access-token.js.map +0 -1
  53. package/dist/src/commands/connect.d.ts +0 -19
  54. package/dist/src/commands/connect.d.ts.map +0 -1
  55. package/dist/src/commands/connect.js +0 -85
  56. package/dist/src/commands/connect.js.map +0 -1
  57. package/dist/src/commands/generate.d.ts +0 -9
  58. package/dist/src/commands/generate.d.ts.map +0 -1
  59. package/dist/src/commands/generate.js +0 -41
  60. package/dist/src/commands/generate.js.map +0 -1
  61. package/dist/src/commands/help.d.ts +0 -3
  62. package/dist/src/commands/help.d.ts.map +0 -1
  63. package/dist/src/commands/help.js +0 -9
  64. package/dist/src/commands/help.js.map +0 -1
  65. package/dist/src/commands/index.d.ts +0 -14
  66. package/dist/src/commands/index.d.ts.map +0 -1
  67. package/dist/src/commands/index.js +0 -14
  68. package/dist/src/commands/index.js.map +0 -1
  69. package/dist/src/commands/inspect.d.ts +0 -6
  70. package/dist/src/commands/inspect.d.ts.map +0 -1
  71. package/dist/src/commands/inspect.js +0 -21
  72. package/dist/src/commands/inspect.js.map +0 -1
  73. package/dist/src/commands/install.d.ts +0 -15
  74. package/dist/src/commands/install.d.ts.map +0 -1
  75. package/dist/src/commands/install.js +0 -127
  76. package/dist/src/commands/install.js.map +0 -1
  77. package/dist/src/commands/list.d.ts +0 -9
  78. package/dist/src/commands/list.d.ts.map +0 -1
  79. package/dist/src/commands/list.js +0 -36
  80. package/dist/src/commands/list.js.map +0 -1
  81. package/dist/src/commands/login.d.ts +0 -12
  82. package/dist/src/commands/login.d.ts.map +0 -1
  83. package/dist/src/commands/login.js +0 -208
  84. package/dist/src/commands/login.js.map +0 -1
  85. package/dist/src/commands/migrate.d.ts +0 -10
  86. package/dist/src/commands/migrate.d.ts.map +0 -1
  87. package/dist/src/commands/migrate.js +0 -12
  88. package/dist/src/commands/migrate.js.map +0 -1
  89. package/dist/src/commands/register-commands.d.ts +0 -5
  90. package/dist/src/commands/register-commands.d.ts.map +0 -1
  91. package/dist/src/commands/register-commands.js +0 -32
  92. package/dist/src/commands/register-commands.js.map +0 -1
  93. package/dist/src/commands/service.d.ts +0 -5
  94. package/dist/src/commands/service.d.ts.map +0 -1
  95. package/dist/src/commands/service.js +0 -67
  96. package/dist/src/commands/service.js.map +0 -1
  97. package/dist/src/commands/switchboard.d.ts +0 -9
  98. package/dist/src/commands/switchboard.d.ts.map +0 -1
  99. package/dist/src/commands/switchboard.js +0 -78
  100. package/dist/src/commands/switchboard.js.map +0 -1
  101. package/dist/src/commands/uninstall.d.ts +0 -15
  102. package/dist/src/commands/uninstall.d.ts.map +0 -1
  103. package/dist/src/commands/uninstall.js +0 -120
  104. package/dist/src/commands/uninstall.js.map +0 -1
  105. package/dist/src/commands/vetra.d.ts +0 -11
  106. package/dist/src/commands/vetra.d.ts.map +0 -1
  107. package/dist/src/commands/vetra.js +0 -35
  108. package/dist/src/commands/vetra.js.map +0 -1
  109. package/dist/src/help.d.ts +0 -65
  110. package/dist/src/help.d.ts.map +0 -1
  111. package/dist/src/help.js +0 -770
  112. package/dist/src/help.js.map +0 -1
  113. package/dist/src/index.d.ts +0 -5
  114. package/dist/src/index.d.ts.map +0 -1
  115. package/dist/src/index.js +0 -5
  116. package/dist/src/index.js.map +0 -1
  117. package/dist/src/services/auth.d.ts +0 -69
  118. package/dist/src/services/auth.d.ts.map +0 -1
  119. package/dist/src/services/auth.js +0 -171
  120. package/dist/src/services/auth.js.map +0 -1
  121. package/dist/src/services/connect.d.ts +0 -2
  122. package/dist/src/services/connect.d.ts.map +0 -1
  123. package/dist/src/services/connect.js +0 -2
  124. package/dist/src/services/connect.js.map +0 -1
  125. package/dist/src/services/generate.d.ts +0 -30
  126. package/dist/src/services/generate.d.ts.map +0 -1
  127. package/dist/src/services/generate.js +0 -106
  128. package/dist/src/services/generate.js.map +0 -1
  129. package/dist/src/services/inspect.d.ts +0 -5
  130. package/dist/src/services/inspect.d.ts.map +0 -1
  131. package/dist/src/services/inspect.js +0 -49
  132. package/dist/src/services/inspect.js.map +0 -1
  133. package/dist/src/services/migrate.d.ts +0 -7
  134. package/dist/src/services/migrate.d.ts.map +0 -1
  135. package/dist/src/services/migrate.js +0 -289
  136. package/dist/src/services/migrate.js.map +0 -1
  137. package/dist/src/services/switchboard-migrate.d.ts +0 -7
  138. package/dist/src/services/switchboard-migrate.d.ts.map +0 -1
  139. package/dist/src/services/switchboard-migrate.js +0 -60
  140. package/dist/src/services/switchboard-migrate.js.map +0 -1
  141. package/dist/src/services/switchboard.d.ts +0 -54
  142. package/dist/src/services/switchboard.d.ts.map +0 -1
  143. package/dist/src/services/switchboard.js +0 -79
  144. package/dist/src/services/switchboard.js.map +0 -1
  145. package/dist/src/services/vetra.d.ts +0 -15
  146. package/dist/src/services/vetra.d.ts.map +0 -1
  147. package/dist/src/services/vetra.js +0 -176
  148. package/dist/src/services/vetra.js.map +0 -1
  149. package/dist/src/types.d.ts +0 -2
  150. package/dist/src/types.d.ts.map +0 -1
  151. package/dist/src/types.js +0 -2
  152. package/dist/src/types.js.map +0 -1
  153. package/dist/src/utils/configure-vetra-github-url.d.ts +0 -12
  154. package/dist/src/utils/configure-vetra-github-url.d.ts.map +0 -1
  155. package/dist/src/utils/configure-vetra-github-url.js +0 -230
  156. package/dist/src/utils/configure-vetra-github-url.js.map +0 -1
  157. package/dist/src/utils.d.ts +0 -116
  158. package/dist/src/utils.d.ts.map +0 -1
  159. package/dist/src/utils.js +0 -261
  160. package/dist/src/utils.js.map +0 -1
  161. package/dist/src/version.d.ts +0 -2
  162. package/dist/src/version.d.ts.map +0 -1
  163. package/dist/src/version.js +0 -3
  164. package/dist/src/version.js.map +0 -1
  165. package/dist/test/utils.test.d.ts +0 -2
  166. package/dist/test/utils.test.d.ts.map +0 -1
  167. package/dist/test/utils.test.js +0 -132
  168. package/dist/test/utils.test.js.map +0 -1
  169. package/dist/tsconfig.tsbuildinfo +0 -1
  170. package/dist/vitest.config.d.ts +0 -3
  171. package/dist/vitest.config.d.ts.map +0 -1
  172. package/dist/vitest.config.js +0 -7
  173. package/dist/vitest.config.js.map +0 -1
package/dist/src/help.js DELETED
@@ -1,770 +0,0 @@
1
- /**
2
- * Help text for the connect studio command
3
- */
4
- export const connectStudioHelp = `
5
- Command Overview:
6
- The connect command starts the Connect Studio, a development environment for building
7
- and testing Powerhouse applications. It provides a visual interface for working with
8
- your project.
9
-
10
- This command:
11
- 1. Starts a local Connect Studio server
12
- 2. Provides a web interface for development
13
- 3. Allows you to interact with your project components
14
- 4. Supports various configuration options for customization
15
-
16
- Options:
17
- --port <port> Port to run the server on. Default is 3000.
18
-
19
- --host Expose the server to the network. By default, the server
20
- only accepts connections from localhost.
21
-
22
- --open Automatically open the browser window after starting the server.
23
-
24
- --cors Enable CORS (Cross-Origin Resource Sharing).
25
-
26
- --strictPort Exit if specified port is already in use.
27
-
28
- --force Force the optimizer to ignore the cache and re-bundle.
29
-
30
- --mode <mode> Vite mode to use (e.g., development, production).
31
-
32
- --config-file <configFile> Path to the powerhouse.config.js file. This allows you to
33
- customize the behavior of Connect Studio.
34
-
35
- --vite-config-file <file> Path to the vite config file.
36
-
37
- --project-root <path> The root directory of the project. Default is current directory.
38
-
39
- Examples:
40
- $ ph connect # Start Connect Studio on default port 3000
41
- $ ph connect --port 8080 # Start on port 8080
42
- $ ph connect --host # Expose to network (not just localhost)
43
- $ ph connect --open # Open browser automatically
44
- $ ph connect --cors # Enable CORS
45
- $ ph connect --strictPort # Exit if port is in use
46
- $ ph connect --force # Force re-bundle
47
- $ ph connect --mode production # Use production mode
48
- $ ph connect --config-file custom.config.js # Use custom configuration
49
- $ ph connect --vite-config-file vite.config.js # Use custom vite config
50
- $ ph connect --project-root /path/to/project # Set project root
51
- $ ph connect --port 8080 --open # Start on port 8080 and open browser
52
- `;
53
- /**
54
- * Help text for the connect build command
55
- */
56
- export const connectBuildHelp = `
57
- Command Overview:
58
- The Connect build command creates a production build with the project's local and
59
- external packages included.
60
-
61
- Options:
62
- --outDir <outDir> Output directory. Defaults to 'dist'.
63
-
64
- --base <base> Base path for the app. Default is "/".
65
-
66
- --mode <mode> Vite mode to use (e.g., development, production).
67
-
68
- --config-file <configFile> Path to the powerhouse.config.js file.
69
-
70
- --vite-config-file <file> Path to the vite config file.
71
-
72
- --project-root <path> The root directory of the project. Default is current directory.
73
-
74
- Examples:
75
- $ ph connect build # Build with defaults
76
- $ ph connect build --outDir build # Output to 'build' directory
77
- $ ph connect build --base /app # Set base path to '/app'
78
- $ ph connect build --mode production # Use production mode
79
- $ ph connect build --config-file custom.config.js # Use custom configuration
80
- $ ph connect build --vite-config-file vite.config.js # Use custom vite config
81
- $ ph connect build --project-root /path/to/project # Set project root
82
- `;
83
- /**
84
- * Help text for the connect preview command
85
- */
86
- export const connectPreviewHelp = `
87
- Command Overview:
88
- The Connect preview command previews a built Connect project.
89
- NOTE: You must run \`ph connect build\` first.
90
-
91
- Options:
92
- --outDir <outDir> Output directory. Defaults to 'dist'.
93
-
94
- --port <port> Port to run the server on. Default is 3000.
95
-
96
- --host Expose the server to the network.
97
-
98
- --open Open browser on startup.
99
-
100
- --strictPort Exit if specified port is already in use.
101
-
102
- --base <base> Base path for the app. Default is "/".
103
-
104
- --mode <mode> Vite mode to use (e.g., development, production).
105
-
106
- --config-file <configFile> Path to the powerhouse.config.js file.
107
-
108
- --vite-config-file <file> Path to the vite config file.
109
-
110
- --project-root <path> The root directory of the project. Default is current directory.
111
-
112
- Examples:
113
- $ ph connect preview # Preview with defaults
114
- $ ph connect preview --outDir build # Preview from 'build' directory
115
- $ ph connect preview --port 8080 # Preview on port 8080
116
- $ ph connect preview --host # Expose to network
117
- $ ph connect preview --open # Open browser automatically
118
- $ ph connect preview --strictPort # Exit if port is in use
119
- $ ph connect preview --base /app # Set base path to '/app'
120
- $ ph connect preview --mode production # Use production mode
121
- $ ph connect preview --config-file custom.config.js # Use custom configuration
122
- $ ph connect preview --vite-config-file vite.config.js # Use custom vite config
123
- $ ph connect preview --project-root /path/to/project # Set project root
124
- `;
125
- /**
126
- * Help text for the generate command
127
- */
128
- export const generateHelp = `
129
- Command Overview:
130
- The generate command creates code from document models. It helps you build editors,
131
- processors, and other components based on your document model files.
132
-
133
- This command:
134
- 1. Reads document model definitions
135
- 2. Generates code for specified components (editors, processors, etc.)
136
- 3. Supports customization of output and generation options
137
- 4. Can watch files for changes and regenerate code automatically
138
-
139
- Arguments:
140
- [document-model-file] Optional. Path to the document model file to generate code from.
141
- If not provided, the command will look for document models in
142
- the default location.
143
-
144
- Options:
145
- -i, --interactive Run the command in interactive mode, which will guide you
146
- through the generation process with prompts and options.
147
-
148
- --editors <path> Path to the directory where editors should be generated or found.
149
-
150
- -e, --editor <name> Name of the editor to generate or use.
151
-
152
- --file <path> Specific file path to the document model.
153
-
154
- --processors <path> Path to the directory where processors should be generated or found.
155
-
156
- -p, --processor <name> Name of the processor to generate.
157
-
158
- --processor-type <type> Type of processor to generate. 'relationalDb' or 'analytics'
159
-
160
- -s, --subgraph <name> Name of the subgraph to use or create.
161
-
162
- --document-models <path> Path to the document models directory.
163
-
164
- --document-types <types> Document types supported by the editor, in the format
165
- 'namespace/type' (e.g., 'powerhouse/todo').
166
-
167
- -is, --import-script <name> Name of the import script to generate.
168
-
169
- -sf, --skip-format Skip formatting the generated code.
170
-
171
- -w, --watch Watch for changes in the document model and regenerate code
172
- when changes are detected.
173
-
174
- -d, --drive-editor <name> Generate a drive editor with the specified name.
175
-
176
- --migration-file <path> Path to the migration file when running 'ph generate
177
-
178
- --schema-file <path> Path to the output file. Defaults to 'schema.ts' at the same directory of the migration file.
179
-
180
- Examples:
181
- $ ph generate # Generate code using defaults
182
- $ ph generate my-document-model.zip # Generate from a specific model zip file
183
- $ ph generate -i # Run in interactive mode
184
- $ ph generate --editor ToDoList --document-types powerhouse/todo # Generate a ToDoList editor for todo documents
185
- $ ph generate -p MyProcessor --processor-type relationalDb # Generate a specific processor
186
- $ ph generate --watch # Generate and watch for changes
187
- $ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor
188
- $ ph generate -s MySubgraph # Generate with a specific subgraph
189
- $ ph generate --skip-format # Generate without formatting
190
- $ ph generate --migration-file ./migrations.ts # Generate types for an RelationalDB Processor
191
- `;
192
- /**
193
- * Help text for the install command
194
- */
195
- export const installHelp = `
196
- Command Overview:
197
- The install command adds Powerhouse dependencies to your project. It handles installation
198
- of packages, updates configuration files, and ensures proper setup of dependencies.
199
-
200
- This command:
201
- 1. Installs specified Powerhouse dependencies using your package manager
202
- 2. Updates powerhouse.config.json to include the new dependencies
203
- 3. Supports various installation options and configurations
204
- 4. Works with npm, yarn, pnpm, and bun package managers
205
-
206
- Arguments:
207
- [dependencies...] Names of the dependencies to install. You can provide multiple
208
- dependency names separated by spaces.
209
-
210
- Options:
211
- -g, --global Install the dependencies globally rather than in the current project.
212
-
213
- --debug Show additional logs during the installation process for troubleshooting.
214
-
215
- -w, --workspace Install the dependencies in the workspace (use this option for monorepos).
216
- This ensures packages are installed with proper workspace configuration.
217
-
218
- --package-manager <pm> Force a specific package manager to use. Supported values are:
219
- "npm", "yarn", "pnpm", "bun". If not specified, the command will
220
- detect the appropriate package manager from lockfiles.
221
-
222
- Examples:
223
- $ ph install @powerhousedao/core # Install a single dependency
224
- $ ph install @powerhousedao/core @powerhousedao/utils # Install multiple dependencies
225
- $ ph install @powerhousedao/cli -g # Install globally
226
- $ ph install @powerhousedao/document-model -w # Install in workspace (monorepo)
227
- $ ph install @powerhousedao/core --package-manager yarn # Force using yarn
228
- $ ph install @powerhousedao/editor --debug # Show verbose logs during installation
229
-
230
- Aliases:
231
- $ ph add # Alias for install
232
- $ ph i # Shorthand for install
233
- `;
234
- /**
235
- * Help text for the uninstall command
236
- */
237
- export const uninstallHelp = `
238
- Command Overview:
239
- The uninstall command removes Powerhouse dependencies from your project. It handles the
240
- removal of packages, updates configuration files, and ensures proper cleanup.
241
-
242
- This command:
243
- 1. Uninstalls specified Powerhouse dependencies using your package manager
244
- 2. Updates powerhouse.config.json to remove the dependencies
245
- 3. Supports various uninstallation options and configurations
246
- 4. Works with npm, yarn, pnpm, and bun package managers
247
-
248
- Arguments:
249
- [dependencies...] Names of the dependencies to uninstall. You can provide multiple
250
- dependency names separated by spaces.
251
-
252
- Options:
253
- -g, --global Uninstall the dependencies from the global installation
254
- rather than from the current project.
255
-
256
- --debug Show additional logs during the uninstallation process
257
- for troubleshooting and to trace the command execution.
258
-
259
- -w, --workspace Uninstall the dependencies from the workspace (use this option
260
- for monorepos). This ensures packages are removed while
261
- respecting workspace configurations.
262
-
263
- --package-manager <pm> Force a specific package manager to use. Supported values are:
264
- "npm", "yarn", "pnpm", "bun". If not specified, the command will
265
- detect the appropriate package manager from lockfiles.
266
-
267
- Examples:
268
- $ ph uninstall @powerhousedao/core # Uninstall a single dependency
269
- $ ph uninstall @powerhousedao/core @powerhousedao/utils # Uninstall multiple dependencies
270
- $ ph uninstall @powerhousedao/cli -g # Uninstall globally
271
- $ ph uninstall @powerhousedao/document-model -w # Uninstall from workspace (monorepo)
272
- $ ph uninstall @powerhousedao/core --package-manager yarn # Force using yarn
273
- $ ph uninstall @powerhousedao/editor --debug # Show verbose logs during uninstallation
274
-
275
- Aliases:
276
- $ ph remove # Alias for uninstall
277
- `;
278
- /**
279
- * Help text for the list command
280
- */
281
- export const listHelp = `
282
- Command Overview:
283
- The list command displays information about installed Powerhouse packages in your project.
284
- It reads the powerhouse.config.json file and shows the packages that are currently installed.
285
-
286
- This command:
287
- 1. Examines your project configuration
288
- 2. Lists all installed Powerhouse packages
289
- 3. Provides a clear overview of your project's dependencies
290
- 4. Helps you manage and track your Powerhouse components
291
-
292
- Options:
293
- --debug Show additional logs during the listing process. This provides
294
- more detailed information about the command execution and can
295
- be helpful for troubleshooting.
296
-
297
- Examples:
298
- $ ph list # List all installed packages
299
- $ ph list --debug # List packages with detailed debug information
300
-
301
- Aliases:
302
- $ ph l # Shorthand for list
303
-
304
- Notes:
305
- - The command reads from powerhouse.config.json in your project root
306
- - If no packages are found, the command will inform you that no packages are installed
307
- - Each package is displayed by its package name
308
- `;
309
- /**
310
- * Help text for the dev command
311
- */
312
- export const devHelp = `
313
- Command Overview:
314
- The dev command sets up a development environment for working with Powerhouse projects.
315
- It starts a local development server with a Switchboard, enabling real-time document
316
- model editing and processing.
317
-
318
- This command:
319
- 1. Starts a local development server
320
- 2. Sets up a Switchboard for document processing
321
- 3. Enables real-time updates and code generation
322
- 4. Configures necessary services for development
323
-
324
- Options:
325
- --generate Generate code automatically when document models are updated.
326
- This keeps your code in sync with model changes.
327
-
328
- --switchboard-port <port> Specify the port to use for the Switchboard service.
329
- The Switchboard handles document processing and communication.
330
-
331
- --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
332
-
333
- --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
334
-
335
- --config-file <path> Path to the powerhouse.config.js file. This allows you to
336
- customize the behavior of the development environment.
337
-
338
- -w, --watch Watch for local changes to document models and processors,
339
- and automatically update the Switchboard accordingly.
340
-
341
- Examples:
342
- $ ph dev # Start dev environment with defaults
343
- $ ph dev --generate # Auto-generate code on model changes
344
- $ ph dev --switchboard-port 5000 # Use custom port for Switchboard
345
- $ ph dev --config-file custom.powerhouse.config.js # Use custom configuration
346
- $ ph dev --watch # Watch for changes and auto-update
347
- $ ph dev --https-key-file key.pem --https-cert-file cert.pem # Use HTTPS
348
- `;
349
- /**
350
- * Help text for the vetra command
351
- */
352
- export const vetraHelp = `
353
- Command Overview:
354
- The vetra command sets up a Vetra development environment for working with Vetra projects.
355
- It starts a Vetra Switchboard and optionally Connect Studio, enabling document collaboration
356
- and real-time processing with a "Vetra" drive or connection to remote drives.
357
-
358
- This command:
359
- 1. Starts a Vetra Switchboard with a "Vetra" drive for document storage
360
- 2. Optionally connects to remote drives instead of creating a local drive
361
- 3. Starts Connect Studio pointing to the Switchboard for user interaction (unless disabled)
362
- 4. Enables real-time updates, collaboration, and code generation
363
-
364
- Options:
365
- --logs Enable verbose logging for all services. This provides detailed
366
- output from Switchboard and Connect during startup and operation.
367
-
368
- --switchboard-port <port> Specify the port to use for the Vetra Switchboard service.
369
- Default is 4001. The Switchboard handles document storage.
370
-
371
- --connect-port <port> Specify the port to use for Connect Studio.
372
- Default is 3000. Connect provides the user interface.
373
-
374
- --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
375
-
376
- --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
377
-
378
- --config-file <path> Path to the powerhouse.config.js file. This allows you to
379
- customize the behavior of the Vetra development environment.
380
-
381
- -w, --watch Enable dynamic loading for document-models and editors in
382
- connect-studio and switchboard. When enabled, the system will
383
- watch for changes in these directories and reload them dynamically.
384
-
385
- --remote-drive <url> URL of remote drive to connect to. When specified, the switchboard
386
- connects to this remote drive instead of creating a local Vetra drive.
387
-
388
- --disable-connect Skip Connect initialization (only start switchboard and reactor).
389
- Use this when you only need the backend services running.
390
-
391
- --interactive Enable interactive mode for code generation. When enabled, the system
392
- will prompt for user confirmation before generating code. This is useful
393
- for development when you want control over when code regeneration happens.
394
-
395
- Examples:
396
- $ ph vetra # Start Vetra environment with defaults
397
- $ ph vetra --switchboard-port 5000 --connect-port 3001 # Use custom ports
398
- $ ph vetra --config-file custom.powerhouse.config.js # Use custom configuration
399
- $ ph vetra --watch # Enable dynamic loading for development
400
- $ ph vetra -w # Enable dynamic loading (short form)
401
- $ ph vetra --logs # Enable detailed logging
402
- $ ph vetra --remote-drive http://localhost:4001/d/docs # Connect to remote drive
403
- $ ph vetra --disable-connect # Start only backend services
404
- $ ph vetra --interactive # Enable interactive code generation mode
405
- $ ph vetra --https-key-file key.pem --https-cert-file cert.pem # Use HTTPS
406
- `;
407
- /**
408
- * Help text for the inspect command
409
- */
410
- export const inspectHelp = `
411
- Command Overview:
412
- The inspect command examines and provides detailed information about a Powerhouse package.
413
- It helps you understand the structure, dependencies, and configuration of packages in
414
- your project.
415
-
416
- This command:
417
- 1. Analyzes the specified package
418
- 2. Retrieves detailed information about its structure and configuration
419
- 3. Displays package metadata, dependencies, and other relevant information
420
- 4. Helps troubleshoot package-related issues
421
-
422
- Arguments:
423
- <packageName> Required. The name of the package to inspect. This should be
424
- the name of a Powerhouse package or component.
425
-
426
- Options:
427
- --debug Show additional logs during the inspection process. This is
428
- useful for troubleshooting or getting more detailed information
429
- about how the inspection is performed.
430
-
431
- Examples:
432
- $ ph inspect @powerhousedao/core # Inspect the core package
433
- $ ph inspect @powerhousedao/document-model # Inspect the document-model package
434
- $ ph inspect my-custom-component # Inspect a custom component
435
- $ ph inspect @powerhousedao/editor --debug # Inspect with detailed logs
436
-
437
- Aliases:
438
- $ ph is # Shorthand for inspect
439
-
440
- Notes:
441
- - This command is useful for debugging and understanding package configurations
442
- - Information displayed includes package structure, dependencies, and metadata
443
- - The command requires the package to be installed in your project
444
- `;
445
- /**
446
- * Help text for the service command
447
- */
448
- export const serviceHelp = `
449
- Command Overview:
450
- The service command manages Powerhouse services, allowing you to start, stop, check status,
451
- and more. It provides a centralized way to control the lifecycle of services in your project.
452
-
453
- This command:
454
- 1. Controls service lifecycle (start, stop, status, etc.)
455
- 2. Manages multiple services from a single interface
456
- 3. Provides detailed information about running services
457
- 4. Uses PM2 under the hood for process management
458
-
459
- Arguments:
460
- <action> The action to perform. Available actions:
461
- - start: Launch the specified service
462
- - stop: Terminate the specified service
463
- - status: Check the current status of services
464
- - list: List all managed services (default)
465
- - startup: Configure services to start on system boot
466
- - unstartup: Remove services from system startup
467
-
468
- [service] Optional. The service to act upon. Available services:
469
- - switchboard: The document processing engine
470
- - connect: The Connect Studio interface
471
- - all: Act on all services (default)
472
-
473
- Examples:
474
- $ ph service setup # Setup services
475
- $ ph service start # Start the services
476
- $ ph service stop # Stop the services
477
- $ ph service status # Check status of all services
478
-
479
-
480
- Notes:
481
- - Services are managed using PM2, a process manager for Node.js applications
482
- - The 'status' action shows uptime, memory usage, CPU usage, and other metrics
483
- - The 'list' action is the default when no action is specified
484
- - The 'all' service is the default when no service is specified
485
- `;
486
- /**
487
- * Help text for the switchboard command
488
- */
489
- export const switchboardHelp = `
490
- Command Overview:
491
- The switchboard command starts a local Switchboard instance, which acts as the document
492
- processing engine for Powerhouse projects. It provides the infrastructure for document
493
- models, processors, and real-time updates.
494
-
495
- This command:
496
- 1. Starts a local switchboard server
497
- 2. Loads document models and processors
498
- 3. Provides an API for document operations
499
- 4. Enables real-time document processing
500
- 5. Can authenticate with remote services using your identity from 'ph login'
501
-
502
- Options:
503
- --port <PORT> Port to host the API. Default is 4001.
504
-
505
- --config-file <path> Path to the powerhouse.config.js file. Default is
506
- './powerhouse.config.json'. This configures the switchboard behavior.
507
-
508
- --dev Enable development mode to load local packages from the current directory.
509
- This allows the switchboard to discover and load document models, processors,
510
- and subgraphs from your local development environment.
511
-
512
- --db-path <DB_PATH> Path to the database for storing document data.
513
-
514
- --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
515
-
516
- --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
517
-
518
- --packages <pkg...> List of packages to be loaded. If defined, packages specified
519
- in the config file are ignored.
520
-
521
- --base-path <path> Base path for the API endpoints. Sets the BASE_PATH environment
522
- variable used by the server to prefix all routes.
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
-
536
- Migration Options:
537
- --migrate Run database migrations and exit without starting the server.
538
- Useful for CI/CD pipelines or manual migration control.
539
- Only works with PostgreSQL databases.
540
-
541
- --migrate-status Show current migration status and exit. Lists all migrations
542
- and indicates which have been applied.
543
-
544
- Examples:
545
- $ ph switchboard # Start switchboard with default settings
546
- $ ph switchboard --port 5000 # Use custom port 5000
547
- $ ph switchboard --dev # Enable dev mode to load local packages
548
- $ ph switchboard --config-file custom.json # Use custom configuration file
549
- $ ph switchboard --packages pkg1 pkg2 # Load specific packages
550
- $ ph switchboard --base-path /switchboard # Set API base path to /switchboard
551
- $ ph switchboard --use-identity # Start with identity from ph login
552
- $ ph switchboard --require-identity # Require identity, fail if not logged in
553
- $ ph switchboard --migrate # Run migrations and exit
554
- $ ph switchboard --migrate-status # Check migration status
555
- $ ph switchboard --db-path postgresql://... --migrate # Migrate specific database
556
- `;
557
- /**
558
- * Help text for the reactor command
559
- */
560
- export const reactorHelp = `
561
- Command Overview:
562
- The reactor command starts a local Switchboard instance,
563
- which acts as the document processing engine for Powerhouse projects. It provides
564
- the infrastructure for document models, processors, and real-time updates.
565
-
566
- This command:
567
- 1. Starts a local reactor server
568
- 2. Loads document models and processors
569
- 3. Provides an API for document operations
570
- 4. Supports real-time updates and code generation
571
-
572
- Options:
573
- --port <PORT> Port to host the API. Default is 4001.
574
-
575
- --config-file <path> Path to the powerhouse.config.js file. Default is
576
- './powerhouse.config.json'. This configures the reactor behavior.
577
-
578
- --generate Generate code automatically when document models are updated.
579
-
580
- --db-path <DB_PATH> Path to the database for storing document data.
581
-
582
- --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
583
-
584
- --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
585
-
586
- -w, --watch Watch for local changes to document models and processors,
587
- and automatically update the reactor accordingly.
588
-
589
- --packages <pkg...> List of packages to be loaded. If defined, packages specified
590
- in the config file are ignored.
591
-
592
- Examples:
593
- $ ph reactor # Start reactor with default settings
594
- $ ph reactor --port 5000 # Use custom port 5000
595
- $ ph reactor --generate # Enable auto code generation
596
- $ ph reactor --watch # Watch for local file changes
597
- $ ph reactor --config-file custom.json # Use custom configuration file
598
- $ ph reactor --packages pkg1 pkg2 # Load specific packages
599
- `;
600
- /**
601
- * Help text for the version command
602
- */
603
- export const versionHelp = `
604
- Command Overview:
605
- The version command displays the current version of the Powerhouse CLI tool.
606
- It helps you track which version you're using and ensure compatibility.
607
-
608
- This command:
609
- 1. Retrieves version information from package.json
610
- 2. Displays the version number of the CLI tool
611
- 3. Can be used to verify successful installation or updates
612
-
613
- Options:
614
- --debug Show additional logs during version retrieval. This provides
615
- more detailed information about how the version is determined,
616
- which can be helpful for troubleshooting.
617
-
618
- Examples:
619
- $ ph version # Display the CLI version
620
- $ ph version --debug # Show version with debug information
621
-
622
- Aliases:
623
- $ ph v # Shorthand for version
624
-
625
- Notes:
626
- - The version follows semantic versioning (MAJOR.MINOR.PATCH)
627
- - Using the correct CLI version is important for compatibility with your project
628
- - Version information is read from the package.json file of the CLI
629
- `;
630
- /**
631
- * Help text for the login command
632
- */
633
- export const loginHelp = `
634
- Command Overview:
635
- The login command authenticates you with Renown using your Ethereum wallet. This enables
636
- the CLI to act on behalf of your Ethereum identity for authenticated operations.
637
-
638
- This command:
639
- 1. Generates or loads a cryptographic identity (DID) for the CLI
640
- 2. Opens your browser to the Renown authentication page
641
- 3. You authorize the CLI's DID to act on behalf of your Ethereum address
642
- 4. Stores the credentials locally in ~/.ph/auth.json
643
-
644
- Options:
645
- --renown-url <url> Specify a custom Renown server URL. Defaults to
646
- https://www.renown.id
647
-
648
- --timeout <seconds> Set the authentication timeout in seconds. The command will
649
- wait this long for you to complete authentication in the browser.
650
- Defaults to 300 seconds (5 minutes).
651
-
652
- --logout Sign out and clear your stored credentials. Use this when you
653
- want to switch accounts or revoke local authentication.
654
-
655
- --status Show your current authentication status without logging in.
656
- Displays your CLI DID, ETH address, and when you authenticated.
657
-
658
- --show-did Show only the CLI's DID and exit. Useful for scripts.
659
-
660
- Authentication Flow:
661
- 1. Run 'ph login' - the CLI generates/loads its cryptographic identity (DID)
662
- 2. A browser window opens to Renown with the CLI's DID
663
- 3. Connect your Ethereum wallet (MetaMask, etc.)
664
- 4. Authorize the CLI's DID to act on behalf of your ETH address
665
- 5. Return to your terminal - authentication is complete!
666
-
667
- Credentials Storage:
668
- All identity files are stored per-project in the current working directory:
669
-
670
- .keypair.json The CLI's cryptographic keypair (ECDSA P-256)
671
- .auth.json Your authentication credentials including:
672
- - Your Ethereum address (the account you authorized)
673
- - Your User DID (did:pkh:eip155:chainId:address)
674
- - CLI DID (did:key:... - the CLI's cryptographic identity)
675
- - Credential ID for session validation
676
-
677
- This allows each project to have its own identity and credentials.
678
- For CI/CD, provide the keypair via PH_RENOWN_PRIVATE_KEY env variable.
679
-
680
- Environment Variables:
681
- PH_RENOWN_PRIVATE_KEY JSON-encoded JWK keypair for the CLI's identity.
682
- If set, the CLI will use this instead of generating
683
- or loading from file. Useful for CI/CD environments.
684
-
685
- Examples:
686
- $ ph login # Authenticate with default settings
687
- $ ph login --status # Check authentication status and CLI DID
688
- $ ph login --show-did # Print only the CLI's DID
689
- $ ph login --logout # Sign out and clear credentials
690
- $ ph login --timeout 600 # Wait up to 10 minutes for authentication
691
- $ ph login --renown-url http://localhost:3000 # Use local Renown server
692
-
693
- Notes:
694
- - You only need to authenticate once; credentials persist until you log out
695
- - The CLI's DID remains stable unless you delete .keypair.json from your project
696
- - If already authenticated, the command will show your current status
697
- - The browser must remain open until authentication completes
698
- - Your wallet signature authorizes the CLI's DID to act on your behalf
699
- `;
700
- /**
701
- * Help text for the access-token command
702
- */
703
- export const accessTokenHelp = `
704
- Command Overview:
705
- The access-token command generates a bearer token for API authentication. This token
706
- can be used to authenticate requests to Powerhouse APIs like reactor-api (Switchboard).
707
-
708
- This command:
709
- 1. Uses your CLI's cryptographic identity (DID) to sign a verifiable credential
710
- 2. Creates a JWT bearer token with configurable expiration
711
- 3. Outputs the token to stdout (info to stderr) for easy piping
712
-
713
- Prerequisites:
714
- You must have a cryptographic identity. Run 'ph login' first to:
715
- - Generate a keypair (stored in .keypair.json)
716
- - Optionally link your Ethereum address (stored in .auth.json)
717
-
718
- Options:
719
- --expiry <duration> Set the token expiration time. Supports multiple formats:
720
- - Days: "7d" (default), "30d", "1d"
721
- - Hours: "24h", "12h", "1h"
722
- - Seconds: "3600", "3600s", "86400s"
723
- Default is 7 days.
724
-
725
- --audience <url> Optional. Set the intended audience (aud claim) for the token.
726
- This can be used to restrict the token to specific services.
727
-
728
- Token Details:
729
- The generated token is a JWT (JSON Web Token) containing:
730
- - Issuer (iss): Your CLI's DID (did:key:...)
731
- - Subject (sub): Your CLI's DID
732
- - Credential Subject: Chain ID, network ID, and address (if authenticated)
733
- - Expiration (exp): Based on --expiry option
734
- - Audience (aud): If --audience is specified
735
-
736
- Output:
737
- - Token information (DID, address, expiry) is printed to stderr
738
- - The token itself is printed to stdout for easy piping/copying
739
-
740
- This allows you to use the command in scripts:
741
- TOKEN=$(ph access-token)
742
- curl -H "Authorization: Bearer $TOKEN" http://localhost:4001/graphql
743
-
744
- Examples:
745
- $ ph access-token # Generate token valid for 7 days
746
- $ ph access-token --expiry 30d # Generate token valid for 30 days
747
- $ ph access-token --expiry 24h # Generate token valid for 24 hours
748
- $ ph access-token --expiry 3600 # Generate token valid for 1 hour (3600 seconds)
749
- $ ph access-token --audience http://localhost:4001 # Set audience claim
750
- $ ph access-token | pbcopy # Copy token to clipboard (macOS)
751
- $ ph access-token | xclip -selection c # Copy token to clipboard (Linux)
752
-
753
- Usage with APIs:
754
- # Generate token and use with curl
755
- TOKEN=$(ph access-token --expiry 1d)
756
- curl -X POST http://localhost:4001/graphql \\
757
- -H "Content-Type: application/json" \\
758
- -H "Authorization: Bearer $TOKEN" \\
759
- -d '{"query": "{ drives { id name } }"}'
760
-
761
- # Export as environment variable
762
- export PH_ACCESS_TOKEN=$(ph access-token)
763
-
764
- Notes:
765
- - Tokens are self-signed using your CLI's private key
766
- - No network request is made; tokens are generated locally
767
- - The recipient API must trust your CLI's DID to accept the token
768
- - For reactor-api, ensure AUTH_ENABLED=true to require authentication
769
- `;
770
- //# sourceMappingURL=help.js.map