@dynamicweb/cli 1.1.0 → 2.0.0-beta.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 +404 -171
- package/bin/commands/command.js +82 -24
- package/bin/commands/env.js +143 -26
- package/bin/commands/files.js +412 -74
- package/bin/commands/install.js +98 -18
- package/bin/commands/login.js +383 -44
- package/bin/commands/query.js +96 -28
- package/bin/downloader.js +8 -5
- package/bin/index.js +37 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,244 +1,477 @@
|
|
|
1
1
|
# DynamicWeb CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
DynamicWeb CLI is a powerful command line tool designed to help developers quickly and efficiently manage any given DynamicWeb 10 solution they may have access to. These tools include an easy setup and handling of different environments, access to the Management API and an easy way to update a Swift solution.
|
|
3
|
+
DynamicWeb CLI is the command-line interface for working with DynamicWeb 10 solutions. It helps you manage environments, authenticate against the admin API, run queries and commands, move files in and out of a solution, install add-ins, export databases, and pull Swift solutions.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
With this, you can hook it up to your own build pipelines and processes, if certain requests needs to happen before or after deployments or changes.
|
|
5
|
+
This branch now targets `2.0.0-beta.0`.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Requirements
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
- Node.js `>=20.12.0`
|
|
12
10
|
|
|
13
|
-
##
|
|
14
|
-
### Install from npm
|
|
15
|
-
Install the published CLI globally:
|
|
16
|
-
> $ npm install -g @dynamicweb/cli
|
|
11
|
+
## Install
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
> $ dw --help
|
|
13
|
+
Install from npm:
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> $ npm install -g .
|
|
15
|
+
```sh
|
|
16
|
+
npm install -g @dynamicweb/cli
|
|
17
|
+
dw --help
|
|
18
|
+
```
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
Install from source:
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
```sh
|
|
23
|
+
npm install
|
|
24
|
+
npm install -g .
|
|
25
|
+
```
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
> $ npm login
|
|
35
|
-
>
|
|
36
|
-
> $ npm publish --access public
|
|
27
|
+
## What Changed
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
All commands and options can be viewed by running
|
|
40
|
-
> $ dw --help
|
|
41
|
-
>
|
|
42
|
-
> $ dw \<command\> --help
|
|
29
|
+
The `2.0` beta is a substantial overhaul focused on automation and modern authentication.
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- `--protocol` Set the protocol used (only with `--host`, defaults to `https`)
|
|
31
|
+
- Automation-first command output: `env`, `login`, `files`, `query`, `command`, and `install` now support `--output json` so scripts and pipelines can consume structured results instead of plain console logs.
|
|
32
|
+
- OAuth client credentials support: the CLI can now authenticate with OAuth 2.0 `client_credentials`, which makes headless and CI/CD usage much easier.
|
|
33
|
+
- Better environment handling: protocol, host, and auth details are stored more cleanly in `~/.dwc`, while one-off runs can still override host and credentials directly.
|
|
34
|
+
- Improved file workflows: file import, export, recursive sync, raw archive export, progress reporting, and source-type override flags make file operations more predictable.
|
|
35
|
+
- Clearer error reporting: commands can now return structured failures in JSON mode, which is much easier to handle in automation.
|
|
50
36
|
|
|
51
|
-
|
|
52
|
-
As most commands are pulling or pushing data from the DW admin API, the necessary authorization is required.
|
|
37
|
+
## Quick Start
|
|
53
38
|
|
|
54
|
-
|
|
55
|
-
> $ dw login
|
|
39
|
+
View all available commands:
|
|
56
40
|
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
```sh
|
|
42
|
+
dw --help
|
|
43
|
+
dw <command> --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Set up an environment and log in with a user:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
dw env dev
|
|
50
|
+
dw login
|
|
51
|
+
dw # shows current environment, user, protocol, and host
|
|
52
|
+
```
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
> $ dw env \<env\>
|
|
54
|
+
Run a query:
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
```sh
|
|
57
|
+
dw query HealthCheck
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Authentication
|
|
61
|
+
|
|
62
|
+
### Interactive User Login
|
|
63
|
+
|
|
64
|
+
The default login flow uses a DynamicWeb user account. The CLI logs in, creates an API key, and stores it in `~/.dwc`.
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
dw login
|
|
68
|
+
dw login <saved-user>
|
|
69
|
+
dw env <environment>
|
|
70
|
+
```
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
> $ dw
|
|
72
|
+
A user-authenticated config typically looks like this:
|
|
68
73
|
|
|
69
|
-
The configuration will automatically be created when setting up your first environment, but if you already have an Api-key you want to use for a user, you can modify the config directly in the file located in `~/.dwc`. The structure should look like the following
|
|
70
74
|
```json
|
|
71
75
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
"current": {
|
|
81
|
-
"user": "DemoUser"
|
|
82
|
-
}
|
|
76
|
+
"env": {
|
|
77
|
+
"dev": {
|
|
78
|
+
"host": "localhost:6001",
|
|
79
|
+
"protocol": "https",
|
|
80
|
+
"users": {
|
|
81
|
+
"DemoUser": {
|
|
82
|
+
"apiKey": "<keyPrefix>.<key>"
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
84
|
+
},
|
|
85
|
+
"current": {
|
|
86
|
+
"user": "DemoUser",
|
|
87
|
+
"authType": "user"
|
|
88
|
+
}
|
|
87
89
|
}
|
|
90
|
+
},
|
|
91
|
+
"current": {
|
|
92
|
+
"env": "dev"
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
```
|
|
90
96
|
|
|
91
|
-
###
|
|
92
|
-
> $ dw files \<dirPath\> \<outPath\>
|
|
97
|
+
### OAuth Client Credentials
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
- `-l` `--list` This will list the directory given in \<dirPath\>
|
|
96
|
-
- `-f` `--includeFiles` The list will now also show all files in the directories
|
|
97
|
-
- `-r` `--recursive` By default it only handles the \<dirPath\>, but with this option it will handle all directories under this recursively
|
|
98
|
-
- `-e` `--export` It will export \<dirPath\> into \<outPath\> on your local machine, unzipped by default
|
|
99
|
-
- `--raw` This will keep the content zipped
|
|
100
|
-
- `--iamstupid` This will include the export of the /files/system/log and /files/.cache folders
|
|
99
|
+
For service accounts, automation, and headless usage, the CLI also supports OAuth 2.0 `client_credentials`.
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
Exporting all templates from current environment to local solution
|
|
104
|
-
> $ cd DynamicWebSolution/Files
|
|
105
|
-
>
|
|
106
|
-
> $ dw files templates ./templates -fre
|
|
101
|
+
Configure an environment for OAuth:
|
|
107
102
|
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
```sh
|
|
104
|
+
export DW_CLIENT_ID=my-client-id
|
|
105
|
+
export DW_CLIENT_SECRET=my-client-secret
|
|
110
106
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
If the path contains a file extension (e.g., 'templates/Translations.xml'), it is treated as a file.
|
|
114
|
-
Otherwise, it is treated as a directory.
|
|
115
|
-
In cases where this detection is incorrect, you can force the type using these flags:
|
|
107
|
+
dw login --oauth
|
|
108
|
+
```
|
|
116
109
|
|
|
117
|
-
|
|
118
|
-
- `-af` `--asFile` Forces the command to treat the path as a single file, even if it has no extension.
|
|
110
|
+
Run a one-off command with OAuth flags instead of saved config:
|
|
119
111
|
|
|
120
|
-
|
|
112
|
+
```sh
|
|
113
|
+
dw query HealthCheck \
|
|
114
|
+
--host your-solution.example.com \
|
|
115
|
+
--auth oauth \
|
|
116
|
+
--clientIdEnv DW_CLIENT_ID \
|
|
117
|
+
--clientSecretEnv DW_CLIENT_SECRET \
|
|
118
|
+
--output json
|
|
119
|
+
```
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
> $ dw files templates/Translations.xml ./templates -e
|
|
121
|
+
An OAuth-enabled environment in `~/.dwc` looks like this:
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"env": {
|
|
126
|
+
"dev": {
|
|
127
|
+
"host": "localhost:6001",
|
|
128
|
+
"protocol": "https",
|
|
129
|
+
"auth": {
|
|
130
|
+
"type": "oauth_client_credentials",
|
|
131
|
+
"clientIdEnv": "DW_CLIENT_ID",
|
|
132
|
+
"clientSecretEnv": "DW_CLIENT_SECRET"
|
|
133
|
+
},
|
|
134
|
+
"current": {
|
|
135
|
+
"authType": "oauth_client_credentials"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"current": {
|
|
140
|
+
"env": "dev"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
127
144
|
|
|
128
|
-
|
|
129
|
-
> $ dw files templates/testfile ./templates -e -af
|
|
145
|
+
## Global Options
|
|
130
146
|
|
|
131
|
-
|
|
132
|
-
> $ dw swift \<outPath\>
|
|
147
|
+
Most API-driven commands support these global options:
|
|
133
148
|
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
- `--
|
|
149
|
+
- `-v`, `--verbose`: enable verbose logging
|
|
150
|
+
- `--host`: use a host directly instead of the saved environment
|
|
151
|
+
- `--protocol`: set the protocol used with `--host` and default to `https`
|
|
152
|
+
- `--apiKey`: use an API key for environmentless execution
|
|
153
|
+
- `--auth`: override authentication mode with `user` or `oauth`
|
|
154
|
+
- `--clientId`: pass an OAuth client ID directly
|
|
155
|
+
- `--clientSecret`: pass an OAuth client secret directly
|
|
156
|
+
- `--clientIdEnv`: read the OAuth client ID from an environment variable
|
|
157
|
+
- `--clientSecretEnv`: read the OAuth client secret from an environment variable
|
|
139
158
|
|
|
140
|
-
|
|
141
|
-
Getting all the available releases
|
|
142
|
-
> $ dw swift -l
|
|
159
|
+
## JSON Output for Automation
|
|
143
160
|
|
|
144
|
-
|
|
145
|
-
> $ cd DynamicWebSolution/Swift
|
|
146
|
-
>
|
|
147
|
-
> $ dw swift . -n --force
|
|
161
|
+
Commands that support `--output json` return a machine-readable envelope with `ok`, `status`, `data`, `errors`, and `meta` fields.
|
|
148
162
|
|
|
149
|
-
|
|
150
|
-
> $ dw query \<query\>
|
|
163
|
+
Examples:
|
|
151
164
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
165
|
+
```sh
|
|
166
|
+
dw env --list --output json
|
|
167
|
+
dw login --output json
|
|
168
|
+
dw query FileByName --name DefaultMail.html --output json
|
|
169
|
+
```
|
|
156
170
|
|
|
157
|
-
|
|
158
|
-
Getting all properties for a query
|
|
159
|
-
> $ dw query FileByName -l
|
|
171
|
+
Representative output:
|
|
160
172
|
|
|
161
|
-
|
|
162
|
-
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"ok": true,
|
|
176
|
+
"command": "env",
|
|
177
|
+
"operation": "list",
|
|
178
|
+
"status": 200,
|
|
179
|
+
"data": [
|
|
180
|
+
{
|
|
181
|
+
"environments": ["dev", "staging"]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"errors": [],
|
|
185
|
+
"meta": {}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Commands
|
|
163
190
|
|
|
164
|
-
###
|
|
165
|
-
> $ dw command \<command\>
|
|
191
|
+
### `dw env [env]`
|
|
166
192
|
|
|
167
|
-
|
|
168
|
-
- `-l` `--list` Lists all the properties for the command, as well as the json model required
|
|
169
|
-
- `--json` Takes a path to a .json file or a literal json, i.e --json '{ abc: "123" }'
|
|
193
|
+
Create, select, or inspect saved environments.
|
|
170
194
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
195
|
+
```sh
|
|
196
|
+
dw env dev
|
|
197
|
+
dw env --list
|
|
198
|
+
dw env --users
|
|
199
|
+
dw env --list --output json
|
|
200
|
+
```
|
|
174
201
|
|
|
175
|
-
|
|
176
|
-
> $ dw command PageMove --json ./PageMove.json
|
|
202
|
+
Example JSON output:
|
|
177
203
|
|
|
178
|
-
Where PageMove.json contains
|
|
179
204
|
```json
|
|
180
|
-
{
|
|
205
|
+
{
|
|
206
|
+
"ok": true,
|
|
207
|
+
"command": "env",
|
|
208
|
+
"operation": "select",
|
|
209
|
+
"status": 200,
|
|
210
|
+
"data": [
|
|
211
|
+
{
|
|
212
|
+
"environment": "dev",
|
|
213
|
+
"current": "dev"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"errors": [],
|
|
217
|
+
"meta": {}
|
|
218
|
+
}
|
|
181
219
|
```
|
|
182
220
|
|
|
183
|
-
|
|
184
|
-
> $ dw command PageDelete --json '{ "id": "1383" }'
|
|
221
|
+
### `dw login [user]`
|
|
185
222
|
|
|
186
|
-
|
|
187
|
-
> $ dw install \<filePath\>
|
|
223
|
+
Log in interactively, configure OAuth, or switch between saved users for the current environment.
|
|
188
224
|
|
|
189
|
-
|
|
225
|
+
```sh
|
|
226
|
+
dw login
|
|
227
|
+
dw login DemoUser
|
|
228
|
+
dw login --oauth
|
|
229
|
+
dw login --output json
|
|
230
|
+
```
|
|
190
231
|
|
|
191
|
-
|
|
232
|
+
Example JSON output:
|
|
192
233
|
|
|
193
|
-
|
|
194
|
-
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"ok": true,
|
|
237
|
+
"command": "login",
|
|
238
|
+
"operation": "oauth-login",
|
|
239
|
+
"status": 200,
|
|
240
|
+
"data": [
|
|
241
|
+
{
|
|
242
|
+
"environment": "dev",
|
|
243
|
+
"authType": "oauth_client_credentials",
|
|
244
|
+
"clientIdEnv": "DW_CLIENT_ID",
|
|
245
|
+
"clientSecretEnv": "DW_CLIENT_SECRET",
|
|
246
|
+
"expires": "2026-04-13T14:22:31Z"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"errors": [],
|
|
250
|
+
"meta": {}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
195
253
|
|
|
196
|
-
###
|
|
197
|
-
> $ dw database \<outPath\>
|
|
254
|
+
### `dw files [dirPath] [outPath]`
|
|
198
255
|
|
|
199
|
-
|
|
200
|
-
- `-e` `--export` Exports your current environments database to a .bacpac file at \<outPath\>
|
|
256
|
+
List, export, and import files from the DynamicWeb file archive.
|
|
201
257
|
|
|
202
|
-
|
|
203
|
-
> $ dw database -e ./backup
|
|
258
|
+
Useful flags:
|
|
204
259
|
|
|
205
|
-
|
|
206
|
-
|
|
260
|
+
- `-l`, `--list`: list directories
|
|
261
|
+
- `-f`, `--includeFiles`: include files in listings
|
|
262
|
+
- `-e`, `--export`: export from the environment to disk
|
|
263
|
+
- `-i`, `--import`: import from disk to the environment
|
|
264
|
+
- `-r`, `--recursive`: recurse through subdirectories
|
|
265
|
+
- `--raw`: keep downloaded archives zipped
|
|
266
|
+
- `--dangerouslyIncludeLogsAndCache`: include log and cache folders during export, which is risky and usually not recommended
|
|
267
|
+
- `-af`, `--asFile`: force the source path to be treated as a file
|
|
268
|
+
- `-ad`, `--asDirectory`: force the source path to be treated as a directory
|
|
207
269
|
|
|
208
|
-
|
|
209
|
-
- `--<property>` The path and name of the property to set
|
|
270
|
+
Examples:
|
|
210
271
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
272
|
+
```sh
|
|
273
|
+
dw files templates ./templates -fre
|
|
274
|
+
dw files system -lr
|
|
275
|
+
dw files templates/Translations.xml ./templates -e
|
|
276
|
+
dw files templates/templates.v1 ./templates -e -ad
|
|
277
|
+
dw files ./Files templates -i -r --output json
|
|
278
|
+
```
|
|
214
279
|
|
|
215
|
-
|
|
216
|
-
If you're using Git Bash, you may encounter issues with path conversion that can interfere with relative paths used in commands.
|
|
280
|
+
Example JSON output:
|
|
217
281
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"ok": true,
|
|
285
|
+
"command": "files",
|
|
286
|
+
"operation": "import",
|
|
287
|
+
"status": 200,
|
|
288
|
+
"data": [
|
|
289
|
+
{
|
|
290
|
+
"type": "upload",
|
|
291
|
+
"destinationPath": "templates",
|
|
292
|
+
"files": [
|
|
293
|
+
"/workspace/Files/Templates/DefaultMail.html"
|
|
294
|
+
],
|
|
295
|
+
"response": {
|
|
296
|
+
"message": "Upload completed"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"errors": [],
|
|
301
|
+
"meta": {
|
|
302
|
+
"filesProcessed": 1,
|
|
303
|
+
"chunks": 1
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
221
307
|
|
|
222
|
-
|
|
223
|
-
If you are using relative paths, this may interfere.
|
|
224
|
-
Please see https://doc.dynamicweb.dev/documentation/fundamentals/code/CLI.html for more information."
|
|
308
|
+
### `dw query [query]`
|
|
225
309
|
|
|
226
|
-
|
|
227
|
-
To resolve this issue, disable path conversion by setting the `MSYS_NO_PATHCONV` environment variable (current session only):
|
|
310
|
+
Run admin API queries, inspect available parameters, or prompt for them interactively.
|
|
228
311
|
|
|
229
|
-
|
|
312
|
+
```sh
|
|
313
|
+
dw query FileByName -l
|
|
314
|
+
dw query FileByName --name DefaultMail.html --directorypath /Templates/Forms/Mail
|
|
315
|
+
dw query FileByName --interactive
|
|
316
|
+
dw query FileByName --name DefaultMail.html --output json
|
|
317
|
+
```
|
|
230
318
|
|
|
231
|
-
|
|
319
|
+
Example JSON output:
|
|
232
320
|
|
|
233
|
-
|
|
234
|
-
|
|
321
|
+
```json
|
|
322
|
+
{
|
|
323
|
+
"ok": true,
|
|
324
|
+
"command": "query",
|
|
325
|
+
"operation": "run",
|
|
326
|
+
"status": 200,
|
|
327
|
+
"data": [
|
|
328
|
+
{
|
|
329
|
+
"name": "DefaultMail.html",
|
|
330
|
+
"path": "/Templates/Forms/Mail/DefaultMail.html"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"errors": [],
|
|
334
|
+
"meta": {
|
|
335
|
+
"query": "FileByName"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### `dw command [command]`
|
|
341
|
+
|
|
342
|
+
Run admin API commands and pass a JSON payload either inline or by file path.
|
|
343
|
+
|
|
344
|
+
```sh
|
|
345
|
+
dw command PageCopy --json '{ "model": { "SourcePageId": 1189, "DestinationParentPageId": 1129 } }'
|
|
346
|
+
dw command PageMove --json ./PageMove.json
|
|
347
|
+
dw command PageDelete --json '{ "id": "1383" }' --output json
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Example JSON output:
|
|
351
|
+
|
|
352
|
+
```json
|
|
353
|
+
{
|
|
354
|
+
"ok": true,
|
|
355
|
+
"command": "command",
|
|
356
|
+
"operation": "run",
|
|
357
|
+
"status": 200,
|
|
358
|
+
"data": [
|
|
359
|
+
{
|
|
360
|
+
"success": true,
|
|
361
|
+
"message": "Command executed"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"errors": [],
|
|
365
|
+
"meta": {
|
|
366
|
+
"commandName": "PageDelete"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
`dw command --list` is reserved for command metadata, but it is not fully implemented yet.
|
|
372
|
+
|
|
373
|
+
### `dw install [filePath]`
|
|
374
|
+
|
|
375
|
+
Upload and install a `.dll` or `.nupkg` add-in into the current environment.
|
|
376
|
+
|
|
377
|
+
```sh
|
|
378
|
+
dw install ./bin/Release/net10.0/CustomProject.dll
|
|
379
|
+
dw install ./bin/Release/net10.0/CustomProject.dll --queue --output json
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Example JSON output:
|
|
383
|
+
|
|
384
|
+
```json
|
|
385
|
+
{
|
|
386
|
+
"ok": true,
|
|
387
|
+
"command": "install",
|
|
388
|
+
"operation": "queue",
|
|
389
|
+
"status": 200,
|
|
390
|
+
"data": [
|
|
391
|
+
{
|
|
392
|
+
"type": "upload",
|
|
393
|
+
"destinationPath": "System/AddIns/Local",
|
|
394
|
+
"files": [
|
|
395
|
+
"/workspace/bin/Release/net10.0/CustomProject.dll"
|
|
396
|
+
],
|
|
397
|
+
"response": {
|
|
398
|
+
"message": "Upload completed"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"type": "install",
|
|
403
|
+
"filePath": "/workspace/bin/Release/net10.0/CustomProject.dll",
|
|
404
|
+
"filename": "CustomProject.dll",
|
|
405
|
+
"queued": true,
|
|
406
|
+
"response": {
|
|
407
|
+
"success": true,
|
|
408
|
+
"message": "Addin installed"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"errors": [],
|
|
413
|
+
"meta": {
|
|
414
|
+
"filePath": "./bin/Release/net10.0/CustomProject.dll",
|
|
415
|
+
"filesProcessed": 1,
|
|
416
|
+
"chunks": 1
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### `dw config`
|
|
422
|
+
|
|
423
|
+
Write values directly into `~/.dwc` when you want to script config updates.
|
|
424
|
+
|
|
425
|
+
```sh
|
|
426
|
+
dw config --env.dev.host localhost:6001
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### `dw database [path] --export`
|
|
430
|
+
|
|
431
|
+
Export the current environment database to a `.bacpac` file.
|
|
432
|
+
|
|
433
|
+
```sh
|
|
434
|
+
dw database ./backups --export
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### `dw swift [outPath]`
|
|
235
438
|
|
|
236
|
-
|
|
237
|
-
If you prefer not to disable path conversion globally, you can:
|
|
439
|
+
Download the latest Swift release, a specific tag, or the nightly build.
|
|
238
440
|
|
|
239
|
-
|
|
240
|
-
|
|
441
|
+
```sh
|
|
442
|
+
dw swift -l
|
|
443
|
+
dw swift . --tag v1.25.1 --force
|
|
444
|
+
dw swift . --nightly --force
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## CI/CD
|
|
448
|
+
|
|
449
|
+
For CI/CD, prefer OAuth client credentials and JSON output.
|
|
450
|
+
|
|
451
|
+
- Store `DW_CLIENT_ID` and `DW_CLIENT_SECRET` in your pipeline secret store.
|
|
452
|
+
- Use `--host` together with `--auth oauth` for ephemeral runners.
|
|
453
|
+
- Add `--output json` when you want reliable parsing in scripts.
|
|
454
|
+
|
|
455
|
+
Example:
|
|
456
|
+
|
|
457
|
+
```sh
|
|
458
|
+
dw query HealthCheck \
|
|
459
|
+
--host your-solution.example.com \
|
|
460
|
+
--auth oauth \
|
|
461
|
+
--clientIdEnv DW_CLIENT_ID \
|
|
462
|
+
--clientSecretEnv DW_CLIENT_SECRET \
|
|
463
|
+
--output json
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
For longer-lived runners, you can configure a saved environment once with `dw login --oauth`. Full CI/CD guidance will be expanded in the documentation.
|
|
467
|
+
|
|
468
|
+
## Using Git Bash
|
|
469
|
+
|
|
470
|
+
Git Bash can rewrite relative paths in a way that interferes with CLI file operations. If you see the path-conversion warning, disable it for the session before running file commands:
|
|
241
471
|
|
|
242
|
-
|
|
472
|
+
```sh
|
|
473
|
+
export MSYS_NO_PATHCONV=1
|
|
474
|
+
dw files -iro ./ ./TestFolder --host <host> --apiKey <apiKey>
|
|
475
|
+
```
|
|
243
476
|
|
|
244
|
-
|
|
477
|
+
If you do not want to change that setting, prefer `./`-prefixed paths or use PowerShell or CMD instead.
|