simplemdg-dev-cli 1.3.1 → 1.4.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 +181 -127
- package/USER_GUIDE.md +181 -127
- package/dist/commands/cf.command.js +231 -25
- package/dist/commands/cf.command.js.map +1 -1
- package/dist/core/cf.js +10 -1
- package/dist/core/cf.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,229 +1,283 @@
|
|
|
1
|
-
# SimpleMDG Dev CLI
|
|
1
|
+
# SimpleMDG Dev CLI Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Purpose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`simplemdg-dev-cli` helps SimpleMDG developers run common local development and BTP tasks without remembering long commands.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm i -g simplemdg-dev-cli@latest
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Check installation:
|
|
7
|
+
Main command:
|
|
12
8
|
|
|
13
|
-
```
|
|
14
|
-
smdg
|
|
9
|
+
```bash
|
|
10
|
+
smdg
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Install:
|
|
18
14
|
|
|
19
|
-
```
|
|
20
|
-
simplemdg
|
|
15
|
+
```bash
|
|
16
|
+
npm i -g simplemdg-dev-cli@latest
|
|
21
17
|
```
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Run:
|
|
19
|
+
Open this guide:
|
|
26
20
|
|
|
27
|
-
```
|
|
28
|
-
smdg
|
|
21
|
+
```bash
|
|
22
|
+
smdg guide
|
|
29
23
|
```
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- View quick guide in terminal
|
|
34
|
-
- Open visual guide in browser
|
|
35
|
-
- Show command help
|
|
25
|
+
---
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
# Select Usage
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
smdg guide
|
|
41
|
-
```
|
|
29
|
+
When the CLI shows a select list:
|
|
42
30
|
|
|
43
|
-
|
|
31
|
+
* Type a few characters to search.
|
|
32
|
+
* Use `↑` and `↓` to move.
|
|
33
|
+
* Press `Enter` to select.
|
|
34
|
+
* If no item matches, some prompts allow using the typed value.
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
smdg guide --web
|
|
47
|
-
```
|
|
36
|
+
This is useful for long lists of BTP orgs, spaces, apps, package IDs, CAP profiles, and CDS services.
|
|
48
37
|
|
|
49
|
-
|
|
38
|
+
---
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
smdg guide --terminal
|
|
53
|
-
```
|
|
40
|
+
# Common Commands
|
|
54
41
|
|
|
55
|
-
##
|
|
42
|
+
## `smdg npmrc import`
|
|
56
43
|
|
|
57
|
-
|
|
44
|
+
Import SimpleMDG GitLab package IDs into local cache.
|
|
58
45
|
|
|
59
|
-
|
|
46
|
+
Use this after downloading the package ID import file from the team.
|
|
60
47
|
|
|
61
|
-
```
|
|
62
|
-
smdg npmrc import
|
|
48
|
+
```bash
|
|
49
|
+
smdg npmrc import
|
|
63
50
|
```
|
|
64
51
|
|
|
65
|
-
|
|
52
|
+
## `smdg npmrc create`
|
|
53
|
+
|
|
54
|
+
Create `.npmrc` for SimpleMDG private npm packages.
|
|
66
55
|
|
|
67
|
-
```
|
|
56
|
+
```bash
|
|
68
57
|
smdg npmrc create
|
|
69
58
|
```
|
|
70
59
|
|
|
71
|
-
The CLI
|
|
60
|
+
The CLI helps select package name/package ID and token from cache.
|
|
72
61
|
|
|
73
|
-
|
|
62
|
+
## `smdg i`
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
Install dependencies for the current project.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
76
67
|
smdg i
|
|
77
68
|
```
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Full command:
|
|
70
|
+
It can scan variables such as `${SIMPLEMDG_BRANCH}` and ask for replacement values automatically.
|
|
82
71
|
|
|
83
|
-
|
|
84
|
-
smdg install
|
|
85
|
-
```
|
|
72
|
+
## `smdg cf login`
|
|
86
73
|
|
|
87
|
-
|
|
74
|
+
Login to BTP Cloud Foundry.
|
|
88
75
|
|
|
89
|
-
```
|
|
76
|
+
```bash
|
|
90
77
|
smdg cf login
|
|
91
78
|
```
|
|
92
79
|
|
|
93
|
-
The CLI
|
|
80
|
+
The CLI helps select API endpoint, org, and space. Choose to save the password on your own machine if you want automatic re-login for org switching, logs, app listing, and debugging.
|
|
81
|
+
|
|
82
|
+
It can save login information on your local machine so later commands can re-login automatically when the CF session expires.
|
|
83
|
+
|
|
84
|
+
## `smdg cf org`
|
|
94
85
|
|
|
95
|
-
|
|
86
|
+
Search, list, and switch Cloud Foundry orgs across regions.
|
|
96
87
|
|
|
97
|
-
```
|
|
88
|
+
```bash
|
|
98
89
|
smdg cf org
|
|
99
90
|
```
|
|
100
91
|
|
|
101
|
-
|
|
92
|
+
The CLI scans known and cached BTP region endpoints and shows orgs from different regions in one searchable list. If the CF session for a region is expired, the CLI automatically re-authenticates by using the username/password saved from `smdg cf login`.
|
|
102
93
|
|
|
103
|
-
|
|
94
|
+
The list includes region information, for example:
|
|
95
|
+
|
|
96
|
+
```txt
|
|
97
|
+
arthrex-dev-simplemdg eu10 · 1 space
|
|
98
|
+
alcon-dev-simplemdg br10 · 1 space
|
|
99
|
+
ait-dev-simplemdg us21 · 1 space
|
|
100
|
+
```
|
|
104
101
|
|
|
105
|
-
|
|
102
|
+
Use this when you have many orgs across many BTP regions. Run `smdg cf login` once and choose to save the password on your machine so org switching, app listing, logs, and debug can re-login automatically when the CF session expires.
|
|
103
|
+
|
|
104
|
+
## `smdg cf target`
|
|
105
|
+
|
|
106
|
+
Show the current Cloud Foundry target.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
106
109
|
smdg cf target
|
|
107
110
|
```
|
|
108
111
|
|
|
109
|
-
|
|
112
|
+
It shows API endpoint, user, org, and space.
|
|
113
|
+
|
|
114
|
+
## `smdg cf apps`
|
|
115
|
+
|
|
116
|
+
List BTP apps in the current org and space.
|
|
110
117
|
|
|
111
|
-
```
|
|
118
|
+
```bash
|
|
112
119
|
smdg cf apps
|
|
113
120
|
```
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
The CLI uses cache first for speed and refreshes in the background.
|
|
116
123
|
|
|
117
|
-
|
|
124
|
+
## `smdg cf bind`
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
Bind the local CAP project to a deployed BTP app service.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
smdg cf bind
|
|
121
130
|
```
|
|
122
131
|
|
|
123
|
-
|
|
132
|
+
This helps run `cds bind --to-app-services` and update `.cdsrc-private.json`.
|
|
124
133
|
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
## `smdg cf env`
|
|
135
|
+
|
|
136
|
+
Export BTP app environment variables to a clean JSON file.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
smdg cf env
|
|
127
140
|
```
|
|
128
141
|
|
|
129
|
-
|
|
142
|
+
Useful for creating `default-env.json`.
|
|
143
|
+
|
|
144
|
+
## `smdg cds watch`
|
|
145
|
+
|
|
146
|
+
Run CAP locally.
|
|
130
147
|
|
|
131
|
-
```
|
|
132
|
-
cds
|
|
148
|
+
```bash
|
|
149
|
+
smdg cds watch
|
|
133
150
|
```
|
|
134
151
|
|
|
135
|
-
|
|
152
|
+
The CLI helps select CAP profile and port.
|
|
136
153
|
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
## `smdg cf logs`
|
|
155
|
+
|
|
156
|
+
View BTP app logs.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
smdg cf logs
|
|
139
160
|
```
|
|
140
161
|
|
|
141
|
-
|
|
162
|
+
It can be used for realtime log monitoring.
|
|
163
|
+
|
|
164
|
+
## `smdg cf debug`
|
|
142
165
|
|
|
143
|
-
|
|
144
|
-
|
|
166
|
+
Debug a deployed BTP Cloud Foundry Node.js app.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
smdg cf debug
|
|
145
170
|
```
|
|
146
171
|
|
|
147
|
-
|
|
172
|
+
The CLI guides you through:
|
|
173
|
+
|
|
174
|
+
* selecting current target or searching orgs across regions
|
|
175
|
+
* selecting BTP app
|
|
176
|
+
* selecting debug mode
|
|
177
|
+
* selecting app instance
|
|
178
|
+
* preparing Node.js inspector
|
|
179
|
+
* creating VS Code attach config
|
|
180
|
+
* opening the CF SSH tunnel
|
|
148
181
|
|
|
149
|
-
|
|
150
|
-
|
|
182
|
+
Recommended mode:
|
|
183
|
+
|
|
184
|
+
```txt
|
|
185
|
+
VS Code guided debugging
|
|
151
186
|
```
|
|
152
187
|
|
|
153
|
-
|
|
188
|
+
Important VS Code note:
|
|
154
189
|
|
|
155
|
-
|
|
156
|
-
|
|
190
|
+
The debug toolbar buttons such as pause, step over, restart, and stop only appear after VS Code successfully attaches to the running Node.js inspector.
|
|
191
|
+
|
|
192
|
+
Normal flow:
|
|
193
|
+
|
|
194
|
+
1. Run `smdg cf debug`.
|
|
195
|
+
2. Select `VS Code guided debugging`.
|
|
196
|
+
3. First time for an app, select `Set NODE_OPTIONS and restart app`.
|
|
197
|
+
4. Keep the terminal open because it owns the CF SSH tunnel.
|
|
198
|
+
5. In VS Code, open Run and Debug with `Ctrl+Shift+D`.
|
|
199
|
+
6. Select `Attach BTP <app-name>`.
|
|
200
|
+
7. Press `F5` or the green Start Debugging button.
|
|
201
|
+
8. After attach succeeds, the debug toolbar appears.
|
|
202
|
+
|
|
203
|
+
Use this mainly in dev/test environments because enabling Node inspector restarts the BTP app.
|
|
204
|
+
|
|
205
|
+
## `smdg cds compline`
|
|
206
|
+
|
|
207
|
+
Generate metadata XML from CDS services.
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
smdg cds compline
|
|
157
211
|
```
|
|
158
212
|
|
|
159
|
-
The CLI scans
|
|
213
|
+
The CLI scans CDS services, suggests output XML names, and writes XML using UTF-8 encoding.
|
|
214
|
+
|
|
215
|
+
---
|
|
160
216
|
|
|
161
|
-
|
|
217
|
+
# Recommended Daily Flow
|
|
162
218
|
|
|
163
|
-
```
|
|
164
|
-
smdg
|
|
219
|
+
```bash
|
|
220
|
+
smdg npmrc create
|
|
221
|
+
smdg i
|
|
222
|
+
smdg cf login
|
|
223
|
+
smdg cf apps
|
|
224
|
+
smdg cf bind
|
|
225
|
+
smdg cf env
|
|
226
|
+
smdg cds watch
|
|
165
227
|
```
|
|
166
228
|
|
|
167
|
-
|
|
229
|
+
For logs:
|
|
168
230
|
|
|
169
|
-
```
|
|
231
|
+
```bash
|
|
170
232
|
smdg cf logs
|
|
171
233
|
```
|
|
172
234
|
|
|
173
|
-
|
|
235
|
+
For BTP debugging:
|
|
174
236
|
|
|
175
|
-
```
|
|
176
|
-
smdg cf
|
|
237
|
+
```bash
|
|
238
|
+
smdg cf debug
|
|
177
239
|
```
|
|
178
240
|
|
|
179
|
-
|
|
241
|
+
For metadata XML:
|
|
180
242
|
|
|
181
|
-
```
|
|
243
|
+
```bash
|
|
182
244
|
smdg cds compline
|
|
183
245
|
```
|
|
184
246
|
|
|
185
|
-
|
|
247
|
+
---
|
|
186
248
|
|
|
187
|
-
|
|
249
|
+
# Key Features
|
|
188
250
|
|
|
189
|
-
|
|
190
|
-
smdg cds compline --to edmx --service MainService --out srv_config_main.xml
|
|
191
|
-
```
|
|
251
|
+
## Private npm registry helper
|
|
192
252
|
|
|
193
|
-
|
|
253
|
+
Creates `.npmrc` for SimpleMDG GitLab npm packages and caches package IDs with readable names.
|
|
194
254
|
|
|
195
|
-
|
|
196
|
-
smdg cf debug
|
|
197
|
-
```
|
|
255
|
+
## Smart install helper
|
|
198
256
|
|
|
199
|
-
|
|
257
|
+
Scans project variables like `${SIMPLEMDG_BRANCH}` and asks for values automatically before install.
|
|
200
258
|
|
|
201
|
-
|
|
202
|
-
- BTP app
|
|
203
|
-
- debug mode
|
|
204
|
-
- app instance
|
|
205
|
-
- local debug port
|
|
259
|
+
## Cloud Foundry helper
|
|
206
260
|
|
|
207
|
-
|
|
261
|
+
Helps with login, target checking, org switching, app list, binding, env export, logs, and debugging.
|
|
208
262
|
|
|
209
|
-
##
|
|
263
|
+
## Across-region org search
|
|
210
264
|
|
|
211
|
-
|
|
265
|
+
Scans known and cached BTP regions and shows orgs from many regions in one searchable list. The CLI now re-authenticates per region using the cached login profile, so switching orgs should not fail just because `cf api` changed to another region.
|
|
212
266
|
|
|
213
|
-
|
|
214
|
-
- Use `↑` and `↓` to move.
|
|
215
|
-
- Press `Enter` to select.
|
|
216
|
-
- If no item matches, press `Enter` to use the value you typed.
|
|
267
|
+
## CAP helper
|
|
217
268
|
|
|
218
|
-
|
|
269
|
+
Helps run `cds watch`, select profiles/ports, and generate CDS metadata XML.
|
|
219
270
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
271
|
+
## VS Code BTP debugging
|
|
272
|
+
|
|
273
|
+
Creates VS Code attach config and opens a CF SSH tunnel to debug BTP Node.js apps from local source code. For the first debug session of an app, use `Set NODE_OPTIONS and restart app`; later sessions can use `Inspector is already enabled`.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
# Notes
|
|
278
|
+
|
|
279
|
+
Do not commit real secrets to Git.
|
|
280
|
+
|
|
281
|
+
Files like `.npmrc`, `default-env.json`, and cached passwords may contain sensitive data.
|
|
282
|
+
|
|
283
|
+
Use saved password only on your own machine.
|