@phpsandbox/cli 0.6.0 → 0.6.1-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +24 -10
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -29,7 +29,11 @@ On Windows, download `psb-windows-x64.exe`, compare `Get-FileHash -Algorithm SHA
29
29
 
30
30
  `psb` is the command name. The npm package remains `@phpsandbox/cli`; npm also installs `phpsandbox` as a compatibility alias. Existing environment variables and `.phpsandbox.json` files continue to work.
31
31
 
32
- Project features use an explicit product workspace ID: `psb feedback list --project PROJECT_ID`, `psb payments show --project PROJECT_ID`, and `psb publication status --project PROJECT_ID`. Compute commands continue to use `--sandbox` or the selected sandbox.
32
+ Project features use the workspace ID from its `/p/PROJECT_ID` URL. Use `psb project show --project PROJECT_ID --json` to find its compute sandbox ID, then pass that ID to compute commands with `--sandbox`.
33
+
34
+ Use the same `--project` value with `psb feedback list`, `psb payments show`, `psb customers list`, and `psb publication status`. Customers defaults to the development environment. Use `--mode live` to read production customers.
35
+
36
+ Create a product workspace with `psb project create --name 'My app' --request-id UUID --json`. Save the UUID before making the request, and reuse it when checking or retrying an uncertain result. Use the returned `id` for product features and `sandboxId` for compute commands.
33
37
 
34
38
  ## Your first sandbox
35
39
 
@@ -85,6 +89,18 @@ psb delete SANDBOX_ID --yes --json
85
89
 
86
90
  Progress goes to stderr; JSON results go to stdout. Commands that follow logs or other streams emit JSON Lines with `--json`.
87
91
 
92
+ ## GitHub pull requests
93
+
94
+ With `gh` available and signed in inside the sandbox, open a pull request from a pushed branch and merge the reviewed head.
95
+
96
+ ```sh
97
+ psb git pr create --repo OWNER/REPO --base main --head my-change \
98
+ --title 'Describe the change' --body-file pr.md --json
99
+ psb git pr merge NUMBER --repo OWNER/REPO --head-sha REVIEWED_SHA --yes --json
100
+ ```
101
+
102
+ GitHub applies the repository's merge rules. Check the returned `state` to distinguish a completed merge from a pull request that remains open.
103
+
88
104
  ## Publishing
89
105
 
90
106
  Inspect your app and the destination before publishing:
@@ -121,7 +137,8 @@ For Laravel Cloud, use `{"name":"laravel-cloud","region":"eu-central-1","setup":
121
137
  ```sh
122
138
  psb publish --yes # Publish changes with the existing setup
123
139
  psb publication status --json
124
- psb publication resources --json
140
+ psb publication resources --project PROJECT_ID --json
141
+ psb publication resources inspect RESOURCE_ID --json
125
142
  psb publication build-logs
126
143
  psb publication delete # Unpublish and retain resources
127
144
  psb publication delete --delete-resources # Remove app-owned resources and their data
@@ -142,15 +159,12 @@ MIT.
142
159
  Use `application plan` to prepare a server-owned review. It never builds or creates resources. The returned review includes blockers, the bound publication identity, resolved destination, required production settings and source snapshot. The platform determines supported choices; use `publication catalog` and `publication resources` for discovery.
143
160
 
144
161
  ```sh
145
- psb application plan --provider ssh-server --server SERVER_ID \
146
- --component web --dockerfile Dockerfile --port 3333 --health-path / \
147
- --database-resource create --database-type mysql --database-version 8.4 \
148
- --cache-resource create --cache-type redis --cache-version 7
149
- psb application publish REVIEW_ID --yes --wait
150
- psb application status APPLICATION_ID
151
- psb application retry APPLICATION_ID --yes --wait
162
+ psb application config --project PROJECT_ID --json
163
+ psb application plan --project PROJECT_ID --expected-revision REVISION --app APP_ID --json
164
+ psb application publish REVIEW_ID --project PROJECT_ID --proposal SIGNED_PROPOSAL --yes --wait
165
+ psb publication status --project PROJECT_ID --json
152
166
  ```
153
167
 
154
- Only confirm a ready review after checking its choices. Confirmation sends its reference to Core; the CLI does not recreate source, resource or retry logic. A corrected review keeps the publication's identity and address. `--wait` observes platform state, and stopping the CLI leaves the platform operation running. A timeout requires inspection before retrying. `application plan application.json` or stdin supports multi-component plans; it cannot be mixed with native plan flags. Production settings use `secrets set NAME --environment production`, with values from stdin or a hidden prompt.
168
+ Check the destination and source revision before confirming a ready review. For a Git-backed app, ensure the workspace is on the intended branch and use `psb git targets sync TARGET_ID --direction pull --yes` to refresh the saved Git target. The plan returns the `review.id` and signed `review.proposal` needed for confirmation. `--wait` observes platform state, and stopping the CLI leaves the platform operation running. A timeout requires inspection before retrying. Set production values with `secrets set NAME --environment production` using stdin or a hidden prompt.
155
169
 
156
170
  `application delete APPLICATION_ID --yes` unpublishes. Add `--delete-resources` only when you intend to remove owned resource data; Core enforces shared and external ownership.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.0",
2
+ "version": "0.6.1-canary.3",
3
3
  "license": "MIT",
4
4
  "repository": {
5
5
  "type": "git",
@@ -22,12 +22,12 @@
22
22
  "node": ">=22"
23
23
  },
24
24
  "optionalDependencies": {
25
- "@phpsandbox/cli-darwin-arm64": "0.6.0",
26
- "@phpsandbox/cli-darwin-x64": "0.6.0",
27
- "@phpsandbox/cli-linux-x64": "0.6.0",
28
- "@phpsandbox/cli-linux-arm64": "0.6.0",
29
- "@phpsandbox/cli-linux-x64-musl": "0.6.0",
30
- "@phpsandbox/cli-linux-arm64-musl": "0.6.0",
31
- "@phpsandbox/cli-windows-x64": "0.6.0"
25
+ "@phpsandbox/cli-darwin-arm64": "0.6.1-canary.3",
26
+ "@phpsandbox/cli-darwin-x64": "0.6.1-canary.3",
27
+ "@phpsandbox/cli-linux-x64": "0.6.1-canary.3",
28
+ "@phpsandbox/cli-linux-arm64": "0.6.1-canary.3",
29
+ "@phpsandbox/cli-linux-x64-musl": "0.6.1-canary.3",
30
+ "@phpsandbox/cli-linux-arm64-musl": "0.6.1-canary.3",
31
+ "@phpsandbox/cli-windows-x64": "0.6.1-canary.3"
32
32
  }
33
33
  }