@powerhousedao/ph-cli 0.40.54-dev.0 → 0.40.54-dev.2

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 (45) hide show
  1. package/dist/package.json +3 -1
  2. package/dist/scripts/generate-commands-md.d.ts +2 -0
  3. package/dist/scripts/generate-commands-md.d.ts.map +1 -0
  4. package/dist/scripts/generate-commands-md.js +72 -0
  5. package/dist/scripts/generate-commands-md.js.map +1 -0
  6. package/dist/src/commands/connect.d.ts.map +1 -1
  7. package/dist/src/commands/connect.js +7 -3
  8. package/dist/src/commands/connect.js.map +1 -1
  9. package/dist/src/commands/dev.d.ts.map +1 -1
  10. package/dist/src/commands/dev.js +7 -3
  11. package/dist/src/commands/dev.js.map +1 -1
  12. package/dist/src/commands/generate.d.ts.map +1 -1
  13. package/dist/src/commands/generate.js +7 -3
  14. package/dist/src/commands/generate.js.map +1 -1
  15. package/dist/src/commands/inspect.d.ts.map +1 -1
  16. package/dist/src/commands/inspect.js +4 -1
  17. package/dist/src/commands/inspect.js.map +1 -1
  18. package/dist/src/commands/install.d.ts.map +1 -1
  19. package/dist/src/commands/install.js +4 -2
  20. package/dist/src/commands/install.js.map +1 -1
  21. package/dist/src/commands/list.d.ts.map +1 -1
  22. package/dist/src/commands/list.js +4 -2
  23. package/dist/src/commands/list.js.map +1 -1
  24. package/dist/src/commands/service.d.ts.map +1 -1
  25. package/dist/src/commands/service.js +4 -1
  26. package/dist/src/commands/service.js.map +1 -1
  27. package/dist/src/commands/switchboard.d.ts.map +1 -1
  28. package/dist/src/commands/switchboard.js +4 -1
  29. package/dist/src/commands/switchboard.js.map +1 -1
  30. package/dist/src/commands/uninstall.d.ts.map +1 -1
  31. package/dist/src/commands/uninstall.js +5 -3
  32. package/dist/src/commands/uninstall.js.map +1 -1
  33. package/dist/src/commands/version.d.ts.map +1 -1
  34. package/dist/src/commands/version.js +7 -4
  35. package/dist/src/commands/version.js.map +1 -1
  36. package/dist/src/help.d.ts +41 -0
  37. package/dist/src/help.d.ts.map +1 -0
  38. package/dist/src/help.js +415 -0
  39. package/dist/src/help.js.map +1 -0
  40. package/dist/src/utils.d.ts +9 -0
  41. package/dist/src/utils.d.ts.map +1 -1
  42. package/dist/src/utils.js +24 -0
  43. package/dist/src/utils.js.map +1 -1
  44. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  45. package/package.json +4 -2
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Help text for the connect command
3
+ */
4
+ export declare const connectHelp = "\nCommand Overview:\n The connect command starts the Connect Studio, a development environment for building\n and testing Powerhouse applications. It provides a visual interface for working with \n your project.\n\n This command:\n 1. Starts a local Connect Studio server\n 2. Provides a web interface for development\n 3. Allows you to interact with your project components\n 4. Supports various configuration options for customization\n\nOptions:\n -p, --port <port> Port to run the server on. Default is 3000.\n \n -h, --host Expose the server to the network. By default, the server\n only accepts connections from localhost.\n \n --https Enable HTTPS for secure connections. You may need to provide\n certificate files for this option to work properly.\n \n --open Automatically open the browser window after starting the server.\n \n --config-file <path> Path to the powerhouse.config.js file. This allows you to\n customize the behavior of Connect Studio.\n\nExamples:\n $ ph connect # Start Connect Studio on default port 3000\n $ ph connect -p 8080 # Start on port 8080\n $ ph connect -h # Expose to network (not just localhost)\n $ ph connect --https # Enable HTTPS\n $ ph connect --open # Open browser automatically\n $ ph connect --config-file custom.config.js # Use custom configuration\n $ ph connect -p 8080 --open # Start on port 8080 and open browser\n";
5
+ /**
6
+ * Help text for the generate command
7
+ */
8
+ export declare const generateHelp = "\nCommand Overview:\n The generate command creates code from document models. It helps you build editors, \n processors, and other components based on your document model files.\n\n This command:\n 1. Reads document model definitions\n 2. Generates code for specified components (editors, processors, etc.)\n 3. Supports customization of output and generation options\n 4. Can watch files for changes and regenerate code automatically\n\nArguments:\n [document-model-file] Optional. Path to the document model file to generate code from.\n If not provided, the command will look for document models in\n the default location.\n\nOptions:\n -i, --interactive Run the command in interactive mode, which will guide you\n through the generation process with prompts and options.\n \n --editors <path> Path to the directory where editors should be generated or found.\n \n -e, --editor <name> Name of the editor to generate or use.\n \n --file <path> Specific file path to the document model.\n \n --processors <path> Path to the directory where processors should be generated or found.\n \n -p, --processor <name> Name of the processor to generate.\n \n --processor-type <type> Type of processor to generate.\n \n -s, --subgraph <name> Name of the subgraph to use or create.\n \n --document-models <path> Path to the document models directory.\n \n --document-types <types> Document types supported by the editor, in the format\n 'namespace/type' (e.g., 'powerhouse/todo').\n \n -is, --import-script <name> Name of the import script to generate.\n \n -sf, --skip-format Skip formatting the generated code.\n \n -w, --watch Watch for changes in the document model and regenerate code\n when changes are detected.\n \n -d, --drive-editor <name> Generate a drive editor with the specified name.\n\nExamples:\n $ ph generate # Generate code using defaults\n $ ph generate my-document-model.zip # Generate from a specific model zip file\n $ ph generate -i # Run in interactive mode\n $ ph generate --editor ToDoList --document-types powerhouse/todo # Generate a ToDoList editor for todo documents\n $ ph generate -p MyProcessor # Generate a specific processor\n $ ph generate --watch # Generate and watch for changes\n $ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor\n $ ph generate -s MySubgraph # Generate with a specific subgraph\n $ ph generate --skip-format # Generate without formatting\n";
9
+ /**
10
+ * Help text for the install command
11
+ */
12
+ export declare const installHelp = "\nCommand Overview:\n The install command adds Powerhouse dependencies to your project. It handles installation\n of packages, updates configuration files, and ensures proper setup of dependencies.\n\n This command:\n 1. Installs specified Powerhouse dependencies using your package manager\n 2. Updates powerhouse.config.json to include the new dependencies\n 3. Supports various installation options and configurations\n 4. Works with npm, yarn, pnpm, and bun package managers\n\nArguments:\n [dependencies...] Names of the dependencies to install. You can provide multiple\n dependency names separated by spaces.\n\nOptions:\n -g, --global Install the dependencies globally rather than in the current project.\n \n --debug Show additional logs during the installation process for troubleshooting.\n \n -w, --workspace Install the dependencies in the workspace (use this option for monorepos).\n This ensures packages are installed with proper workspace configuration.\n \n --package-manager <pm> Force a specific package manager to use. Supported values are:\n \"npm\", \"yarn\", \"pnpm\", \"bun\". If not specified, the command will\n detect the appropriate package manager from lockfiles.\n\nExamples:\n $ ph install @powerhousedao/core # Install a single dependency\n $ ph install @powerhousedao/core @powerhousedao/utils # Install multiple dependencies\n $ ph install @powerhousedao/cli -g # Install globally\n $ ph install @powerhousedao/document-model -w # Install in workspace (monorepo)\n $ ph install @powerhousedao/core --package-manager yarn # Force using yarn\n $ ph install @powerhousedao/editor --debug # Show verbose logs during installation\n\nAliases:\n $ ph add # Alias for install\n $ ph i # Shorthand for install\n";
13
+ /**
14
+ * Help text for the uninstall command
15
+ */
16
+ export declare const uninstallHelp = "\nCommand Overview:\n The uninstall command removes Powerhouse dependencies from your project. It handles the\n removal of packages, updates configuration files, and ensures proper cleanup.\n\n This command:\n 1. Uninstalls specified Powerhouse dependencies using your package manager\n 2. Updates powerhouse.config.json to remove the dependencies\n 3. Supports various uninstallation options and configurations\n 4. Works with npm, yarn, pnpm, and bun package managers\n\nArguments:\n [dependencies...] Names of the dependencies to uninstall. You can provide multiple\n dependency names separated by spaces.\n\nOptions:\n -g, --global Uninstall the dependencies from the global installation\n rather than from the current project.\n \n --debug Show additional logs during the uninstallation process\n for troubleshooting and to trace the command execution.\n \n -w, --workspace Uninstall the dependencies from the workspace (use this option\n for monorepos). This ensures packages are removed while\n respecting workspace configurations.\n \n --package-manager <pm> Force a specific package manager to use. Supported values are:\n \"npm\", \"yarn\", \"pnpm\", \"bun\". If not specified, the command will\n detect the appropriate package manager from lockfiles.\n\nExamples:\n $ ph uninstall @powerhousedao/core # Uninstall a single dependency\n $ ph uninstall @powerhousedao/core @powerhousedao/utils # Uninstall multiple dependencies\n $ ph uninstall @powerhousedao/cli -g # Uninstall globally\n $ ph uninstall @powerhousedao/document-model -w # Uninstall from workspace (monorepo)\n $ ph uninstall @powerhousedao/core --package-manager yarn # Force using yarn\n $ ph uninstall @powerhousedao/editor --debug # Show verbose logs during uninstallation\n\nAliases:\n $ ph remove # Alias for uninstall\n";
17
+ /**
18
+ * Help text for the list command
19
+ */
20
+ export declare const listHelp = "\nCommand Overview:\n The list command displays information about installed Powerhouse packages in your project.\n It reads the powerhouse.config.json file and shows the packages that are currently installed.\n\n This command:\n 1. Examines your project configuration\n 2. Lists all installed Powerhouse packages\n 3. Provides a clear overview of your project's dependencies\n 4. Helps you manage and track your Powerhouse components\n\nOptions:\n --debug Show additional logs during the listing process. This provides\n more detailed information about the command execution and can\n be helpful for troubleshooting.\n\nExamples:\n $ ph list # List all installed packages\n $ ph list --debug # List packages with detailed debug information\n\nAliases:\n $ ph l # Shorthand for list\n\nNotes:\n - The command reads from powerhouse.config.json in your project root\n - If no packages are found, the command will inform you that no packages are installed\n - Each package is displayed by its package name\n";
21
+ /**
22
+ * Help text for the dev command
23
+ */
24
+ export declare const devHelp = "\nCommand Overview:\n The dev command sets up a development environment for working with Powerhouse projects.\n It starts a local development server with a Switchboard, enabling real-time document\n model editing and processing.\n\n This command:\n 1. Starts a local development server\n 2. Sets up a Switchboard for document processing\n 3. Enables real-time updates and code generation\n 4. Configures necessary services for development\n\nOptions:\n --generate Generate code automatically when document models are updated.\n This keeps your code in sync with model changes.\n \n --switchboard-port <port> Specify the port to use for the Switchboard service.\n The Switchboard handles document processing and communication.\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 --config-file <path> Path to the powerhouse.config.js file. This allows you to\n customize the behavior of the development environment.\n \n -w, --watch Watch for local changes to document models and processors,\n and automatically update the Switchboard accordingly.\n\nExamples:\n $ ph dev # Start dev environment with defaults\n $ ph dev --generate # Auto-generate code on model changes\n $ ph dev --switchboard-port 5000 # Use custom port for Switchboard\n $ ph dev --config-file custom.powerhouse.config.js # Use custom configuration\n $ ph dev --watch # Watch for changes and auto-update\n $ ph dev --https-key-file key.pem --https-cert-file cert.pem # Use HTTPS\n";
25
+ /**
26
+ * Help text for the inspect command
27
+ */
28
+ export declare const inspectHelp = "\nCommand Overview:\n The inspect command examines and provides detailed information about a Powerhouse package.\n It helps you understand the structure, dependencies, and configuration of packages in\n your project.\n\n This command:\n 1. Analyzes the specified package\n 2. Retrieves detailed information about its structure and configuration\n 3. Displays package metadata, dependencies, and other relevant information\n 4. Helps troubleshoot package-related issues\n\nArguments:\n <packageName> Required. The name of the package to inspect. This should be\n the name of a Powerhouse package or component.\n\nOptions:\n --debug Show additional logs during the inspection process. This is\n useful for troubleshooting or getting more detailed information\n about how the inspection is performed.\n\nExamples:\n $ ph inspect @powerhousedao/core # Inspect the core package\n $ ph inspect @powerhousedao/document-model # Inspect the document-model package\n $ ph inspect my-custom-component # Inspect a custom component\n $ ph inspect @powerhousedao/editor --debug # Inspect with detailed logs\n\nAliases:\n $ ph is # Shorthand for inspect\n\nNotes:\n - This command is useful for debugging and understanding package configurations\n - Information displayed includes package structure, dependencies, and metadata\n - The command requires the package to be installed in your project\n";
29
+ /**
30
+ * Help text for the service command
31
+ */
32
+ export declare const serviceHelp = "\nCommand Overview:\n The service command manages Powerhouse services, allowing you to start, stop, check status,\n and more. It provides a centralized way to control the lifecycle of services in your project.\n\n This command:\n 1. Controls service lifecycle (start, stop, status, etc.)\n 2. Manages multiple services from a single interface\n 3. Provides detailed information about running services\n 4. Uses PM2 under the hood for process management\n\nArguments:\n <action> The action to perform. Available actions:\n - start: Launch the specified service\n - stop: Terminate the specified service\n - status: Check the current status of services\n - list: List all managed services (default)\n - startup: Configure services to start on system boot\n - unstartup: Remove services from system startup\n \n [service] Optional. The service to act upon. Available services:\n - switchboard: The document processing engine\n - connect: The Connect Studio interface\n - all: Act on all services (default)\n\nExamples:\n $ ph service # List all services (same as 'ph service list all')\n $ ph service start switchboard # Start the Switchboard service\n $ ph service stop connect # Stop the Connect service\n $ ph service start all # Start all services\n $ ph service status # Check status of all services\n $ ph service startup # Configure services to start on system boot\n $ ph service unstartup # Remove services from system startup\n\nNotes:\n - Services are managed using PM2, a process manager for Node.js applications\n - The 'status' action shows uptime, memory usage, CPU usage, and other metrics\n - The 'list' action is the default when no action is specified\n - The 'all' service is the default when no service is specified\n";
33
+ /**
34
+ * Help text for the switchboard command
35
+ */
36
+ export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command (also known as reactor) starts a local Switchboard instance,\n which acts as the document processing engine for Powerhouse projects. It provides\n the infrastructure for document 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. Supports real-time updates and code generation\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 --generate Generate code automatically when document models are updated.\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 -w, --watch Watch for local changes to document models and processors,\n and automatically update the Switchboard accordingly.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n\nExamples:\n $ ph switchboard # Start Switchboard with default settings\n $ ph switchboard --port 5000 # Use custom port 5000\n $ ph switchboard --generate # Enable auto code generation\n $ ph switchboard --watch # Watch for local file changes\n $ ph switchboard --config-file custom.json # Use custom configuration file\n $ ph switchboard --packages pkg1 pkg2 # Load specific packages\n\nAliases:\n $ ph reactor # Alias for switchboard\n";
37
+ /**
38
+ * Help text for the version command
39
+ */
40
+ 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";
41
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW,itDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,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;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+mEAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,2jEA0C3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2kCA0BvB,CAAC"}
@@ -0,0 +1,415 @@
1
+ /**
2
+ * Help text for the connect command
3
+ */
4
+ export const connectHelp = `
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
+ -p, --port <port> Port to run the server on. Default is 3000.
18
+
19
+ -h, --host Expose the server to the network. By default, the server
20
+ only accepts connections from localhost.
21
+
22
+ --https Enable HTTPS for secure connections. You may need to provide
23
+ certificate files for this option to work properly.
24
+
25
+ --open Automatically open the browser window after starting the server.
26
+
27
+ --config-file <path> Path to the powerhouse.config.js file. This allows you to
28
+ customize the behavior of Connect Studio.
29
+
30
+ Examples:
31
+ $ ph connect # Start Connect Studio on default port 3000
32
+ $ ph connect -p 8080 # Start on port 8080
33
+ $ ph connect -h # Expose to network (not just localhost)
34
+ $ ph connect --https # Enable HTTPS
35
+ $ ph connect --open # Open browser automatically
36
+ $ ph connect --config-file custom.config.js # Use custom configuration
37
+ $ ph connect -p 8080 --open # Start on port 8080 and open browser
38
+ `;
39
+ /**
40
+ * Help text for the generate command
41
+ */
42
+ export const generateHelp = `
43
+ Command Overview:
44
+ The generate command creates code from document models. It helps you build editors,
45
+ processors, and other components based on your document model files.
46
+
47
+ This command:
48
+ 1. Reads document model definitions
49
+ 2. Generates code for specified components (editors, processors, etc.)
50
+ 3. Supports customization of output and generation options
51
+ 4. Can watch files for changes and regenerate code automatically
52
+
53
+ Arguments:
54
+ [document-model-file] Optional. Path to the document model file to generate code from.
55
+ If not provided, the command will look for document models in
56
+ the default location.
57
+
58
+ Options:
59
+ -i, --interactive Run the command in interactive mode, which will guide you
60
+ through the generation process with prompts and options.
61
+
62
+ --editors <path> Path to the directory where editors should be generated or found.
63
+
64
+ -e, --editor <name> Name of the editor to generate or use.
65
+
66
+ --file <path> Specific file path to the document model.
67
+
68
+ --processors <path> Path to the directory where processors should be generated or found.
69
+
70
+ -p, --processor <name> Name of the processor to generate.
71
+
72
+ --processor-type <type> Type of processor to generate.
73
+
74
+ -s, --subgraph <name> Name of the subgraph to use or create.
75
+
76
+ --document-models <path> Path to the document models directory.
77
+
78
+ --document-types <types> Document types supported by the editor, in the format
79
+ 'namespace/type' (e.g., 'powerhouse/todo').
80
+
81
+ -is, --import-script <name> Name of the import script to generate.
82
+
83
+ -sf, --skip-format Skip formatting the generated code.
84
+
85
+ -w, --watch Watch for changes in the document model and regenerate code
86
+ when changes are detected.
87
+
88
+ -d, --drive-editor <name> Generate a drive editor with the specified name.
89
+
90
+ Examples:
91
+ $ ph generate # Generate code using defaults
92
+ $ ph generate my-document-model.zip # Generate from a specific model zip file
93
+ $ ph generate -i # Run in interactive mode
94
+ $ ph generate --editor ToDoList --document-types powerhouse/todo # Generate a ToDoList editor for todo documents
95
+ $ ph generate -p MyProcessor # Generate a specific processor
96
+ $ ph generate --watch # Generate and watch for changes
97
+ $ ph generate --drive-editor custom-drive-explorer # Generate a custom drive editor
98
+ $ ph generate -s MySubgraph # Generate with a specific subgraph
99
+ $ ph generate --skip-format # Generate without formatting
100
+ `;
101
+ /**
102
+ * Help text for the install command
103
+ */
104
+ export const installHelp = `
105
+ Command Overview:
106
+ The install command adds Powerhouse dependencies to your project. It handles installation
107
+ of packages, updates configuration files, and ensures proper setup of dependencies.
108
+
109
+ This command:
110
+ 1. Installs specified Powerhouse dependencies using your package manager
111
+ 2. Updates powerhouse.config.json to include the new dependencies
112
+ 3. Supports various installation options and configurations
113
+ 4. Works with npm, yarn, pnpm, and bun package managers
114
+
115
+ Arguments:
116
+ [dependencies...] Names of the dependencies to install. You can provide multiple
117
+ dependency names separated by spaces.
118
+
119
+ Options:
120
+ -g, --global Install the dependencies globally rather than in the current project.
121
+
122
+ --debug Show additional logs during the installation process for troubleshooting.
123
+
124
+ -w, --workspace Install the dependencies in the workspace (use this option for monorepos).
125
+ This ensures packages are installed with proper workspace configuration.
126
+
127
+ --package-manager <pm> Force a specific package manager to use. Supported values are:
128
+ "npm", "yarn", "pnpm", "bun". If not specified, the command will
129
+ detect the appropriate package manager from lockfiles.
130
+
131
+ Examples:
132
+ $ ph install @powerhousedao/core # Install a single dependency
133
+ $ ph install @powerhousedao/core @powerhousedao/utils # Install multiple dependencies
134
+ $ ph install @powerhousedao/cli -g # Install globally
135
+ $ ph install @powerhousedao/document-model -w # Install in workspace (monorepo)
136
+ $ ph install @powerhousedao/core --package-manager yarn # Force using yarn
137
+ $ ph install @powerhousedao/editor --debug # Show verbose logs during installation
138
+
139
+ Aliases:
140
+ $ ph add # Alias for install
141
+ $ ph i # Shorthand for install
142
+ `;
143
+ /**
144
+ * Help text for the uninstall command
145
+ */
146
+ export const uninstallHelp = `
147
+ Command Overview:
148
+ The uninstall command removes Powerhouse dependencies from your project. It handles the
149
+ removal of packages, updates configuration files, and ensures proper cleanup.
150
+
151
+ This command:
152
+ 1. Uninstalls specified Powerhouse dependencies using your package manager
153
+ 2. Updates powerhouse.config.json to remove the dependencies
154
+ 3. Supports various uninstallation options and configurations
155
+ 4. Works with npm, yarn, pnpm, and bun package managers
156
+
157
+ Arguments:
158
+ [dependencies...] Names of the dependencies to uninstall. You can provide multiple
159
+ dependency names separated by spaces.
160
+
161
+ Options:
162
+ -g, --global Uninstall the dependencies from the global installation
163
+ rather than from the current project.
164
+
165
+ --debug Show additional logs during the uninstallation process
166
+ for troubleshooting and to trace the command execution.
167
+
168
+ -w, --workspace Uninstall the dependencies from the workspace (use this option
169
+ for monorepos). This ensures packages are removed while
170
+ respecting workspace configurations.
171
+
172
+ --package-manager <pm> Force a specific package manager to use. Supported values are:
173
+ "npm", "yarn", "pnpm", "bun". If not specified, the command will
174
+ detect the appropriate package manager from lockfiles.
175
+
176
+ Examples:
177
+ $ ph uninstall @powerhousedao/core # Uninstall a single dependency
178
+ $ ph uninstall @powerhousedao/core @powerhousedao/utils # Uninstall multiple dependencies
179
+ $ ph uninstall @powerhousedao/cli -g # Uninstall globally
180
+ $ ph uninstall @powerhousedao/document-model -w # Uninstall from workspace (monorepo)
181
+ $ ph uninstall @powerhousedao/core --package-manager yarn # Force using yarn
182
+ $ ph uninstall @powerhousedao/editor --debug # Show verbose logs during uninstallation
183
+
184
+ Aliases:
185
+ $ ph remove # Alias for uninstall
186
+ `;
187
+ /**
188
+ * Help text for the list command
189
+ */
190
+ export const listHelp = `
191
+ Command Overview:
192
+ The list command displays information about installed Powerhouse packages in your project.
193
+ It reads the powerhouse.config.json file and shows the packages that are currently installed.
194
+
195
+ This command:
196
+ 1. Examines your project configuration
197
+ 2. Lists all installed Powerhouse packages
198
+ 3. Provides a clear overview of your project's dependencies
199
+ 4. Helps you manage and track your Powerhouse components
200
+
201
+ Options:
202
+ --debug Show additional logs during the listing process. This provides
203
+ more detailed information about the command execution and can
204
+ be helpful for troubleshooting.
205
+
206
+ Examples:
207
+ $ ph list # List all installed packages
208
+ $ ph list --debug # List packages with detailed debug information
209
+
210
+ Aliases:
211
+ $ ph l # Shorthand for list
212
+
213
+ Notes:
214
+ - The command reads from powerhouse.config.json in your project root
215
+ - If no packages are found, the command will inform you that no packages are installed
216
+ - Each package is displayed by its package name
217
+ `;
218
+ /**
219
+ * Help text for the dev command
220
+ */
221
+ export const devHelp = `
222
+ Command Overview:
223
+ The dev command sets up a development environment for working with Powerhouse projects.
224
+ It starts a local development server with a Switchboard, enabling real-time document
225
+ model editing and processing.
226
+
227
+ This command:
228
+ 1. Starts a local development server
229
+ 2. Sets up a Switchboard for document processing
230
+ 3. Enables real-time updates and code generation
231
+ 4. Configures necessary services for development
232
+
233
+ Options:
234
+ --generate Generate code automatically when document models are updated.
235
+ This keeps your code in sync with model changes.
236
+
237
+ --switchboard-port <port> Specify the port to use for the Switchboard service.
238
+ The Switchboard handles document processing and communication.
239
+
240
+ --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
241
+
242
+ --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
243
+
244
+ --config-file <path> Path to the powerhouse.config.js file. This allows you to
245
+ customize the behavior of the development environment.
246
+
247
+ -w, --watch Watch for local changes to document models and processors,
248
+ and automatically update the Switchboard accordingly.
249
+
250
+ Examples:
251
+ $ ph dev # Start dev environment with defaults
252
+ $ ph dev --generate # Auto-generate code on model changes
253
+ $ ph dev --switchboard-port 5000 # Use custom port for Switchboard
254
+ $ ph dev --config-file custom.powerhouse.config.js # Use custom configuration
255
+ $ ph dev --watch # Watch for changes and auto-update
256
+ $ ph dev --https-key-file key.pem --https-cert-file cert.pem # Use HTTPS
257
+ `;
258
+ /**
259
+ * Help text for the inspect command
260
+ */
261
+ export const inspectHelp = `
262
+ Command Overview:
263
+ The inspect command examines and provides detailed information about a Powerhouse package.
264
+ It helps you understand the structure, dependencies, and configuration of packages in
265
+ your project.
266
+
267
+ This command:
268
+ 1. Analyzes the specified package
269
+ 2. Retrieves detailed information about its structure and configuration
270
+ 3. Displays package metadata, dependencies, and other relevant information
271
+ 4. Helps troubleshoot package-related issues
272
+
273
+ Arguments:
274
+ <packageName> Required. The name of the package to inspect. This should be
275
+ the name of a Powerhouse package or component.
276
+
277
+ Options:
278
+ --debug Show additional logs during the inspection process. This is
279
+ useful for troubleshooting or getting more detailed information
280
+ about how the inspection is performed.
281
+
282
+ Examples:
283
+ $ ph inspect @powerhousedao/core # Inspect the core package
284
+ $ ph inspect @powerhousedao/document-model # Inspect the document-model package
285
+ $ ph inspect my-custom-component # Inspect a custom component
286
+ $ ph inspect @powerhousedao/editor --debug # Inspect with detailed logs
287
+
288
+ Aliases:
289
+ $ ph is # Shorthand for inspect
290
+
291
+ Notes:
292
+ - This command is useful for debugging and understanding package configurations
293
+ - Information displayed includes package structure, dependencies, and metadata
294
+ - The command requires the package to be installed in your project
295
+ `;
296
+ /**
297
+ * Help text for the service command
298
+ */
299
+ export const serviceHelp = `
300
+ Command Overview:
301
+ The service command manages Powerhouse services, allowing you to start, stop, check status,
302
+ and more. It provides a centralized way to control the lifecycle of services in your project.
303
+
304
+ This command:
305
+ 1. Controls service lifecycle (start, stop, status, etc.)
306
+ 2. Manages multiple services from a single interface
307
+ 3. Provides detailed information about running services
308
+ 4. Uses PM2 under the hood for process management
309
+
310
+ Arguments:
311
+ <action> The action to perform. Available actions:
312
+ - start: Launch the specified service
313
+ - stop: Terminate the specified service
314
+ - status: Check the current status of services
315
+ - list: List all managed services (default)
316
+ - startup: Configure services to start on system boot
317
+ - unstartup: Remove services from system startup
318
+
319
+ [service] Optional. The service to act upon. Available services:
320
+ - switchboard: The document processing engine
321
+ - connect: The Connect Studio interface
322
+ - all: Act on all services (default)
323
+
324
+ Examples:
325
+ $ ph service # List all services (same as 'ph service list all')
326
+ $ ph service start switchboard # Start the Switchboard service
327
+ $ ph service stop connect # Stop the Connect service
328
+ $ ph service start all # Start all services
329
+ $ ph service status # Check status of all services
330
+ $ ph service startup # Configure services to start on system boot
331
+ $ ph service unstartup # Remove services from system startup
332
+
333
+ Notes:
334
+ - Services are managed using PM2, a process manager for Node.js applications
335
+ - The 'status' action shows uptime, memory usage, CPU usage, and other metrics
336
+ - The 'list' action is the default when no action is specified
337
+ - The 'all' service is the default when no service is specified
338
+ `;
339
+ /**
340
+ * Help text for the switchboard command
341
+ */
342
+ export const switchboardHelp = `
343
+ Command Overview:
344
+ The switchboard command (also known as reactor) starts a local Switchboard instance,
345
+ which acts as the document processing engine for Powerhouse projects. It provides
346
+ the infrastructure for document models, processors, and real-time updates.
347
+
348
+ This command:
349
+ 1. Starts a local Switchboard server
350
+ 2. Loads document models and processors
351
+ 3. Provides an API for document operations
352
+ 4. Supports real-time updates and code generation
353
+
354
+ Options:
355
+ --port <PORT> Port to host the API. Default is 4001.
356
+
357
+ --config-file <path> Path to the powerhouse.config.js file. Default is
358
+ './powerhouse.config.json'. This configures the Switchboard behavior.
359
+
360
+ --generate Generate code automatically when document models are updated.
361
+
362
+ --db-path <DB_PATH> Path to the database for storing document data.
363
+
364
+ --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
365
+
366
+ --https-cert-file <path> Path to the SSL certificate file if using HTTPS.
367
+
368
+ -w, --watch Watch for local changes to document models and processors,
369
+ and automatically update the Switchboard accordingly.
370
+
371
+ --packages <pkg...> List of packages to be loaded. If defined, packages specified
372
+ in the config file are ignored.
373
+
374
+ Examples:
375
+ $ ph switchboard # Start Switchboard with default settings
376
+ $ ph switchboard --port 5000 # Use custom port 5000
377
+ $ ph switchboard --generate # Enable auto code generation
378
+ $ ph switchboard --watch # Watch for local file changes
379
+ $ ph switchboard --config-file custom.json # Use custom configuration file
380
+ $ ph switchboard --packages pkg1 pkg2 # Load specific packages
381
+
382
+ Aliases:
383
+ $ ph reactor # Alias for switchboard
384
+ `;
385
+ /**
386
+ * Help text for the version command
387
+ */
388
+ export const versionHelp = `
389
+ Command Overview:
390
+ The version command displays the current version of the Powerhouse CLI tool.
391
+ It helps you track which version you're using and ensure compatibility.
392
+
393
+ This command:
394
+ 1. Retrieves version information from package.json
395
+ 2. Displays the version number of the CLI tool
396
+ 3. Can be used to verify successful installation or updates
397
+
398
+ Options:
399
+ --debug Show additional logs during version retrieval. This provides
400
+ more detailed information about how the version is determined,
401
+ which can be helpful for troubleshooting.
402
+
403
+ Examples:
404
+ $ ph version # Display the CLI version
405
+ $ ph version --debug # Show version with debug information
406
+
407
+ Aliases:
408
+ $ ph v # Shorthand for version
409
+
410
+ Notes:
411
+ - The version follows semantic versioning (MAJOR.MINOR.PATCH)
412
+ - Using the correct CLI version is important for compatibility with your project
413
+ - Version information is read from the package.json file of the CLI
414
+ `;
415
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type PowerhouseConfig } from "@powerhousedao/config/powerhouse";
2
+ import { type Command } from "commander";
2
3
  export declare const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
3
4
  export declare const POWERHOUSE_GLOBAL_DIR: string;
4
5
  export declare const SUPPORTED_PACKAGE_MANAGERS: string[];
@@ -70,5 +71,13 @@ export declare function updateConfigFile(dependencies: string[], projectPath: st
70
71
  * const packageDir = findContainerDirectory('/path/to/project/src/components', 'package.json');
71
72
  */
72
73
  export declare const findContainerDirectory: (startPath: string, targetFile: string) => string | null;
74
+ /**
75
+ * Applies custom help formatting to a command to avoid duplication in help output
76
+ *
77
+ * @param command - The Command instance to enhance
78
+ * @param helpText - The custom help text to display
79
+ * @returns The command for chaining
80
+ */
81
+ export declare function setCustomHelp(command: Command, helpText: string): Command;
73
82
  export { getConfig } from "@powerhousedao/config/powerhouse";
74
83
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKzE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,qBAAqB,QAA8B,CAAC;AACjE,eAAO,MAAM,0BAA0B,UAAiC,CAAC;AAEzE,eAAO,MAAM,e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H,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,EACjB,YAAY,MAAM,KACjB,MAAM,GAAG,IAeX,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAiBzE;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC"}
package/dist/src/utils.js CHANGED
@@ -155,5 +155,29 @@ export const findContainerDirectory = (startPath, targetFile) => {
155
155
  }
156
156
  return findContainerDirectory(parentDir, targetFile);
157
157
  };
158
+ /**
159
+ * Applies custom help formatting to a command to avoid duplication in help output
160
+ *
161
+ * @param command - The Command instance to enhance
162
+ * @param helpText - The custom help text to display
163
+ * @returns The command for chaining
164
+ */
165
+ export function setCustomHelp(command, helpText) {
166
+ // Apply custom help formatter that avoids duplication
167
+ command.helpInformation = function () {
168
+ const name = command.name();
169
+ const args = command.usage();
170
+ const description = command.description();
171
+ // Create a minimal header
172
+ let header = `\nUsage: ph ${name}`;
173
+ if (args)
174
+ header += ` ${args}`;
175
+ if (description)
176
+ header += `\n\n${description}\n`;
177
+ // Return the custom help text
178
+ return header + "\n" + helpText;
179
+ };
180
+ return command;
181
+ }
158
182
  export { getConfig } from "@powerhousedao/config/powerhouse";
159
183
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,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