ph-cmd 0.43.6-dev.0 → 0.43.8-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1 +1,147 @@
|
|
|
1
|
-
# Powerhouse
|
|
1
|
+
# Powerhouse Command (ph-cmd)
|
|
2
|
+
|
|
3
|
+
A command-line interface tool for Powerhouse DAO that helps you manage project dependencies, environments, and initialization. This CLI acts as a wrapper around `ph-cli`, forwarding commands to the appropriate project context.
|
|
4
|
+
|
|
5
|
+
## Command Forwarding
|
|
6
|
+
|
|
7
|
+
The `ph-cmd` CLI automatically forwards commands to `ph-cli` when they are not part of its core functionality. It determines the project context by:
|
|
8
|
+
|
|
9
|
+
1. Looking for a `powerhouse.config.json` file in the current directory
|
|
10
|
+
2. If not found, searching up the directory tree for the nearest `powerhouse.config.json`
|
|
11
|
+
3. Using the project's package manager (npm, yarn, or pnpm) to execute the command in the correct context
|
|
12
|
+
|
|
13
|
+
For example, when you run `ph install` in a project directory, `ph-cmd` will:
|
|
14
|
+
1. Detect the project's package manager from the lockfile
|
|
15
|
+
2. Forward the command to `ph-cli` with the correct project context
|
|
16
|
+
3. Execute the command using the project's package manager
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g ph-cmd
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
When installed globally, `ph-cmd` creates a default project in your home directory under `.ph/`. This default project serves as a fallback context when no other project context is found. The default project is initialized with basic Powerhouse configurations and can be customized using the `ph setup-globals` command.
|
|
25
|
+
|
|
26
|
+
## Available Commands
|
|
27
|
+
|
|
28
|
+
### `ph init`
|
|
29
|
+
|
|
30
|
+
Initialize a new Powerhouse project.
|
|
31
|
+
|
|
32
|
+
#### Options:
|
|
33
|
+
- `-p, --project`: Name of the project
|
|
34
|
+
- `-i, --interactive`: Run the command in interactive mode
|
|
35
|
+
- `-v, --version`: Specify development version to use (defaults to "main")
|
|
36
|
+
- `--dev`: Use "development" version of the boilerplate
|
|
37
|
+
- `--staging`: Use "development" version of the boilerplate
|
|
38
|
+
- `--package-manager <packageManager>`: Force package manager to use
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Initialize a new project
|
|
42
|
+
ph init my-project
|
|
43
|
+
|
|
44
|
+
# Initialize in interactive mode
|
|
45
|
+
ph init -i
|
|
46
|
+
|
|
47
|
+
# Initialize with specific version
|
|
48
|
+
ph init -v v1.0.0
|
|
49
|
+
|
|
50
|
+
# Initialize using development version
|
|
51
|
+
ph init --dev
|
|
52
|
+
|
|
53
|
+
# Initialize with specific package manager
|
|
54
|
+
ph init --package-manager pnpm
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `ph use`
|
|
58
|
+
|
|
59
|
+
Change your environment (latest, development, production, or local).
|
|
60
|
+
|
|
61
|
+
#### Options:
|
|
62
|
+
- `--package-manager <packageManager>`: Force package manager to use
|
|
63
|
+
- `--debug`: Show additional logs
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Switch to latest environment
|
|
67
|
+
ph use latest
|
|
68
|
+
|
|
69
|
+
# Switch to development environment
|
|
70
|
+
ph use dev
|
|
71
|
+
|
|
72
|
+
# Switch to production environment
|
|
73
|
+
ph use prod
|
|
74
|
+
|
|
75
|
+
# Switch to local environment with specific path
|
|
76
|
+
ph use local /path/to/local/env
|
|
77
|
+
|
|
78
|
+
# Use specific package manager
|
|
79
|
+
ph use latest --package-manager pnpm
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `ph update`
|
|
83
|
+
|
|
84
|
+
Update your dependencies to the latest version based on the specified range in package.json.
|
|
85
|
+
|
|
86
|
+
#### Options:
|
|
87
|
+
- `--force <env>`: Force update to latest available version for the environment specified (dev, prod, latest)
|
|
88
|
+
- `--package-manager <packageManager>`: Force package manager to use
|
|
89
|
+
- `--debug`: Show additional logs
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Update dependencies based on package.json ranges
|
|
93
|
+
ph update
|
|
94
|
+
|
|
95
|
+
# Force update to latest dev version
|
|
96
|
+
ph update --force dev
|
|
97
|
+
|
|
98
|
+
# Force update to latest stable version
|
|
99
|
+
ph update --force prod
|
|
100
|
+
|
|
101
|
+
# Force update to latest version (same as prod)
|
|
102
|
+
ph update --force latest
|
|
103
|
+
|
|
104
|
+
# Update using specific package manager
|
|
105
|
+
ph update --package-manager pnpm
|
|
106
|
+
|
|
107
|
+
# Update with debug information
|
|
108
|
+
ph update --debug
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### `ph setup-globals`
|
|
112
|
+
|
|
113
|
+
Set up global configurations for Powerhouse.
|
|
114
|
+
|
|
115
|
+
#### Options:
|
|
116
|
+
- `--debug`: Show additional logs
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Set up global configurations
|
|
120
|
+
ph setup-globals
|
|
121
|
+
|
|
122
|
+
# Set up with debug information
|
|
123
|
+
ph setup-globals --debug
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Global Options
|
|
127
|
+
|
|
128
|
+
Most commands support the following global options:
|
|
129
|
+
|
|
130
|
+
- `--verbose`: Enable debug mode
|
|
131
|
+
- `--package-manager <manager>`: Force the use of a specific package manager
|
|
132
|
+
- `--debug`: Show additional debug logs
|
|
133
|
+
|
|
134
|
+
## Supported Package Managers
|
|
135
|
+
|
|
136
|
+
The CLI supports the following package managers:
|
|
137
|
+
- npm
|
|
138
|
+
- yarn
|
|
139
|
+
- pnpm
|
|
140
|
+
|
|
141
|
+
## Contributing
|
|
142
|
+
|
|
143
|
+
Please refer to the project's contribution guidelines for details on our code of conduct and the process for submitting pull requests.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
This project is licensed under the terms specified in the LICENSE file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ph-cmd",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.8-dev.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"commander": "^12.1.0",
|
|
20
|
-
"@powerhousedao/codegen": "0.49.2-dev.
|
|
20
|
+
"@powerhousedao/codegen": "0.49.2-dev.5"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc --build",
|