@mintlify/cli 4.0.1317 → 4.0.1318
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 +5 -11
- package/bin/signup.js +2 -2
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/cli.tsx +7 -13
- package/src/signup.tsx +13 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1318",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"vitest": "2.1.9",
|
|
93
93
|
"vitest-mock-process": "1.0.4"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "6f48321041dbc078917dda12e3904e2c168cdaf6"
|
|
96
96
|
}
|
package/src/cli.tsx
CHANGED
|
@@ -43,7 +43,7 @@ import { subdomainMiddleware } from './middlewares/subdomainMiddleware.js';
|
|
|
43
43
|
import { createTelemetryMiddleware } from './middlewares/telemetryMiddleware.js';
|
|
44
44
|
import { checkOpenApiFile, getOpenApiFilenamesFromDocsConfig } from './openApiCheck.js';
|
|
45
45
|
import { scoreHandler } from './score/index.js';
|
|
46
|
-
import {
|
|
46
|
+
import { signup } from './signup.js';
|
|
47
47
|
import { status, getCliSubdomains } from './status.js';
|
|
48
48
|
import { trackTelemetryPreferenceChange } from './telemetry/track.js';
|
|
49
49
|
import { update } from './update.js';
|
|
@@ -80,12 +80,6 @@ const showWelcome = async (packageName: string): Promise<void> => {
|
|
|
80
80
|
await terminate(0);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
// If an AI tries to run mint signup --help, it needs to get the AI custom prompt instead
|
|
84
|
-
const isAISignupHelpRequest = (args: string[]): boolean => {
|
|
85
|
-
const positionals = args.filter((arg) => !arg.startsWith('-'));
|
|
86
|
-
return isAI() && positionals[0] === 'signup' && (args.includes('--help') || args.includes('-h'));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
83
|
export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
90
84
|
if (shouldShowWelcome(hideBin(process.argv))) {
|
|
91
85
|
return showWelcome(packageName);
|
|
@@ -94,11 +88,6 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
94
88
|
const telemetryMiddleware = createTelemetryMiddleware();
|
|
95
89
|
render(<Logs />);
|
|
96
90
|
|
|
97
|
-
if (isAISignupHelpRequest(hideBin(process.argv))) {
|
|
98
|
-
sendAIUsageMessage();
|
|
99
|
-
return terminate(0);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
91
|
return (
|
|
103
92
|
yargs(hideBin(process.argv))
|
|
104
93
|
.scriptName(packageName)
|
|
@@ -439,7 +428,12 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
439
428
|
.option('firstName', { type: 'string', description: 'First name' })
|
|
440
429
|
.option('lastName', { type: 'string', description: 'Last name' })
|
|
441
430
|
.option('company', { type: 'string', description: 'Company name' })
|
|
442
|
-
.option('email', { type: 'string', description: 'Email address' })
|
|
431
|
+
.option('email', { type: 'string', description: 'Email address' })
|
|
432
|
+
.epilogue(
|
|
433
|
+
'Note: this command does not return until the user clicks the verification link ' +
|
|
434
|
+
'sent to their email, which can take several minutes. Non-interactive or scripted ' +
|
|
435
|
+
'callers should run it as a background process rather than waiting on it synchronously.'
|
|
436
|
+
),
|
|
443
437
|
async (argv) => {
|
|
444
438
|
await signup({
|
|
445
439
|
firstName: argv.firstName,
|
package/src/signup.tsx
CHANGED
|
@@ -21,20 +21,26 @@ export interface SignupOptions {
|
|
|
21
21
|
email?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const sendAIUsageMessage = () => {
|
|
25
25
|
addLogs(
|
|
26
26
|
<Text>Agent Detected - sending AI friendly prompt</Text>,
|
|
27
|
-
<Text>{'<
|
|
27
|
+
<Text>{'<mint-cli-instructions>'}</Text>,
|
|
28
28
|
<Text>
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
You were asked to create a Mintlify account. Here is how to do that with the `mint signup`
|
|
30
|
+
command. Fill in any values you already have from this conversation; ask the user directly for
|
|
31
|
+
anything you don't — never invent a person's name, company, or email.
|
|
31
32
|
</Text>,
|
|
32
33
|
<Text>
|
|
33
34
|
Command: `mint signup --firstName [firstName] --lastName [lastName] --company [company]
|
|
34
|
-
--email [email]`.
|
|
35
|
-
link — the command keeps running in the background until they do, then completes on its own.
|
|
35
|
+
--email [email]`.
|
|
36
36
|
</Text>,
|
|
37
|
-
<Text>
|
|
37
|
+
<Text>
|
|
38
|
+
Important: this command blocks until the user clicks a verification link sent to their email,
|
|
39
|
+
which can take several minutes. Run it as a background task, not in the foreground — do not
|
|
40
|
+
wait on it synchronously. You'll be notified when it finishes; then tell the user their
|
|
41
|
+
account is ready.
|
|
42
|
+
</Text>,
|
|
43
|
+
<Text>{'</mint-cli-instructions>'}</Text>
|
|
38
44
|
);
|
|
39
45
|
};
|
|
40
46
|
|