@cyberismo/cli 0.0.6 → 0.0.7

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 ADDED
@@ -0,0 +1,25 @@
1
+ ## Command-line interface for [Cyberismo Solution](https://cyberismo.com/solution/)
2
+
3
+ The Cyberismo CLI is an open-source command-line tool that enables Security-as-Code workflows for cybersecurity management and compliance. It provides comprehensive functionality for managing cybersecurity content, from card-based project management to automated reporting and compliance tracking.
4
+
5
+ ### Getting started
6
+
7
+ 1. **Install Cyberismo CLI**
8
+
9
+ ```bash
10
+ npm install -g @cyberismo/cli
11
+ ```
12
+
13
+ 2. **Clone the demo repository**
14
+
15
+ ```bash
16
+ git clone https://github.com/CyberismoCom/cyberismo-demo.git
17
+ cd cyberismo-demo
18
+ ```
19
+
20
+ 3. **Launch the application**
21
+ ```bash
22
+ cyberismo app
23
+ ```
24
+
25
+ The application will be available in your browser at `http://localhost:3000`
package/dist/index.js CHANGED
@@ -11,11 +11,13 @@
11
11
  details. You should have received a copy of the GNU Affero General Public
12
12
  License along with this program. If not, see <https://www.gnu.org/licenses/>.
13
13
  */
14
- import { Argument, Command } from 'commander';
14
+ import { Argument, Command, Option } from 'commander';
15
15
  import confirm from '@inquirer/confirm';
16
+ import dotenv from 'dotenv';
16
17
  import { Cmd, Commands, ExportFormats, } from '@cyberismo/data-handler';
17
18
  import { ResourceTypeParser as Parser } from './resource-type-parser.js';
18
- import { startServer } from '@cyberismo/backend';
19
+ import { startServer, exportSite, previewSite } from '@cyberismo/backend';
20
+ import cliProgress from 'cli-progress';
19
21
  // How many validation errors are shown when staring app, if any.
20
22
  const VALIDATION_ERROR_ROW_LIMIT = 10;
21
23
  // To avoid duplication, fetch description and version from package.json file.
@@ -39,6 +41,13 @@ function truncateMessage(messages, limit = VALIDATION_ERROR_ROW_LIMIT) {
39
41
  }
40
42
  return [...array.slice(0, limit - 1), '...'];
41
43
  }
44
+ // Sets up credentials for git operations.
45
+ function credentials() {
46
+ return {
47
+ username: process.env.CYBERISMO_GIT_USER,
48
+ token: process.env.CYBERISMO_GIT_TOKEN,
49
+ };
50
+ }
42
51
  // Handle the response object from data-handler
43
52
  function handleResponse(response) {
44
53
  if (response.statusCode === 200) {
@@ -61,6 +70,8 @@ function handleResponse(response) {
61
70
  }
62
71
  }
63
72
  }
73
+ // Load environment variables from .env file
74
+ dotenv.config();
64
75
  // Commander
65
76
  const program = new Command();
66
77
  // CLI command handler
@@ -153,7 +164,10 @@ const additionalHelpForRemove = `Sub-command help:
153
164
  program
154
165
  .name('cyberismo')
155
166
  .description(packageDef.description)
156
- .version(packageDef.version);
167
+ .version(packageDef.version)
168
+ .addOption(new Option('-L, --log-level <level>', 'Set the log level')
169
+ .choices(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])
170
+ .default('fatal'));
157
171
  // Add card to a template
158
172
  program
159
173
  .command('add')
@@ -164,7 +178,7 @@ program
164
178
  .option('-p, --project-path [path]', `${pathGuideline}`)
165
179
  .option('-r, --repeat <quantity>', 'Add multiple cards to a template')
166
180
  .action(async (template, cardType, cardKey, options) => {
167
- const result = await commandHandler.command(Cmd.add, [template, cardType, cardKey], options);
181
+ const result = await commandHandler.command(Cmd.add, [template, cardType, cardKey], Object.assign({}, options, program.opts()));
168
182
  handleResponse(result);
169
183
  });
170
184
  const calculate = program
@@ -184,7 +198,7 @@ calculate
184
198
  .argument('<filePath>', 'Path to the logic program')
185
199
  .option('-p, --project-path [path]', `${pathGuideline}`)
186
200
  .action(async (filePath, options) => {
187
- const result = await commandHandler.command(Cmd.calc, ['run', filePath], options);
201
+ const result = await commandHandler.command(Cmd.calc, ['run', filePath], Object.assign({}, options, program.opts()));
188
202
  handleResponse(result);
189
203
  });
190
204
  program
@@ -251,7 +265,7 @@ program
251
265
  // Project path must be set to 'options' when creating a project.
252
266
  options.projectPath = parameter2;
253
267
  }
254
- const result = await commandHandler.command(Cmd.create, [type, target, parameter1, parameter2, parameter3], options);
268
+ const result = await commandHandler.command(Cmd.create, [type, target, parameter1, parameter2, parameter3], Object.assign({}, options, program.opts()));
255
269
  handleResponse(result);
256
270
  });
257
271
  // Edit command
@@ -261,7 +275,7 @@ program
261
275
  .argument('<cardKey>', 'Card key of card')
262
276
  .option('-p, --project-path [path]', `${pathGuideline}`)
263
277
  .action(async (cardKey, options) => {
264
- const result = await commandHandler.command(Cmd.edit, [cardKey], options);
278
+ const result = await commandHandler.command(Cmd.edit, [cardKey], Object.assign({}, options, program.opts()));
265
279
  handleResponse(result);
266
280
  });
267
281
  // Export command
@@ -273,7 +287,35 @@ program
273
287
  .argument('[cardKey]', 'Path to a card. If defined will export only that card and its children instead of whole project.')
274
288
  .option('-p, --project-path [path]', `${pathGuideline}`)
275
289
  .action(async (format, output, cardKey, options) => {
276
- const result = await commandHandler.command(Cmd.export, [format, output, cardKey], options);
290
+ if (format === 'site') {
291
+ const progress = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
292
+ // Should be in commandHandler, once it is moved under the CLI package
293
+ try {
294
+ await exportSite(await commandHandler.getProjectPath(options.projectPath), output, options.logLevel, (current, total) => {
295
+ if (!progress.isActive) {
296
+ progress.start(total, 0);
297
+ }
298
+ if (progress.getTotal() !== total) {
299
+ progress.setTotal(total);
300
+ }
301
+ progress.update(current);
302
+ });
303
+ progress.stop();
304
+ console.log('Exported site to', output);
305
+ console.log('Run `cyberismo preview out` to view the site');
306
+ return;
307
+ }
308
+ catch (e) {
309
+ handleResponse({
310
+ statusCode: 500,
311
+ message: e instanceof Error ? e.message : String(e),
312
+ });
313
+ }
314
+ finally {
315
+ progress.stop();
316
+ }
317
+ }
318
+ const result = await commandHandler.command(Cmd.export, [format, output, cardKey], Object.assign({}, options, program.opts()));
277
319
  handleResponse(result);
278
320
  });
279
321
  const importCmd = program.command('import');
@@ -286,7 +328,7 @@ importCmd
286
328
  .argument('[useCredentials]', 'When using git URL uses credentials for cloning. Default: false')
287
329
  .option('-p, --project-path [path]', `${pathGuideline}`)
288
330
  .action(async (source, branch, useCredentials, options) => {
289
- const result = await commandHandler.command(Cmd.import, ['module', source, branch, String(useCredentials)], options);
331
+ const result = await commandHandler.command(Cmd.import, ['module', source, branch, String(useCredentials)], Object.assign({}, options, program.opts()), credentials());
290
332
  handleResponse(result);
291
333
  });
292
334
  // import csv
@@ -297,7 +339,7 @@ importCmd
297
339
  .argument('[cardKey]', 'Card key of the parent. If defined, cards are created as children of this card')
298
340
  .option('-p, --project-path [path]', `${pathGuideline}`)
299
341
  .action(async (csvFile, cardKey, options) => {
300
- const result = await commandHandler.command(Cmd.import, ['csv', csvFile, cardKey], options);
342
+ const result = await commandHandler.command(Cmd.import, ['csv', csvFile, cardKey], Object.assign({}, options, program.opts()));
301
343
  handleResponse(result);
302
344
  });
303
345
  // Move command
@@ -308,9 +350,16 @@ program
308
350
  .argument('[destination]', 'Destination Card key where "source" is moved to. If moving to root, use "root"')
309
351
  .option('-p, --project-path [path]', `${pathGuideline}`)
310
352
  .action(async (source, destination, options) => {
311
- const result = await commandHandler.command(Cmd.move, [source, destination], options);
353
+ const result = await commandHandler.command(Cmd.move, [source, destination], Object.assign({}, options, program.opts()));
312
354
  handleResponse(result);
313
355
  });
356
+ program
357
+ .command('preview')
358
+ .description('Preview the exported site')
359
+ .argument('[dir]', 'Directory to preview. If not provided, current directory is used.')
360
+ .action(async (dir) => {
361
+ await previewSite(dir || '.', true);
362
+ });
314
363
  const rank = program.command('rank');
315
364
  rank
316
365
  .command('card')
@@ -319,7 +368,7 @@ rank
319
368
  .argument('<afterCardKey>', 'Card key of the card that the card should be after. Use "first" to rank the card first.')
320
369
  .option('-p, --project-path [path]', `${pathGuideline}`)
321
370
  .action(async (cardKey, afterCardKey, options) => {
322
- const result = await commandHandler.command(Cmd.rank, ['card', cardKey, afterCardKey], options);
371
+ const result = await commandHandler.command(Cmd.rank, ['card', cardKey, afterCardKey], Object.assign({}, options, program.opts()));
323
372
  handleResponse(result);
324
373
  });
325
374
  rank
@@ -328,7 +377,7 @@ rank
328
377
  .argument('[parentCardKey]', 'if null, rebalance the whole project, otherwise rebalance only the direct children of the card key')
329
378
  .option('-p, --project-path [path]', `${pathGuideline}`)
330
379
  .action(async (cardKey, options) => {
331
- const result = await commandHandler.command(Cmd.rank, ['rebalance', cardKey], options);
380
+ const result = await commandHandler.command(Cmd.rank, ['rebalance', cardKey], Object.assign({}, options, program.opts()));
332
381
  handleResponse(result);
333
382
  });
334
383
  // Remove command
@@ -367,7 +416,7 @@ program
367
416
  if (!parameter3 && type === 'link') {
368
417
  program.error('error: missing argument <linkType>');
369
418
  }
370
- const result = await commandHandler.command(Cmd.remove, [type, parameter1, parameter2, parameter3], options);
419
+ const result = await commandHandler.command(Cmd.remove, [type, parameter1, parameter2, parameter3], Object.assign({}, options, program.opts()));
371
420
  handleResponse(result);
372
421
  }
373
422
  });
@@ -378,7 +427,7 @@ program
378
427
  .argument('<to>', 'New project prefix')
379
428
  .option('-p, --project-path [path]', `${pathGuideline}`)
380
429
  .action(async (to, options) => {
381
- const result = await commandHandler.command(Cmd.rename, [to], options);
430
+ const result = await commandHandler.command(Cmd.rename, [to], Object.assign({}, options, program.opts()));
382
431
  handleResponse(result);
383
432
  });
384
433
  // Report command
@@ -389,7 +438,7 @@ program
389
438
  .argument('[output]', 'Optional output file; if omitted output will be directed to stdout')
390
439
  .option('-p, --project-path [path]', `${pathGuideline}`)
391
440
  .action(async (parameters, output, options) => {
392
- const result = await commandHandler.command(Cmd.report, [parameters, output], options);
441
+ const result = await commandHandler.command(Cmd.report, [parameters, output], Object.assign({}, options, program.opts()));
393
442
  handleResponse(result);
394
443
  });
395
444
  // Show command
@@ -403,7 +452,7 @@ program
403
452
  .option('-u --show-use', 'Show where resource is used. Only used with resources, otherwise will be ignored.')
404
453
  .action(async (type, typeDetail, options) => {
405
454
  if (type !== '') {
406
- const result = await commandHandler.command(Cmd.show, [type, typeDetail], options);
455
+ const result = await commandHandler.command(Cmd.show, [type, typeDetail], Object.assign({}, options, program.opts()));
407
456
  handleResponse(result);
408
457
  }
409
458
  });
@@ -415,7 +464,7 @@ program
415
464
  .argument('<transition>', 'Workflow state transition that is done.\nYou can list the workflows in a project with "show workflows" command.\nYou can see the available transitions with "show workflow <name>" command.')
416
465
  .option('-p, --project-path [path]', `${pathGuideline}`)
417
466
  .action(async (cardKey, transition, options) => {
418
- const result = await commandHandler.command(Cmd.transition, [cardKey, transition], options);
467
+ const result = await commandHandler.command(Cmd.transition, [cardKey, transition], Object.assign({}, options, program.opts()));
419
468
  handleResponse(result);
420
469
  });
421
470
  // Update command
@@ -428,7 +477,7 @@ program
428
477
  .argument('<value>', 'Value for a detail')
429
478
  .argument('[newValue]', 'When using "change" define new value for detail.\nWhen using "remove" provide optional replacement value for removed value')
430
479
  .action(async (resourceName, key, operation, value, newValue, options) => {
431
- const result = await commandHandler.command(Cmd.update, [resourceName, key, operation, value, newValue], options);
480
+ const result = await commandHandler.command(Cmd.update, [resourceName, key, operation, value, newValue], Object.assign({}, options, program.opts()));
432
481
  handleResponse(result);
433
482
  });
434
483
  // Updates all modules in the project.
@@ -437,7 +486,7 @@ program
437
486
  .description('Updates all imported modules with latest versions')
438
487
  .option('-p, --project-path [path]', `${pathGuideline}`)
439
488
  .action(async (options) => {
440
- const result = await commandHandler.command(Cmd.updateModules, [], options);
489
+ const result = await commandHandler.command(Cmd.updateModules, [], Object.assign({}, options, program.opts()), credentials());
441
490
  handleResponse(result);
442
491
  });
443
492
  // Validate command
@@ -446,7 +495,7 @@ program
446
495
  .description('Validate project structure')
447
496
  .option('-p, --project-path [path]', `${pathGuideline}`)
448
497
  .action(async (options) => {
449
- const result = await commandHandler.command(Cmd.validate, [], options);
498
+ const result = await commandHandler.command(Cmd.validate, [], Object.assign({}, options, program.opts()));
450
499
  handleResponse(result);
451
500
  });
452
501
  // Start app command.
@@ -457,10 +506,11 @@ program
457
506
  program
458
507
  .command('app')
459
508
  .description('Starts the cyberismo app, accessible with a web browser at http://localhost:3000')
509
+ .option('-w, --watch-resource-changes', 'Project watches changes in .cards folder resources')
460
510
  .option('-p, --project-path [path]', `${pathGuideline}`)
461
511
  .action(async (options) => {
462
512
  // validate project
463
- const result = await commandHandler.command(Cmd.validate, [], options);
513
+ const result = await commandHandler.command(Cmd.validate, [], Object.assign({}, options, program.opts()));
464
514
  if (!result.message) {
465
515
  program.error('Expected validation result, but got none');
466
516
  return;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAEL,GAAG,EACH,QAAQ,EACR,aAAa,GAGd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,iEAAiE;AACjE,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,UAAU,GAAG,CAAC,MAAM,MAAM,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;KAC7E,OAAO,CAAC;AAEX,sDAAsD;AACtD,yEAAyE;AACzE,2EAA2E;AAC3E,2CAA2C;AAC3C,SAAS,eAAe,CACtB,QAAgB,EAChB,QAAgB,0BAA0B;IAE1C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAC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iBAAiB,EAAE,IAAI,EAAE,CAChE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,OAAO,KAAK,CAAC,IAAI,KAAK,kBAAkB,CAAC;QAC3C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,cAAc,CAAC,MAAM,CAAC,CAAC;YACvB,OAAO;QACT,CAAC;IACH,CAAC;IACD,WAAW,CAAC,MAAM,cAAc,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAEL,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyberismo/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "CLI tool to handle tasks.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -15,16 +15,21 @@
15
15
  "author": "",
16
16
  "license": "AGPL-3.0",
17
17
  "dependencies": {
18
- "@inquirer/confirm": "^5.1.9",
19
- "commander": "^13.1.0",
20
- "@cyberismo/backend": "0.0.6",
21
- "@cyberismo/data-handler": "0.0.6"
18
+ "@inquirer/confirm": "^5.1.12",
19
+ "cli-progress": "^3.12.0",
20
+ "commander": "^14.0.0",
21
+ "dotenv": "^16.5.0",
22
+ "@cyberismo/backend": "0.0.7",
23
+ "@cyberismo/data-handler": "0.0.7"
22
24
  },
23
25
  "types": "dist/index.d.ts",
24
26
  "type": "module",
25
27
  "exports": {
26
28
  ".": "./dist/index.js"
27
29
  },
30
+ "devDependencies": {
31
+ "@types/cli-progress": "^3.11.6"
32
+ },
28
33
  "scripts": {
29
34
  "preinstall": "npx only-allow pnpm",
30
35
  "build": "tsc -p tsconfig.build.json",
package/src/index.ts CHANGED
@@ -12,18 +12,22 @@
12
12
  License along with this program. If not, see <https://www.gnu.org/licenses/>.
13
13
  */
14
14
 
15
- import { Argument, Command } from 'commander';
15
+ import { Argument, Command, Option } from 'commander';
16
16
  import confirm from '@inquirer/confirm';
17
+ import dotenv from 'dotenv';
17
18
  import {
18
19
  type CardsOptions,
19
20
  Cmd,
20
21
  Commands,
21
22
  ExportFormats,
23
+ type Credentials,
22
24
  type requestStatus,
23
25
  type UpdateOperations,
24
26
  } from '@cyberismo/data-handler';
25
27
  import { ResourceTypeParser as Parser } from './resource-type-parser.js';
26
- import { startServer } from '@cyberismo/backend';
28
+ import { startServer, exportSite, previewSite } from '@cyberismo/backend';
29
+ import cliProgress from 'cli-progress';
30
+
27
31
  // How many validation errors are shown when staring app, if any.
28
32
  const VALIDATION_ERROR_ROW_LIMIT = 10;
29
33
 
@@ -53,6 +57,14 @@ function truncateMessage(
53
57
  return [...array.slice(0, limit - 1), '...'];
54
58
  }
55
59
 
60
+ // Sets up credentials for git operations.
61
+ function credentials(): Credentials | undefined {
62
+ return {
63
+ username: process.env.CYBERISMO_GIT_USER,
64
+ token: process.env.CYBERISMO_GIT_TOKEN,
65
+ };
66
+ }
67
+
56
68
  // Handle the response object from data-handler
57
69
  function handleResponse(response: requestStatus) {
58
70
  if (response.statusCode === 200) {
@@ -73,6 +85,9 @@ function handleResponse(response: requestStatus) {
73
85
  }
74
86
  }
75
87
 
88
+ // Load environment variables from .env file
89
+ dotenv.config();
90
+
76
91
  // Commander
77
92
  const program = new Command();
78
93
 
@@ -172,7 +187,12 @@ const additionalHelpForRemove = `Sub-command help:
172
187
  program
173
188
  .name('cyberismo')
174
189
  .description(packageDef.description)
175
- .version(packageDef.version);
190
+ .version(packageDef.version)
191
+ .addOption(
192
+ new Option('-L, --log-level <level>', 'Set the log level')
193
+ .choices(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])
194
+ .default('fatal'),
195
+ );
176
196
 
177
197
  // Add card to a template
178
198
  program
@@ -199,7 +219,7 @@ program
199
219
  const result = await commandHandler.command(
200
220
  Cmd.add,
201
221
  [template, cardType, cardKey],
202
- options,
222
+ Object.assign({}, options, program.opts()),
203
223
  );
204
224
  handleResponse(result);
205
225
  },
@@ -229,7 +249,7 @@ calculate
229
249
  const result = await commandHandler.command(
230
250
  Cmd.calc,
231
251
  ['run', filePath],
232
- options,
252
+ Object.assign({}, options, program.opts()),
233
253
  );
234
254
  handleResponse(result);
235
255
  });
@@ -334,7 +354,7 @@ program
334
354
  const result = await commandHandler.command(
335
355
  Cmd.create,
336
356
  [type, target, parameter1, parameter2, parameter3],
337
- options,
357
+ Object.assign({}, options, program.opts()),
338
358
  );
339
359
  handleResponse(result);
340
360
  },
@@ -347,7 +367,11 @@ program
347
367
  .argument('<cardKey>', 'Card key of card')
348
368
  .option('-p, --project-path [path]', `${pathGuideline}`)
349
369
  .action(async (cardKey: string, options: CardsOptions) => {
350
- const result = await commandHandler.command(Cmd.edit, [cardKey], options);
370
+ const result = await commandHandler.command(
371
+ Cmd.edit,
372
+ [cardKey],
373
+ Object.assign({}, options, program.opts()),
374
+ );
351
375
  handleResponse(result);
352
376
  });
353
377
 
@@ -373,10 +397,44 @@ program
373
397
  cardKey: string,
374
398
  options: CardsOptions,
375
399
  ) => {
400
+ if (format === 'site') {
401
+ const progress = new cliProgress.SingleBar(
402
+ {},
403
+ cliProgress.Presets.shades_classic,
404
+ );
405
+ // Should be in commandHandler, once it is moved under the CLI package
406
+ try {
407
+ await exportSite(
408
+ await commandHandler.getProjectPath(options.projectPath),
409
+ output,
410
+ options.logLevel,
411
+ (current: number, total: number) => {
412
+ if (!progress.isActive) {
413
+ progress.start(total, 0);
414
+ }
415
+ if (progress.getTotal() !== total) {
416
+ progress.setTotal(total);
417
+ }
418
+ progress.update(current);
419
+ },
420
+ );
421
+ progress.stop();
422
+ console.log('Exported site to', output);
423
+ console.log('Run `cyberismo preview out` to view the site');
424
+ return;
425
+ } catch (e) {
426
+ handleResponse({
427
+ statusCode: 500,
428
+ message: e instanceof Error ? e.message : String(e),
429
+ });
430
+ } finally {
431
+ progress.stop();
432
+ }
433
+ }
376
434
  const result = await commandHandler.command(
377
435
  Cmd.export,
378
436
  [format, output, cardKey],
379
- options,
437
+ Object.assign({}, options, program.opts()),
380
438
  );
381
439
  handleResponse(result);
382
440
  },
@@ -407,7 +465,8 @@ importCmd
407
465
  const result = await commandHandler.command(
408
466
  Cmd.import,
409
467
  ['module', source, branch, String(useCredentials)],
410
- options,
468
+ Object.assign({}, options, program.opts()),
469
+ credentials(),
411
470
  );
412
471
  handleResponse(result);
413
472
  },
@@ -427,7 +486,7 @@ importCmd
427
486
  const result = await commandHandler.command(
428
487
  Cmd.import,
429
488
  ['csv', csvFile, cardKey],
430
- options,
489
+ Object.assign({}, options, program.opts()),
431
490
  );
432
491
  handleResponse(result);
433
492
  });
@@ -449,12 +508,23 @@ program
449
508
  const result = await commandHandler.command(
450
509
  Cmd.move,
451
510
  [source, destination],
452
- options,
511
+ Object.assign({}, options, program.opts()),
453
512
  );
454
513
  handleResponse(result);
455
514
  },
456
515
  );
457
516
 
517
+ program
518
+ .command('preview')
519
+ .description('Preview the exported site')
520
+ .argument(
521
+ '[dir]',
522
+ 'Directory to preview. If not provided, current directory is used.',
523
+ )
524
+ .action(async (dir: string) => {
525
+ await previewSite(dir || '.', true);
526
+ });
527
+
458
528
  const rank = program.command('rank');
459
529
 
460
530
  rank
@@ -473,7 +543,7 @@ rank
473
543
  const result = await commandHandler.command(
474
544
  Cmd.rank,
475
545
  ['card', cardKey, afterCardKey],
476
- options,
546
+ Object.assign({}, options, program.opts()),
477
547
  );
478
548
  handleResponse(result);
479
549
  },
@@ -493,7 +563,7 @@ rank
493
563
  const result = await commandHandler.command(
494
564
  Cmd.rank,
495
565
  ['rebalance', cardKey],
496
- options,
566
+ Object.assign({}, options, program.opts()),
497
567
  );
498
568
  handleResponse(result);
499
569
  });
@@ -555,7 +625,7 @@ program
555
625
  const result = await commandHandler.command(
556
626
  Cmd.remove,
557
627
  [type, parameter1, parameter2, parameter3],
558
- options,
628
+ Object.assign({}, options, program.opts()),
559
629
  );
560
630
  handleResponse(result);
561
631
  }
@@ -571,7 +641,11 @@ program
571
641
  .argument('<to>', 'New project prefix')
572
642
  .option('-p, --project-path [path]', `${pathGuideline}`)
573
643
  .action(async (to: string, options: CardsOptions) => {
574
- const result = await commandHandler.command(Cmd.rename, [to], options);
644
+ const result = await commandHandler.command(
645
+ Cmd.rename,
646
+ [to],
647
+ Object.assign({}, options, program.opts()),
648
+ );
575
649
  handleResponse(result);
576
650
  });
577
651
 
@@ -592,7 +666,7 @@ program
592
666
  const result = await commandHandler.command(
593
667
  Cmd.report,
594
668
  [parameters, output],
595
- options,
669
+ Object.assign({}, options, program.opts()),
596
670
  );
597
671
  handleResponse(result);
598
672
  });
@@ -624,7 +698,7 @@ program
624
698
  const result = await commandHandler.command(
625
699
  Cmd.show,
626
700
  [type, typeDetail],
627
- options,
701
+ Object.assign({}, options, program.opts()),
628
702
  );
629
703
  handleResponse(result);
630
704
  }
@@ -645,7 +719,7 @@ program
645
719
  const result = await commandHandler.command(
646
720
  Cmd.transition,
647
721
  [cardKey, transition],
648
- options,
722
+ Object.assign({}, options, program.opts()),
649
723
  );
650
724
  handleResponse(result);
651
725
  },
@@ -678,7 +752,7 @@ program
678
752
  const result = await commandHandler.command(
679
753
  Cmd.update,
680
754
  [resourceName, key, operation, value, newValue],
681
- options,
755
+ Object.assign({}, options, program.opts()),
682
756
  );
683
757
  handleResponse(result);
684
758
  },
@@ -690,7 +764,12 @@ program
690
764
  .description('Updates all imported modules with latest versions')
691
765
  .option('-p, --project-path [path]', `${pathGuideline}`)
692
766
  .action(async (options: CardsOptions) => {
693
- const result = await commandHandler.command(Cmd.updateModules, [], options);
767
+ const result = await commandHandler.command(
768
+ Cmd.updateModules,
769
+ [],
770
+ Object.assign({}, options, program.opts()),
771
+ credentials(),
772
+ );
694
773
  handleResponse(result);
695
774
  });
696
775
 
@@ -700,7 +779,11 @@ program
700
779
  .description('Validate project structure')
701
780
  .option('-p, --project-path [path]', `${pathGuideline}`)
702
781
  .action(async (options: CardsOptions) => {
703
- const result = await commandHandler.command(Cmd.validate, [], options);
782
+ const result = await commandHandler.command(
783
+ Cmd.validate,
784
+ [],
785
+ Object.assign({}, options, program.opts()),
786
+ );
704
787
  handleResponse(result);
705
788
  });
706
789
 
@@ -714,10 +797,18 @@ program
714
797
  .description(
715
798
  'Starts the cyberismo app, accessible with a web browser at http://localhost:3000',
716
799
  )
800
+ .option(
801
+ '-w, --watch-resource-changes',
802
+ 'Project watches changes in .cards folder resources',
803
+ )
717
804
  .option('-p, --project-path [path]', `${pathGuideline}`)
718
805
  .action(async (options: CardsOptions) => {
719
806
  // validate project
720
- const result = await commandHandler.command(Cmd.validate, [], options);
807
+ const result = await commandHandler.command(
808
+ Cmd.validate,
809
+ [],
810
+ Object.assign({}, options, program.opts()),
811
+ );
721
812
  if (!result.message) {
722
813
  program.error('Expected validation result, but got none');
723
814
  return;