@mintlify/cli 4.0.1097 → 4.0.1098

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1097",
3
+ "version": "4.0.1098",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,11 +45,11 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.840",
49
- "@mintlify/link-rot": "3.0.1015",
50
- "@mintlify/prebuild": "1.0.982",
51
- "@mintlify/previewing": "4.0.1043",
52
- "@mintlify/validation": "0.1.656",
48
+ "@mintlify/common": "1.0.841",
49
+ "@mintlify/link-rot": "3.0.1016",
50
+ "@mintlify/prebuild": "1.0.983",
51
+ "@mintlify/previewing": "4.0.1044",
52
+ "@mintlify/validation": "0.1.657",
53
53
  "adm-zip": "0.5.16",
54
54
  "chalk": "5.2.0",
55
55
  "color": "4.2.3",
@@ -93,5 +93,5 @@
93
93
  "vitest": "2.1.9",
94
94
  "vitest-mock-process": "1.0.4"
95
95
  },
96
- "gitHead": "7d99240d2ad695afdd1cc96ec1c042e12b18fde8"
96
+ "gitHead": "edd192ddf9723fff5a7d818a9e6937e17b8806a1"
97
97
  }
package/src/login.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { input } from '@inquirer/prompts';
2
- import { addLog } from '@mintlify/previewing';
2
+ import { addLog, ErrorLog, SuccessLog } from '@mintlify/previewing';
3
3
  import chalk from 'chalk';
4
4
  import { Box, Text } from 'ink';
5
5
  import open from 'open';
@@ -49,7 +49,7 @@ export async function login(): Promise<void> {
49
49
  </Text>
50
50
  <Box flexDirection="column" paddingLeft={3} gap={1}>
51
51
  <Text dimColor>If your browser doesn't open automatically, copy this URL:</Text>
52
- <Text color="cyan">{url}</Text>
52
+ <Text dimColor>{url}</Text>
53
53
  </Box>
54
54
  </Box>
55
55
  );
@@ -82,7 +82,7 @@ export async function login(): Promise<void> {
82
82
  } catch {
83
83
  closeServer();
84
84
  inputPromise.cancel();
85
- addLog(<Text color="red">✖ Login cancelled.</Text>);
85
+ addLog(<ErrorLog message="login cancelled" />);
86
86
  return;
87
87
  }
88
88
 
@@ -106,12 +106,12 @@ export async function login(): Promise<void> {
106
106
  if (!res.ok) {
107
107
  const reason = body.error_message ?? body.error ?? 'unknown error';
108
108
  void trackLoginFailed(reason);
109
- addLog(<Text color="red">✖ Login failed: {reason}</Text>);
109
+ addLog(<ErrorLog message={`login failed: ${reason}`} />);
110
110
  return;
111
111
  }
112
112
 
113
113
  const token = body as TokenResponse;
114
114
  await storeCredentials(token.access_token, token.refresh_token);
115
115
  void trackLoginSuccess();
116
- addLog(<Text color="green">✔ Logged in successfully.</Text>);
116
+ addLog(<SuccessLog message="logged in successfully" />);
117
117
  }
package/src/logout.tsx CHANGED
@@ -1,9 +1,8 @@
1
- import { addLog } from '@mintlify/previewing';
2
- import { Text } from 'ink';
1
+ import { addLog, SuccessLog } from '@mintlify/previewing';
3
2
 
4
3
  import { clearCredentials } from './keyring.js';
5
4
 
6
5
  export async function logout(): Promise<void> {
7
6
  await clearCredentials();
8
- addLog(<Text color="green">Logged out successfully.</Text>);
7
+ addLog(<SuccessLog message="logged out successfully" />);
9
8
  }
package/src/status.tsx CHANGED
@@ -1,8 +1,10 @@
1
- import { addLog } from '@mintlify/previewing';
2
- import { Text } from 'ink';
1
+ import { addLog, ErrorLog } from '@mintlify/previewing';
2
+ import { Box, Text } from 'ink';
3
3
  import { z } from 'zod';
4
4
 
5
+ import { getConfigValue } from './config.js';
5
6
  import { API_URL } from './constants.js';
7
+ import { getCliVersion } from './helpers.js';
6
8
  import { getAccessToken } from './keyring.js';
7
9
 
8
10
  const StatusResponseSchema = z.object({
@@ -29,7 +31,7 @@ export async function status(): Promise<void> {
29
31
  const accessToken = await getAccessToken();
30
32
 
31
33
  if (!accessToken) {
32
- addLog(<Text color="red">Not logged in. Run `mint login` to authenticate.</Text>);
34
+ addLog(<ErrorLog message="not logged in. Run `mint login` to authenticate." />);
33
35
  return;
34
36
  }
35
37
 
@@ -39,7 +41,7 @@ export async function status(): Promise<void> {
39
41
  });
40
42
 
41
43
  if (!res.ok) {
42
- addLog(<Text color="red">Not logged in. Run `mint login` to authenticate.</Text>);
44
+ addLog(<ErrorLog message="not logged in. Run `mint login` to authenticate." />);
43
45
  return;
44
46
  }
45
47
 
@@ -47,18 +49,46 @@ export async function status(): Promise<void> {
47
49
  const parsed = StatusResponseSchema.safeParse(json);
48
50
 
49
51
  if (!parsed.success) {
50
- addLog(<Text color="red">Unexpected response from server. Please try again.</Text>);
52
+ addLog(<ErrorLog message="unexpected response from server. please try again." />);
51
53
  return;
52
54
  }
53
55
 
54
- const { user, org } = parsed.data;
56
+ const { user, org, subdomain: apiSubdomain } = parsed.data;
57
+ const version = getCliVersion();
58
+ const subdomain = getConfigValue('subdomain') ?? apiSubdomain ?? null;
55
59
  addLog(
56
- <Text>
57
- Logged in as <Text color="green">{user.email}</Text> in org{' '}
58
- <Text color="green">{org.name}</Text>
59
- </Text>
60
+ <Box flexDirection="column" paddingY={1}>
61
+ {version && (
62
+ <Box>
63
+ <Box minWidth={16}>
64
+ <Text dimColor>Version</Text>
65
+ </Box>
66
+ <Text>{version}</Text>
67
+ </Box>
68
+ )}
69
+ <Box>
70
+ <Box minWidth={16}>
71
+ <Text dimColor>Email</Text>
72
+ </Box>
73
+ <Text>{user.email}</Text>
74
+ </Box>
75
+ <Box>
76
+ <Box minWidth={16}>
77
+ <Text dimColor>Organization</Text>
78
+ </Box>
79
+ <Text>{org.name}</Text>
80
+ </Box>
81
+ {subdomain && (
82
+ <Box>
83
+ <Box minWidth={16}>
84
+ <Text dimColor>Subdomain</Text>
85
+ </Box>
86
+ <Text>{subdomain}</Text>
87
+ </Box>
88
+ )}
89
+ </Box>
60
90
  );
61
91
  } catch (e) {
62
- addLog(<Text color="red">Unexpected response from server. Please try again.</Text>);
92
+ addLog(<ErrorLog message="unexpected response from server. please try again." />);
63
93
  }
64
94
  }