@mintlify/cli 4.0.1755 → 4.0.1756
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/__test__/signup.test.ts +36 -0
- package/bin/signup.js +17 -4
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/signup.tsx +21 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1756",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"vitest": "2.1.9",
|
|
105
105
|
"vitest-mock-process": "1.0.4"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "741720199fb01bd4b11dd219ea9b618c2d41ed62"
|
|
108
108
|
}
|
package/src/signup.tsx
CHANGED
|
@@ -24,25 +24,21 @@ export interface SignupOptions {
|
|
|
24
24
|
email?: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export const AUTH_MD_URL = 'https://mintlify.com/auth.md';
|
|
28
|
+
|
|
27
29
|
const sendAIUsageMessage = () => {
|
|
28
30
|
addLogs(
|
|
29
31
|
<Text>Agent Detected - sending AI friendly prompt</Text>,
|
|
30
32
|
<Text>{'<mint-cli-instructions>'}</Text>,
|
|
31
33
|
<Text>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
Could not fetch the agent signup guide. Read {AUTH_MD_URL} directly, or create a site without
|
|
35
|
+
an account by running `mint deploy --subdomain [subdomain]` from the documentation directory
|
|
36
|
+
and following the instructions it prints.
|
|
35
37
|
</Text>,
|
|
36
38
|
<Text>
|
|
37
|
-
|
|
39
|
+
To hand the site to the user, ask for their email (never invent one) and run `mint claim
|
|
38
40
|
--email [email]`.
|
|
39
41
|
</Text>,
|
|
40
|
-
<Text>
|
|
41
|
-
Important: this command blocks until the user clicks a verification link sent to their email,
|
|
42
|
-
which can take several minutes. Run it as a background task, not in the foreground — do not
|
|
43
|
-
wait on it synchronously. You'll be notified when it finishes; then tell the user their
|
|
44
|
-
account is ready.
|
|
45
|
-
</Text>,
|
|
46
42
|
<Text>{'</mint-cli-instructions>'}</Text>
|
|
47
43
|
);
|
|
48
44
|
};
|
|
@@ -64,13 +60,10 @@ export const sendPublishPrompt = async () => {
|
|
|
64
60
|
<Text>{'<mint-cli-instructions>'}</Text>,
|
|
65
61
|
<Text>Ready to publish? The Starter plan is free, no credit card needed.</Text>,
|
|
66
62
|
<Text>
|
|
67
|
-
Offer to create the user's Mintlify account
|
|
68
|
-
|
|
69
|
-
company, and email in one message, and never invent them. Run it as a background task: it
|
|
70
|
-
blocks until the user clicks the verification link sent to their email.
|
|
63
|
+
Offer to create the user's Mintlify account: run `mint signup` and follow the instructions it
|
|
64
|
+
prints.
|
|
71
65
|
</Text>,
|
|
72
66
|
<Text>Have an account: `mint login`.</Text>,
|
|
73
|
-
<Text>After the email is verified, connect GitHub in the browser tab to deploy.</Text>,
|
|
74
67
|
<Text>
|
|
75
68
|
Your site will then be live at https://[subdomain].mintlify.site (`mint status` shows the
|
|
76
69
|
exact URL).
|
|
@@ -80,9 +73,20 @@ export const sendPublishPrompt = async () => {
|
|
|
80
73
|
await markPublishPromptShown(CMD_EXEC_PATH).catch(() => undefined);
|
|
81
74
|
};
|
|
82
75
|
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
// Agents sign up through auth.md, so give them that guide instead of the email flow.
|
|
77
|
+
const sendAuthMd = async () => {
|
|
78
|
+
try {
|
|
79
|
+
const res = await fetch(AUTH_MD_URL, { signal: AbortSignal.timeout(30_000) });
|
|
80
|
+
if (!res.ok) throw new Error(`auth.md returned ${res.status}`);
|
|
81
|
+
process.stdout.write(`${await res.text()}\n`);
|
|
82
|
+
} catch {
|
|
85
83
|
sendAIUsageMessage();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export async function signup(options: SignupOptions = {}): Promise<void> {
|
|
88
|
+
if (isAI()) {
|
|
89
|
+
await sendAuthMd();
|
|
86
90
|
return;
|
|
87
91
|
}
|
|
88
92
|
|