@mainwp/control 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,6 +66,20 @@ mainwpcontrol abilities run list-updates-v1 --json
66
66
  mainwpcontrol abilities run get-site-v1 --input '{"site_id": 1}' --json
67
67
  ```
68
68
 
69
+ On Windows PowerShell, escape the inner quotes:
70
+
71
+ ```powershell
72
+ mainwpcontrol abilities run get-site-v1 --input '{\"site_id\": 1}' --json
73
+ ```
74
+
75
+ To skip quoting issues entirely, use a JSON file (works on every platform):
76
+
77
+ ```bash
78
+ mainwpcontrol abilities run get-site-v1 --input-file params.json --json
79
+ ```
80
+
81
+ See [Input from File](docs/workflows/input-from-file.md) for more on this approach.
82
+
69
83
  **Preview a destructive action before running it:**
70
84
 
71
85
  ```bash
@@ -165,6 +179,28 @@ When you run a command, the output appears in your terminal. A few things to kno
165
179
  - **`--json`** tells `mainwpcontrol` to output structured JSON (useful for scripting and piping to other tools)
166
180
  - **Exit codes** indicate success (`0`) or failure (`1` through `5`). You won't see them directly, but scripts and CI use them to decide what happens next. Run `echo $?` (macOS/Linux) or `echo $LASTEXITCODE` (PowerShell) after a command to check.
167
181
 
182
+ ### JSON quoting on the command line
183
+
184
+ When you pass JSON with `--input`, quoting depends on your shell:
185
+
186
+ ```bash
187
+ # macOS / Linux / Git Bash on Windows
188
+ mainwpcontrol abilities run get-site-v1 --input '{"site_id": 1}' --json
189
+
190
+ # Windows PowerShell
191
+ mainwpcontrol abilities run get-site-v1 --input '{\"site_id\": 1}' --json
192
+ ```
193
+
194
+ Windows strips the inner double quotes unless you escape them with backslashes. If this gets annoying (and it will, with longer JSON), put your parameters in a file and use `--input-file`:
195
+
196
+ ```bash
197
+ mainwpcontrol abilities run get-site-v1 --input-file params.json --json
198
+ ```
199
+
200
+ This works the same on every platform. See [Input from File](docs/workflows/input-from-file.md) for details.
201
+
202
+ **Git Bash on Windows** (comes with Git for Windows) handles quoting the same way macOS and Linux do. If you use Git Bash, all the examples in this documentation work without changes.
203
+
168
204
  </details>
169
205
 
170
206
  ---
@@ -190,6 +226,12 @@ mainwpcontrol abilities run list-sites-v1 --json
190
226
 
191
227
  # Run with input parameters
192
228
  mainwpcontrol abilities run get-site-v1 --input '{"site_id": 1}' --json
229
+
230
+ # Windows PowerShell: escape inner quotes
231
+ mainwpcontrol abilities run get-site-v1 --input '{\"site_id\": 1}' --json
232
+
233
+ # Or use a file (works everywhere)
234
+ mainwpcontrol abilities run get-site-v1 --input-file params.json --json
193
235
  ```
194
236
 
195
237
  ### Profiles
@@ -853,5 +853,5 @@
853
853
  ]
854
854
  }
855
855
  },
856
- "version": "1.0.0"
856
+ "version": "1.0.1"
857
857
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mainwp/control",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Command-line interface for scripting and automating MainWP Dashboard operations",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",