@atlaskit/ads-cli 0.4.2 → 0.5.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/ads-cli.js +5 -1
  3. package/dist/cjs/atlas-cli.js +4 -1
  4. package/dist/cjs/cli.js +91 -35
  5. package/dist/cjs/commands/build-manifest.js +1 -2
  6. package/dist/cjs/commands/cli-metadata.js +2 -1
  7. package/dist/cjs/commands/definitions.js +16 -16
  8. package/dist/cjs/output/format-disambiguation.js +3 -1
  9. package/dist/cjs/output/format-grouped-results.js +6 -2
  10. package/dist/cjs/output/format-manifest.js +5 -3
  11. package/dist/cjs/output/format-results.js +25 -18
  12. package/dist/es2019/atlas-cli.js +4 -1
  13. package/dist/es2019/cli.js +69 -17
  14. package/dist/es2019/commands/build-manifest.js +1 -2
  15. package/dist/es2019/commands/cli-metadata.js +1 -0
  16. package/dist/es2019/commands/definitions.js +8 -6
  17. package/dist/es2019/output/format-disambiguation.js +3 -2
  18. package/dist/es2019/output/format-grouped-results.js +5 -2
  19. package/dist/es2019/output/format-manifest.js +6 -3
  20. package/dist/es2019/output/format-results.js +25 -18
  21. package/dist/esm/atlas-cli.js +4 -1
  22. package/dist/esm/cli.js +92 -36
  23. package/dist/esm/commands/build-manifest.js +1 -2
  24. package/dist/esm/commands/cli-metadata.js +1 -0
  25. package/dist/esm/commands/definitions.js +16 -16
  26. package/dist/esm/output/format-disambiguation.js +3 -1
  27. package/dist/esm/output/format-grouped-results.js +6 -2
  28. package/dist/esm/output/format-manifest.js +5 -3
  29. package/dist/esm/output/format-results.js +26 -18
  30. package/dist/types/cli.d.ts +10 -1
  31. package/dist/types/commands/build-manifest.d.ts +1 -2
  32. package/dist/types/commands/cli-metadata.d.ts +1 -0
  33. package/dist/types/commands/types.d.ts +12 -1
  34. package/dist/types/output/format-disambiguation.d.ts +1 -1
  35. package/dist/types/output/format-grouped-results.d.ts +2 -1
  36. package/dist/types/output/format-manifest.d.ts +2 -1
  37. package/dist/types/output/format-results.d.ts +4 -3
  38. package/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  * `@atlaskit/ads-mcp`, so the MCP server, the ADS skill, and this CLI stay in lock-step.
10
10
  */
11
11
 
12
- import { CLI_DESCRIPTION, globalFlags } from './commands/cli-metadata';
12
+ import { CLI_BIN_NAME, CLI_DESCRIPTION, globalFlags } from './commands/cli-metadata';
13
13
  import { commands } from './commands/definitions';
14
14
  import { getCommand } from './commands/get-command';
15
15
  import { getVersion } from './commands/get-version';
@@ -31,7 +31,7 @@ import { ExitCode } from './types';
31
31
  * Build the top-level help text from the command registry so it can never drift from the
32
32
  * runnable surface.
33
33
  */
34
- const buildHelpText = () => {
34
+ const buildHelpText = invocation => {
35
35
  // Width of the usage "gutter"; descriptions align to this column. Usages longer than the
36
36
  // gutter wrap onto their own line with the description indented beneath, so a long usage
37
37
  // (e.g. `docs`, which lists every topic) never produces a single 130-column line.
@@ -49,7 +49,46 @@ const buildHelpText = () => {
49
49
  const aliases = flag.alias ? `, -${flag.alias}` : '';
50
50
  return ` --${flag.name}${aliases}`.padEnd(18) + flag.description;
51
51
  }).join('\n');
52
- return [CLI_DESCRIPTION, '', 'Usage', ' $ npx @atlaskit/ads-cli <command> [options]', '', 'Commands', commandLines, '', 'Global options', globalFlagLines, '', 'Examples', ' $ npx @atlaskit/ads-cli search contrast # unified: components, tokens, icons & docs', ' $ npx @atlaskit/ads-cli search button --type component', ' $ npx @atlaskit/ads-cli search contrast --type docs', ' $ npx @atlaskit/ads-cli component Button # detail for one component', ' $ npx @atlaskit/ads-cli token space.100 # detail for one token', ' $ npx @atlaskit/ads-cli icon --all # list every icon', ' $ npx @atlaskit/ads-cli docs spacing # foundations docs', ' $ npx @atlaskit/ads-cli docs a11y buttons # accessibility guidance', ' $ npx @atlaskit/ads-cli docs migration motion # migration guide', ' $ npx @atlaskit/ads-cli manifest --json # machine-readable CLI contract'].join('\n');
52
+ const examples = [{
53
+ command: 'search contrast',
54
+ comment: 'unified: components, tokens, icons & docs'
55
+ }, {
56
+ command: 'search button --type component'
57
+ }, {
58
+ command: 'search contrast --type docs'
59
+ }, {
60
+ command: 'component Button',
61
+ comment: 'detail for one component'
62
+ }, {
63
+ command: 'token space.100',
64
+ comment: 'detail for one token'
65
+ }, {
66
+ command: 'icon --all',
67
+ comment: 'list every icon'
68
+ }, {
69
+ command: 'docs spacing',
70
+ comment: 'foundations docs'
71
+ }, {
72
+ command: 'docs a11y buttons',
73
+ comment: 'accessibility guidance'
74
+ }, {
75
+ command: 'docs migration motion',
76
+ comment: 'migration guide'
77
+ }, {
78
+ command: 'manifest --json',
79
+ comment: 'machine-readable CLI contract'
80
+ }];
81
+ const exampleCommands = examples.map(({
82
+ command
83
+ }) => `$ ${invocation} ${command}`);
84
+ const exampleWidth = Math.max(...exampleCommands.map(command => command.length));
85
+ const exampleLines = examples.map(({
86
+ comment
87
+ }, index) => {
88
+ const command = exampleCommands[index];
89
+ return ` ${comment ? `${command.padEnd(exampleWidth)} # ${comment}` : command}`;
90
+ }).join('\n');
91
+ return [CLI_DESCRIPTION, '', 'Usage', ` $ ${invocation} <command> [options]`, '', 'Commands', commandLines, '', 'Global options', globalFlagLines, '', 'Examples', exampleLines].join('\n');
53
92
  };
54
93
 
55
94
  /**
@@ -59,7 +98,8 @@ const runRegistryCommand = async ({
59
98
  command,
60
99
  input,
61
100
  json,
62
- writer
101
+ writer,
102
+ invocation
63
103
  }) => {
64
104
  var _resolved$meta3;
65
105
  const resolved = command.resolve(input);
@@ -99,7 +139,8 @@ const runRegistryCommand = async ({
99
139
  },
100
140
  meta: (_resolved$meta = resolved.meta) !== null && _resolved$meta !== void 0 ? _resolved$meta : {},
101
141
  json,
102
- writer
142
+ writer,
143
+ invocation
103
144
  });
104
145
  }
105
146
 
@@ -126,7 +167,8 @@ const runRegistryCommand = async ({
126
167
  results,
127
168
  meta: (_resolved$meta2 = resolved.meta) !== null && _resolved$meta2 !== void 0 ? _resolved$meta2 : {},
128
169
  json,
129
- writer
170
+ writer,
171
+ invocation
130
172
  });
131
173
  }
132
174
  return renderSingleResult({
@@ -135,7 +177,8 @@ const runRegistryCommand = async ({
135
177
  result: results[0],
136
178
  meta: (_resolved$meta3 = resolved.meta) !== null && _resolved$meta3 !== void 0 ? _resolved$meta3 : {},
137
179
  json,
138
- writer
180
+ writer,
181
+ invocation
139
182
  });
140
183
  };
141
184
 
@@ -148,7 +191,8 @@ const renderSingleResult = ({
148
191
  result,
149
192
  meta,
150
193
  json,
151
- writer
194
+ writer,
195
+ invocation
152
196
  }) => {
153
197
  var _command$resultKind, _ref, _command$formatHuman;
154
198
  const {
@@ -228,9 +272,12 @@ const renderSingleResult = ({
228
272
  const compact = resultKind ? formatCompactResults({
229
273
  kind: resultKind,
230
274
  data,
231
- showFollowUp: command.name === 'search'
275
+ showFollowUp: command.name === 'search',
276
+ invocation
232
277
  }) : null;
233
- const human = (_ref = compact !== null && compact !== void 0 ? compact : (_command$formatHuman = command.formatHuman) === null || _command$formatHuman === void 0 ? void 0 : _command$formatHuman.call(command, data)) !== null && _ref !== void 0 ? _ref : null;
278
+ const human = (_ref = compact !== null && compact !== void 0 ? compact : (_command$formatHuman = command.formatHuman) === null || _command$formatHuman === void 0 ? void 0 : _command$formatHuman.call(command, data, {
279
+ invocation
280
+ })) !== null && _ref !== void 0 ? _ref : null;
234
281
  if (human !== null) {
235
282
  writer.out(human);
236
283
  } else {
@@ -254,7 +301,8 @@ const renderGroupedResult = ({
254
301
  results,
255
302
  meta,
256
303
  json,
257
- writer
304
+ writer,
305
+ invocation
258
306
  }) => {
259
307
  // Assemble `{ [key]: results }`, coercing "no matches" sub-results to empty arrays so one
260
308
  // empty domain does not blank out the others. The guidelines tool returns full Markdown, so
@@ -313,19 +361,22 @@ const renderGroupedResult = ({
313
361
  }
314
362
  writer.out(formatGroupedResults({
315
363
  groups: grouped,
316
- totalCount
364
+ totalCount,
365
+ invocation
317
366
  }));
318
367
  return ExitCode.Ok;
319
368
  };
320
-
321
369
  /**
322
370
  * Parse and execute a single CLI invocation.
323
371
  *
324
372
  * @param argv - Arguments after `node <script>` (i.e. `process.argv.slice(2)`).
325
373
  * @param writer - Injectable output sink; defaults to console-backed stdout/stderr.
374
+ * @param options - Distribution-specific rendering options.
326
375
  * @returns The process exit code. The bin wrapper maps this onto `process.exit`.
327
376
  */
328
- export const run = async (argv = process.argv.slice(2), writer = defaultWriter) => {
377
+ export const run = async (argv = process.argv.slice(2), writer = defaultWriter, {
378
+ invocation = CLI_BIN_NAME
379
+ } = {}) => {
329
380
  const {
330
381
  command,
331
382
  positionals,
@@ -342,7 +393,7 @@ export const run = async (argv = process.argv.slice(2), writer = defaultWriter)
342
393
  // `--help` / `-h`, or no command at all, prints help. No command is a usage error so
343
394
  // scripts can detect a missing invocation via the exit code.
344
395
  if (flags.help === true || command === undefined) {
345
- writer.out(buildHelpText());
396
+ writer.out(buildHelpText(invocation));
346
397
  return command === undefined && flags.help !== true ? ExitCode.UsageError : ExitCode.Ok;
347
398
  }
348
399
  const definition = getCommand(command);
@@ -362,7 +413,7 @@ export const run = async (argv = process.argv.slice(2), writer = defaultWriter)
362
413
  message,
363
414
  writer
364
415
  });
365
- writer.err('Run `ads-cli --help` to see available commands.');
416
+ writer.err(`Run \`${invocation} --help\` to see available commands.`);
366
417
  }
367
418
  return ExitCode.UsageError;
368
419
  }
@@ -374,7 +425,8 @@ export const run = async (argv = process.argv.slice(2), writer = defaultWriter)
374
425
  flags
375
426
  },
376
427
  json,
377
- writer
428
+ writer,
429
+ invocation
378
430
  });
379
431
  } catch (error) {
380
432
  const message = error instanceof Error ? error.message : String(error);
@@ -10,12 +10,11 @@ import { CLI_BIN_NAME, CLI_DESCRIPTION, CLI_NAME, globalFlags } from './cli-meta
10
10
  * Build a serializable capability manifest from the live command registry.
11
11
  */
12
12
  export const buildManifest = (commands, version) => ({
13
- schemaVersion: 1,
13
+ schemaVersion: 2,
14
14
  name: CLI_NAME,
15
15
  bin: CLI_BIN_NAME,
16
16
  version,
17
17
  description: CLI_DESCRIPTION,
18
- invocation: `npx ${CLI_NAME}`,
19
18
  commands: commands.map(({
20
19
  name,
21
20
  description,
@@ -4,6 +4,7 @@
4
4
 
5
5
  export const CLI_NAME = '@atlaskit/ads-cli';
6
6
  export const CLI_BIN_NAME = 'ads-cli';
7
+ export const CLI_ATLAS_INVOCATION = 'atlas ads';
7
8
  export const CLI_DESCRIPTION = 'Query Atlassian Design System (ADS) structured content — components, tokens, icons, and guidelines — from the terminal.';
8
9
  export const globalFlags = [{
9
10
  name: 'json',
@@ -317,10 +317,12 @@ const makeItemCommand = ({
317
317
  // disambiguation marker, both handled by `formatHuman`.
318
318
  resultKind: input => input.flags.all ? kind : undefined,
319
319
  envelopeType: input => input.flags.all ? listTool.envelopeType : name,
320
- formatHuman: data => {
320
+ formatHuman: (data, {
321
+ invocation
322
+ }) => {
321
323
  // Ambiguous lookup → render the "did you mean?" list; otherwise the item detail view.
322
324
  if (isDisambiguation(data)) {
323
- return formatDisambiguation(data);
325
+ return formatDisambiguation(data, invocation);
324
326
  }
325
327
  return formatHuman(data);
326
328
  },
@@ -532,7 +534,9 @@ export const commands = [{
532
534
  envelopeType: () => 'lint-rules',
533
535
  // Ambiguous fuzzy lookup → render the "did you mean?" list; otherwise print each rule's
534
536
  // Markdown `content` verbatim rather than JSON.
535
- formatHuman: data => isDisambiguation(data) ? formatDisambiguation(data) : formatLintRules(data),
537
+ formatHuman: (data, {
538
+ invocation
539
+ }) => isDisambiguation(data) ? formatDisambiguation(data, invocation) : formatLintRules(data),
536
540
  // Mirror the item commands: a fuzzy term that matches one rule exactly (or a lone match)
537
541
  // shows that rule's docs, but several matches with no exact name surface a disambiguation
538
542
  // list instead of dumping every rule's full Markdown. Skipped for bare `lint-rules` (which
@@ -747,8 +751,6 @@ export const commands = [{
747
751
  formatHuman: formatManifest,
748
752
  resolve: () => ({
749
753
  data: buildManifest(commands, getVersion()),
750
- meta: {
751
- schemaVersion: 1
752
- }
754
+ meta: {}
753
755
  })
754
756
  }];
@@ -2,6 +2,7 @@
2
2
  * Human-readable renderer for an ambiguous item lookup ("did you mean?").
3
3
  */
4
4
 
5
+ import { CLI_BIN_NAME } from '../commands/cli-metadata';
5
6
  /**
6
7
  * Render a "did you mean?" list for an ambiguous lookup.
7
8
  *
@@ -12,11 +13,11 @@ export const formatDisambiguation = ({
12
13
  query,
13
14
  noun,
14
15
  candidates
15
- }) => {
16
+ }, invocation = CLI_BIN_NAME) => {
16
17
  const header = `Multiple ${noun}s match "${query}". Did you mean one of these?`;
17
18
  const rows = candidates.map(candidate => {
18
19
  const hint = candidate.hint ? ` ${candidate.hint}` : '';
19
- return ` ${candidate.name}${hint}\n → ads-cli ${candidate.followUp}`;
20
+ return ` ${candidate.name}${hint}\n → ${invocation} ${candidate.followUp}`;
20
21
  });
21
22
  return [header, '', ...rows].join('\n');
22
23
  };
@@ -5,6 +5,7 @@
5
5
  * groups are skipped, so one command surfaces whatever kinds match, grouped by kind.
6
6
  */
7
7
 
8
+ import { CLI_BIN_NAME } from '../commands/cli-metadata';
8
9
  import { formatCompactResults } from './format-results';
9
10
 
10
11
  /**
@@ -12,7 +13,8 @@ import { formatCompactResults } from './format-results';
12
13
  */
13
14
  export const formatGroupedResults = ({
14
15
  groups,
15
- totalCount
16
+ totalCount,
17
+ invocation = CLI_BIN_NAME
16
18
  }) => {
17
19
  // Fixed display order, with human-friendly section titles.
18
20
  const sections = [{
@@ -44,7 +46,8 @@ export const formatGroupedResults = ({
44
46
  const rendered = formatCompactResults({
45
47
  kind,
46
48
  data: entries,
47
- showFollowUp: true
49
+ showFollowUp: true,
50
+ invocation
48
51
  });
49
52
  const body = rendered ? rendered.split('\n').slice(2).join('\n') : '';
50
53
  blocks.push('', `${title} (${entries.length}):`, '', body);
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * Format a scannable human catalog of the ADS CLI capability manifest.
3
3
  */
4
- export const formatManifest = data => {
5
- if (typeof data !== 'object' || data === null || !('bin' in data) || typeof data.bin !== 'string' || !('version' in data) || typeof data.version !== 'string' || !('invocation' in data) || typeof data.invocation !== 'string' || !('commands' in data) || !Array.isArray(data.commands)) {
4
+
5
+ export const formatManifest = (data, {
6
+ invocation
7
+ }) => {
8
+ if (typeof data !== 'object' || data === null || !('bin' in data) || typeof data.bin !== 'string' || !('version' in data) || typeof data.version !== 'string' || !('commands' in data) || !Array.isArray(data.commands)) {
6
9
  return null;
7
10
  }
8
11
  const commands = data.commands.flatMap(command => {
@@ -14,5 +17,5 @@ export const formatManifest = data => {
14
17
  });
15
18
  const commandCount = commands.length;
16
19
  const commandLabel = commandCount === 1 ? 'command' : 'commands';
17
- return [`${data.bin} v${data.version} — ${commandCount} ${commandLabel}`, '', commands.join('\n'), '', `Run \`${data.invocation} manifest --json\` for the full structured manifest.`].join('\n');
20
+ return [`${data.bin} v${data.version} — ${commandCount} ${commandLabel}`, '', commands.join('\n'), '', `Run \`${invocation} manifest --json\` for the full structured manifest.`].join('\n');
18
21
  };
@@ -9,6 +9,8 @@
9
9
  * left to the caller's generic fallback.
10
10
  */
11
11
 
12
+ import { CLI_BIN_NAME } from '../commands/cli-metadata';
13
+
12
14
  /**
13
15
  * A component result as returned by `searchComponentsTool` / `getAllComponentsTool`.
14
16
  * Only the fields the compact view needs are modelled; others are ignored.
@@ -38,7 +40,7 @@ const pluralize = (count, noun) => `${count} ${noun}${count === 1 ? '' : 's'}`;
38
40
  const truncate = (text, max = 80) => text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text;
39
41
 
40
42
  /**
41
- * Append a `→ ads-cli <command> <name>` drill-in hint beneath a row.
43
+ * Append a `→ <invocation> <command> <name>` drill-in hint beneath a row.
42
44
  *
43
45
  * Used for every `search` result, where the natural next step is to view that match in full.
44
46
  * `--all` listings omit it because echoing every row's own name would just be noise.
@@ -47,8 +49,9 @@ const withFollowUp = ({
47
49
  line,
48
50
  command,
49
51
  name,
50
- showFollowUp
51
- }) => showFollowUp ? `${line}\n → ads-cli ${command} ${name}` : line;
52
+ showFollowUp,
53
+ invocation
54
+ }) => showFollowUp ? `${line}\n → ${invocation} ${command} ${name}` : line;
52
55
 
53
56
  /**
54
57
  * Render one component as a compact line.
@@ -57,7 +60,7 @@ const withFollowUp = ({
57
60
  * (`--all`, `--type`) or a titled section of grouped `search` — so the kind is always clear from
58
61
  * context and a tag would just be noise.
59
62
  */
60
- const formatComponentLine = (component, showFollowUp) => {
63
+ const formatComponentLine = (component, showFollowUp, invocation) => {
61
64
  var _component$name;
62
65
  const name = (_component$name = component.name) !== null && _component$name !== void 0 ? _component$name : '(unknown)';
63
66
  const pkg = component.package ? ` ${component.package}` : '';
@@ -68,14 +71,15 @@ const formatComponentLine = (component, showFollowUp) => {
68
71
  line: `${name}${pkg} (${meta})`,
69
72
  command: 'component',
70
73
  name,
71
- showFollowUp
74
+ showFollowUp,
75
+ invocation
72
76
  });
73
77
  };
74
78
 
75
79
  /**
76
80
  * Render one token as a compact `name = value` line.
77
81
  */
78
- const formatTokenLine = (tokenResult, showFollowUp) => {
82
+ const formatTokenLine = (tokenResult, showFollowUp, invocation) => {
79
83
  var _tokenResult$name;
80
84
  const name = (_tokenResult$name = tokenResult.name) !== null && _tokenResult$name !== void 0 ? _tokenResult$name : '(unknown)';
81
85
  // Some token values (e.g. motion easing curves) are very long; truncate so each token stays
@@ -85,14 +89,15 @@ const formatTokenLine = (tokenResult, showFollowUp) => {
85
89
  line,
86
90
  command: 'token',
87
91
  name,
88
- showFollowUp
92
+ showFollowUp,
93
+ invocation
89
94
  });
90
95
  };
91
96
 
92
97
  /**
93
98
  * Render one icon as a compact line with its import package and short usage note.
94
99
  */
95
- const formatIconLine = (iconResult, showFollowUp) => {
100
+ const formatIconLine = (iconResult, showFollowUp, invocation) => {
96
101
  var _iconResult$component;
97
102
  const name = (_iconResult$component = iconResult.componentName) !== null && _iconResult$component !== void 0 ? _iconResult$component : '(unknown)';
98
103
  const pkg = iconResult.package ? ` ${iconResult.package}` : '';
@@ -101,30 +106,32 @@ const formatIconLine = (iconResult, showFollowUp) => {
101
106
  line: `${name}${pkg}${usage}`,
102
107
  command: 'icon',
103
108
  name,
104
- showFollowUp
109
+ showFollowUp,
110
+ invocation
105
111
  });
106
112
  };
107
113
 
108
114
  /**
109
115
  * Render one foundations-document match without dumping its full Markdown body.
110
116
  */
111
- const formatDocLine = (doc, showFollowUp) => {
117
+ const formatDocLine = (doc, showFollowUp, invocation) => {
112
118
  const summary = doc.summary ? ` — ${doc.summary}` : '';
113
119
  const line = `${doc.title}${summary}`;
114
- return showFollowUp ? `${line}\n → ads-cli ${doc.followUp}` : line;
120
+ return showFollowUp ? `${line}\n → ${invocation} ${doc.followUp}` : line;
115
121
  };
116
122
 
117
123
  /**
118
124
  * Render an array of results as compact lines for the given kind. Returns `null` when the data
119
125
  * is not an array (so the caller can fall back to generic JSON rendering).
120
126
  *
121
- * `showFollowUp` (default `false`) adds a `→ ads-cli <command> <name>` drill-in hint beneath each
122
- * row. Search enables it for both grouped and `--type` output; `--all` listings leave it off.
127
+ * `showFollowUp` (default `false`) adds a `→ <invocation> <command> <name>` drill-in hint beneath
128
+ * each row. Search enables it for both grouped and `--type` output; `--all` listings leave it off.
123
129
  */
124
130
  export const formatCompactResults = ({
125
131
  kind,
126
132
  data,
127
- showFollowUp = false
133
+ showFollowUp = false,
134
+ invocation = CLI_BIN_NAME
128
135
  }) => {
129
136
  if (!Array.isArray(data)) {
130
137
  return null;
@@ -135,13 +142,13 @@ export const formatCompactResults = ({
135
142
  const lines = data.map(entry => {
136
143
  switch (kind) {
137
144
  case 'components':
138
- return formatComponentLine(entry, showFollowUp);
145
+ return formatComponentLine(entry, showFollowUp, invocation);
139
146
  case 'tokens':
140
- return formatTokenLine(entry, showFollowUp);
147
+ return formatTokenLine(entry, showFollowUp, invocation);
141
148
  case 'icons':
142
- return formatIconLine(entry, showFollowUp);
149
+ return formatIconLine(entry, showFollowUp, invocation);
143
150
  case 'docs':
144
- return formatDocLine(entry, showFollowUp);
151
+ return formatDocLine(entry, showFollowUp, invocation);
145
152
  default:
146
153
  return JSON.stringify(entry);
147
154
  }
@@ -2,6 +2,7 @@
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { run } from './cli';
5
+ import { CLI_ATLAS_INVOCATION } from './commands/cli-metadata';
5
6
 
6
7
  /**
7
8
  * Process entrypoint for the `atlas ads` distribution.
@@ -23,7 +24,9 @@ export var main = /*#__PURE__*/function () {
23
24
  argv = _args.length > 0 && _args[0] !== undefined ? _args[0] : process.argv.slice(2);
24
25
  _context.prev = 1;
25
26
  _context.next = 2;
26
- return run(argv);
27
+ return run(argv, undefined, {
28
+ invocation: CLI_ATLAS_INVOCATION
29
+ });
27
30
  case 2:
28
31
  exitCode = _context.sent;
29
32
  process.exitCode = exitCode;