@mintlify/cli 4.0.1089 → 4.0.1090

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/bin/cli.js CHANGED
@@ -17,6 +17,7 @@ import yargs from 'yargs';
17
17
  import { hideBin } from 'yargs/helpers';
18
18
  import { accessibilityCheck } from './accessibilityCheck.js';
19
19
  import { analyticsBuilder } from './analytics/index.js';
20
+ import { comingSoon } from './comingSoon.js';
20
21
  import { setTelemetryEnabled } from './config.js';
21
22
  import { getConfigValue, setConfigValue, clearConfigValue } from './config.js';
22
23
  import { API_URL } from './constants.js';
@@ -53,7 +54,7 @@ export const cli = ({ packageName = 'mint' }) => {
53
54
  .middleware(checkNodeVersion)
54
55
  .middleware(suppressConsoleWarnings)
55
56
  .middleware(telemetryMiddleware)
56
- .command('dev', 'initialize a local preview environment', (yargs) => yargs
57
+ .command('dev', 'Initialize a local preview environment', (yargs) => yargs
57
58
  .option('open', {
58
59
  type: 'boolean',
59
60
  default: true,
@@ -113,7 +114,7 @@ export const cli = ({ packageName = 'mint' }) => {
113
114
  yield terminate(1);
114
115
  }
115
116
  }))
116
- .command('validate', 'validate the documentation build (strict mode, exits on warnings or errors)', (yargs) => yargs
117
+ .command('validate', 'Validate the documentation build (strict mode, exits on warnings or errors)', (yargs) => yargs
117
118
  .option('local-schema', {
118
119
  type: 'boolean',
119
120
  default: false,
@@ -153,7 +154,7 @@ export const cli = ({ packageName = 'mint' }) => {
153
154
  yield validateBuild(Object.assign(Object.assign({}, argv), { packageName,
154
155
  cliVersion }));
155
156
  }))
156
- .command('export', 'export a static site for air-gapped deployment', (yargs) => yargs
157
+ .command('export', 'Export a static site for air-gapped deployment', (yargs) => yargs
157
158
  .option('output', {
158
159
  type: 'string',
159
160
  default: 'export.zip',
@@ -195,7 +196,7 @@ export const cli = ({ packageName = 'mint' }) => {
195
196
  const valid = yield checkOpenApiFile(filename, localSchema);
196
197
  yield terminate(valid ? 0 : 1);
197
198
  }))
198
- .command('broken-links', 'check for broken links', (yargs) => yargs
199
+ .command('broken-links', 'Check for broken links', (yargs) => yargs
199
200
  .option('check-anchors', {
200
201
  type: 'boolean',
201
202
  default: false,
@@ -267,16 +268,16 @@ export const cli = ({ packageName = 'mint' }) => {
267
268
  yield status();
268
269
  yield terminate(0);
269
270
  }))
270
- .command('logout', 'logout of your mintlify account', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
271
+ .command('logout', 'Logout of your Mintlify account', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
271
272
  yield logout();
272
273
  yield terminate(0);
273
274
  }))
274
- .command('login', 'authenticate your account to mintlify', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
275
+ .command('login', 'Authenticate your account to Mintlify', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
275
276
  yield login();
276
277
  yield terminate(0);
277
278
  }))
278
- .command('config', 'manage CLI configuration', (yargs) => yargs
279
- .command('set <key> <value>', 'set a configuration value', (yargs) => yargs
279
+ .command('config', 'Manage CLI configuration', (yargs) => yargs
280
+ .command('set <key> <value>', 'Set a configuration value', (yargs) => yargs
280
281
  .positional('key', {
281
282
  type: 'string',
282
283
  demandOption: true,
@@ -297,7 +298,7 @@ export const cli = ({ packageName = 'mint' }) => {
297
298
  addLog(_jsx(SuccessLog, { message: `${argv.key} = "${argv.value}"` }));
298
299
  yield terminate(0);
299
300
  }))
300
- .command('get <key>', 'get a configuration value', (yargs) => yargs.positional('key', {
301
+ .command('get <key>', 'Get a configuration value', (yargs) => yargs.positional('key', {
301
302
  type: 'string',
302
303
  demandOption: true,
303
304
  description: 'Config key (e.g. subdomain, dateFrom, dateTo)',
@@ -312,7 +313,7 @@ export const cli = ({ packageName = 'mint' }) => {
312
313
  addLog(_jsx(Text, { children: val !== null && val !== void 0 ? val : 'not set' }));
313
314
  yield terminate(0);
314
315
  }))
315
- .command('clear <key>', 'remove a configuration value', (yargs) => yargs.positional('key', {
316
+ .command('clear <key>', 'Remove a configuration value', (yargs) => yargs.positional('key', {
316
317
  type: 'string',
317
318
  demandOption: true,
318
319
  description: 'Config key (e.g. subdomain, dateFrom, dateTo)',
@@ -328,11 +329,11 @@ export const cli = ({ packageName = 'mint' }) => {
328
329
  yield terminate(0);
329
330
  }))
330
331
  .demandCommand(1, 'specify a subcommand: set, get, or clear'))
331
- .command('update', 'update the CLI to the latest version', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
332
+ .command('update', 'Update the CLI to the latest version', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
332
333
  yield update({ packageName });
333
334
  yield terminate(0);
334
335
  }))
335
- .command(['a11y', 'accessibility-check', 'a11y-check', 'accessibility'], 'check for accessibility issues in documentation', (yargs) => yargs
336
+ .command(['a11y', 'accessibility-check', 'a11y-check', 'accessibility'], 'Check for accessibility issues in documentation', (yargs) => yargs
336
337
  .option('skip-contrast', {
337
338
  type: 'boolean',
338
339
  default: false,
@@ -362,12 +363,12 @@ export const cli = ({ packageName = 'mint' }) => {
362
363
  }
363
364
  yield terminate(accessibilityCheckTerminateCode || mdxLinterTerminateCode);
364
365
  }))
365
- .command(['version', 'v'], 'display the current version of the cli and client', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
366
+ .command(['version', 'v'], 'Display the current version of the CLI and client', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
366
367
  const { cli, client } = getVersions();
367
368
  addLog(_jsxs(Text, { children: [_jsx(Text, { bold: true, color: "green", children: "cli version" }), ' ', cli] }));
368
369
  addLog(_jsxs(Text, { children: [_jsx(Text, { bold: true, color: "green", children: "client version" }), ' ', client] }));
369
370
  }))
370
- .command('new [directory]', 'create a new mintlify documentation site', (yargs) => yargs
371
+ .command('new [directory]', 'Create a new Mintlify documentation site', (yargs) => yargs
371
372
  .positional('directory', {
372
373
  describe: 'The directory to initialize your documentation',
373
374
  type: 'string',
@@ -395,7 +396,7 @@ export const cli = ({ packageName = 'mint' }) => {
395
396
  yield terminate(1);
396
397
  }
397
398
  }))
398
- .command('workflow', 'add a workflow to your documentation repository', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
399
+ .command('workflow', 'Add a workflow to your documentation repository', () => undefined, () => __awaiter(void 0, void 0, void 0, function* () {
399
400
  try {
400
401
  yield addWorkflow();
401
402
  yield terminate(0);
@@ -405,7 +406,12 @@ export const cli = ({ packageName = 'mint' }) => {
405
406
  yield terminate(1);
406
407
  }
407
408
  }))
408
- .command('analytics', 'view analytics for your documentation', analyticsBuilder)
409
+ .command('analytics', 'View analytics for your documentation', analyticsBuilder)
410
+ // Coming soon commands — visible in help, tracked via telemetry to gauge interest.
411
+ .command('ai', '[Coming soon] AI-powered documentation (run mint ai to vote)', () => undefined, comingSoon('ai', packageName))
412
+ .command('test', '[Coming soon] Test your documentation (run mint test to vote)', () => undefined, comingSoon('test', packageName))
413
+ .command('signup', '[Coming soon] Sign up for a Mintlify account (run mint signup to vote)', () => undefined, comingSoon('signup', packageName))
414
+ .command('mcp', '[Coming soon] MCP server for documentation (run mint mcp to vote)', () => undefined, comingSoon('mcp', packageName))
409
415
  // Print the help menu when the user enters an invalid command.
410
416
  .strictCommands()
411
417
  .demandCommand(1, 'unknown command. see above for the list of supported commands.')
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { addLog, SuccessLog, WarningLog } from '@mintlify/previewing';
12
+ import { Text } from 'ink';
13
+ import { isTelemetryEnabled } from './config.js';
14
+ import { terminate } from './helpers.js';
15
+ export function comingSoon(command, packageName) {
16
+ return () => __awaiter(this, void 0, void 0, function* () {
17
+ if (!isTelemetryEnabled()) {
18
+ addLog(_jsx(WarningLog, { message: `Telemetry is disabled, so your vote won't be counted. Enable it with: ${packageName} --telemetry=true` }));
19
+ }
20
+ else {
21
+ addLog(_jsx(SuccessLog, { message: `Thanks for your interest in "${packageName} ${command}"! Your vote has been counted.` }));
22
+ }
23
+ addLog(_jsx(Text, { dimColor: true, children: "This feature is currently in development. Learn more at https://mintlify.com/docs" }));
24
+ yield terminate(0);
25
+ });
26
+ }