@mintlify/cli 4.0.1235 → 4.0.1236
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 +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/welcome.js +1 -1
- package/bin/workflows/index.js +19 -19
- package/package.json +2 -2
- package/src/cli.tsx +5 -1
- package/src/welcome.ts +1 -1
- package/src/workflows/index.tsx +19 -19
package/bin/welcome.js
CHANGED
package/bin/workflows/index.js
CHANGED
|
@@ -90,7 +90,7 @@ function describeTrigger(trigger) {
|
|
|
90
90
|
}
|
|
91
91
|
function renderWorkflow(workflow) {
|
|
92
92
|
const lines = [];
|
|
93
|
-
lines.push(chalk.bold(`\
|
|
93
|
+
lines.push(chalk.bold(`\nAutomation ${workflow.name}`));
|
|
94
94
|
lines.push(` ${chalk.dim('ID')} ${workflow._id}`);
|
|
95
95
|
lines.push(` ${chalk.dim('Status')} ${workflow.status}`);
|
|
96
96
|
if (workflow.type)
|
|
@@ -103,7 +103,7 @@ function renderWorkflow(workflow) {
|
|
|
103
103
|
}
|
|
104
104
|
function renderList(workflows) {
|
|
105
105
|
if (workflows.length === 0)
|
|
106
|
-
return 'No
|
|
106
|
+
return 'No automations found.';
|
|
107
107
|
const rows = workflows.map((w) => {
|
|
108
108
|
var _a;
|
|
109
109
|
return [
|
|
@@ -130,13 +130,13 @@ const withFormat = (yargs) => yargs.option('format', {
|
|
|
130
130
|
});
|
|
131
131
|
export const workflowsBuilder = (yargs) => yargs
|
|
132
132
|
.middleware(subdomainMiddleware)
|
|
133
|
-
.command('create', 'Create a new
|
|
134
|
-
.option('name', { type: 'string', description: '
|
|
135
|
-
.option('prompt', { type: 'string', description: '
|
|
133
|
+
.command('create', 'Create a new automation', (yargs) => withFormat(withSubdomain(yargs)
|
|
134
|
+
.option('name', { type: 'string', description: 'Automation name' })
|
|
135
|
+
.option('prompt', { type: 'string', description: 'Automation prompt' })
|
|
136
136
|
.option('type', {
|
|
137
137
|
type: 'string',
|
|
138
138
|
choices: WORKFLOW_TYPES,
|
|
139
|
-
description: '
|
|
139
|
+
description: 'Automation type',
|
|
140
140
|
})
|
|
141
141
|
.option('cron', {
|
|
142
142
|
type: 'string',
|
|
@@ -154,14 +154,14 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
154
154
|
})
|
|
155
155
|
.option('automerge', {
|
|
156
156
|
type: 'boolean',
|
|
157
|
-
description: 'Automatically merge PRs opened by this
|
|
157
|
+
description: 'Automatically merge PRs opened by this automation',
|
|
158
158
|
})
|
|
159
159
|
.option('file', {
|
|
160
160
|
type: 'string',
|
|
161
|
-
description: 'Path to a JSON or YAML file with the full
|
|
161
|
+
description: 'Path to a JSON or YAML file with the full automation body',
|
|
162
162
|
}))
|
|
163
|
-
.example('mint
|
|
164
|
-
.example('mint
|
|
163
|
+
.example('mint automations create --name Translations --cron "0 6 * * *" --type translations', '')
|
|
164
|
+
.example('mint automations create --file automation.yaml', ''), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
165
|
const format = resolveFormat(argv);
|
|
166
166
|
try {
|
|
167
167
|
const subdomain = requireSubdomain(argv.subdomain);
|
|
@@ -169,11 +169,11 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
169
169
|
? (yield readWorkflowFile(argv.file))
|
|
170
170
|
: buildBodyFromFlags(argv);
|
|
171
171
|
if (format === 'table')
|
|
172
|
-
addLog(_jsx(SpinnerLog, { message: "Creating
|
|
172
|
+
addLog(_jsx(SpinnerLog, { message: "Creating automation..." }));
|
|
173
173
|
const created = yield createWorkflow(subdomain, body);
|
|
174
174
|
if (format === 'table')
|
|
175
175
|
removeLastLog();
|
|
176
|
-
void trackEvent('cli.
|
|
176
|
+
void trackEvent('cli.automation.created', {
|
|
177
177
|
subdomain,
|
|
178
178
|
type: created.type,
|
|
179
179
|
triggerKind: describeTrigger(created.trigger).split('(')[0],
|
|
@@ -182,7 +182,7 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
182
182
|
output(format, JSON.stringify(created, null, 2));
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
|
-
addLog(_jsx(SuccessLog, { message: `Created
|
|
185
|
+
addLog(_jsx(SuccessLog, { message: `Created automation ${created._id}` }));
|
|
186
186
|
output(format, renderWorkflow(created));
|
|
187
187
|
}
|
|
188
188
|
yield terminate(0);
|
|
@@ -200,12 +200,12 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
200
200
|
yield terminate(1);
|
|
201
201
|
}
|
|
202
202
|
}))
|
|
203
|
-
.command('list', 'List
|
|
203
|
+
.command('list', 'List automations for the current deployment', (yargs) => withFormat(withSubdomain(yargs)), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
204
204
|
const format = resolveFormat(argv);
|
|
205
205
|
try {
|
|
206
206
|
const subdomain = requireSubdomain(argv.subdomain);
|
|
207
207
|
if (format === 'table')
|
|
208
|
-
addLog(_jsx(SpinnerLog, { message: "Fetching
|
|
208
|
+
addLog(_jsx(SpinnerLog, { message: "Fetching automations..." }));
|
|
209
209
|
const workflows = yield listWorkflows(subdomain);
|
|
210
210
|
if (format === 'table')
|
|
211
211
|
removeLastLog();
|
|
@@ -230,16 +230,16 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
230
230
|
yield terminate(1);
|
|
231
231
|
}
|
|
232
232
|
}))
|
|
233
|
-
.command('delete <id>', 'Delete
|
|
233
|
+
.command('delete <id>', 'Delete an automation by ID', (yargs) => withFormat(withSubdomain(yargs)).positional('id', {
|
|
234
234
|
type: 'string',
|
|
235
235
|
demandOption: true,
|
|
236
|
-
description: '
|
|
236
|
+
description: 'Automation schema ID',
|
|
237
237
|
}), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
238
238
|
const format = resolveFormat(argv);
|
|
239
239
|
try {
|
|
240
240
|
const subdomain = requireSubdomain(argv.subdomain);
|
|
241
241
|
if (format === 'table')
|
|
242
|
-
addLog(_jsx(SpinnerLog, { message: "Deleting
|
|
242
|
+
addLog(_jsx(SpinnerLog, { message: "Deleting automation..." }));
|
|
243
243
|
yield deleteWorkflow(subdomain, argv.id);
|
|
244
244
|
if (format === 'table')
|
|
245
245
|
removeLastLog();
|
|
@@ -247,7 +247,7 @@ export const workflowsBuilder = (yargs) => yargs
|
|
|
247
247
|
output(format, JSON.stringify({ success: true, id: argv.id }, null, 2));
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
|
-
addLog(_jsx(SuccessLog, { message: `Deleted
|
|
250
|
+
addLog(_jsx(SuccessLog, { message: `Deleted automation ${argv.id}` }));
|
|
251
251
|
}
|
|
252
252
|
yield terminate(0);
|
|
253
253
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1236",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"vitest": "2.1.9",
|
|
96
96
|
"vitest-mock-process": "1.0.4"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "c971a3076cde2da5bcf907db8bda3f83358bd5e1"
|
|
99
99
|
}
|
package/src/cli.tsx
CHANGED
|
@@ -613,7 +613,11 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
)
|
|
616
|
-
.command(
|
|
616
|
+
.command(
|
|
617
|
+
['automations', 'workflow', 'workflows'],
|
|
618
|
+
'Create and manage automations',
|
|
619
|
+
workflowsBuilder
|
|
620
|
+
)
|
|
617
621
|
.command(
|
|
618
622
|
'score [url]',
|
|
619
623
|
'Run agent readiness checks on a docs site',
|
package/src/welcome.ts
CHANGED
|
@@ -36,7 +36,7 @@ const GROUPS: CommandGroup[] = [
|
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
title: 'Insights',
|
|
39
|
-
commands: [{ name: '
|
|
39
|
+
commands: [{ name: 'automations', description: 'Create and manage automations' }],
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
title: 'Account',
|
package/src/workflows/index.tsx
CHANGED
|
@@ -99,7 +99,7 @@ function describeTrigger(trigger: WorkflowTrigger): string {
|
|
|
99
99
|
|
|
100
100
|
function renderWorkflow(workflow: Workflow): string {
|
|
101
101
|
const lines: string[] = [];
|
|
102
|
-
lines.push(chalk.bold(`\
|
|
102
|
+
lines.push(chalk.bold(`\nAutomation ${workflow.name}`));
|
|
103
103
|
lines.push(` ${chalk.dim('ID')} ${workflow._id}`);
|
|
104
104
|
lines.push(` ${chalk.dim('Status')} ${workflow.status}`);
|
|
105
105
|
if (workflow.type) lines.push(` ${chalk.dim('Type')} ${workflow.type}`);
|
|
@@ -111,7 +111,7 @@ function renderWorkflow(workflow: Workflow): string {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function renderList(workflows: Workflow[]): string {
|
|
114
|
-
if (workflows.length === 0) return 'No
|
|
114
|
+
if (workflows.length === 0) return 'No automations found.';
|
|
115
115
|
const rows = workflows.map((w) => [
|
|
116
116
|
w._id,
|
|
117
117
|
w.name,
|
|
@@ -143,16 +143,16 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
143
143
|
.middleware(subdomainMiddleware)
|
|
144
144
|
.command(
|
|
145
145
|
'create',
|
|
146
|
-
'Create a new
|
|
146
|
+
'Create a new automation',
|
|
147
147
|
(yargs) =>
|
|
148
148
|
withFormat(
|
|
149
149
|
withSubdomain(yargs)
|
|
150
|
-
.option('name', { type: 'string', description: '
|
|
151
|
-
.option('prompt', { type: 'string', description: '
|
|
150
|
+
.option('name', { type: 'string', description: 'Automation name' })
|
|
151
|
+
.option('prompt', { type: 'string', description: 'Automation prompt' })
|
|
152
152
|
.option('type', {
|
|
153
153
|
type: 'string',
|
|
154
154
|
choices: WORKFLOW_TYPES,
|
|
155
|
-
description: '
|
|
155
|
+
description: 'Automation type',
|
|
156
156
|
})
|
|
157
157
|
.option('cron', {
|
|
158
158
|
type: 'string',
|
|
@@ -170,18 +170,18 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
170
170
|
})
|
|
171
171
|
.option('automerge', {
|
|
172
172
|
type: 'boolean',
|
|
173
|
-
description: 'Automatically merge PRs opened by this
|
|
173
|
+
description: 'Automatically merge PRs opened by this automation',
|
|
174
174
|
})
|
|
175
175
|
.option('file', {
|
|
176
176
|
type: 'string',
|
|
177
|
-
description: 'Path to a JSON or YAML file with the full
|
|
177
|
+
description: 'Path to a JSON or YAML file with the full automation body',
|
|
178
178
|
})
|
|
179
179
|
)
|
|
180
180
|
.example(
|
|
181
|
-
'mint
|
|
181
|
+
'mint automations create --name Translations --cron "0 6 * * *" --type translations',
|
|
182
182
|
''
|
|
183
183
|
)
|
|
184
|
-
.example('mint
|
|
184
|
+
.example('mint automations create --file automation.yaml', ''),
|
|
185
185
|
async (argv) => {
|
|
186
186
|
const format = resolveFormat(argv);
|
|
187
187
|
try {
|
|
@@ -190,11 +190,11 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
190
190
|
? ((await readWorkflowFile(argv.file)) as WorkflowBody)
|
|
191
191
|
: buildBodyFromFlags(argv as CreateArgs);
|
|
192
192
|
|
|
193
|
-
if (format === 'table') addLog(<SpinnerLog message="Creating
|
|
193
|
+
if (format === 'table') addLog(<SpinnerLog message="Creating automation..." />);
|
|
194
194
|
const created = await createWorkflow(subdomain, body);
|
|
195
195
|
if (format === 'table') removeLastLog();
|
|
196
196
|
|
|
197
|
-
void trackEvent('cli.
|
|
197
|
+
void trackEvent('cli.automation.created', {
|
|
198
198
|
subdomain,
|
|
199
199
|
type: created.type,
|
|
200
200
|
triggerKind: describeTrigger(created.trigger).split('(')[0],
|
|
@@ -203,7 +203,7 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
203
203
|
if (format === 'json') {
|
|
204
204
|
output(format, JSON.stringify(created, null, 2));
|
|
205
205
|
} else {
|
|
206
|
-
addLog(<SuccessLog message={`Created
|
|
206
|
+
addLog(<SuccessLog message={`Created automation ${created._id}`} />);
|
|
207
207
|
output(format, renderWorkflow(created));
|
|
208
208
|
}
|
|
209
209
|
await terminate(0);
|
|
@@ -221,13 +221,13 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
221
221
|
)
|
|
222
222
|
.command(
|
|
223
223
|
'list',
|
|
224
|
-
'List
|
|
224
|
+
'List automations for the current deployment',
|
|
225
225
|
(yargs) => withFormat(withSubdomain(yargs)),
|
|
226
226
|
async (argv) => {
|
|
227
227
|
const format = resolveFormat(argv);
|
|
228
228
|
try {
|
|
229
229
|
const subdomain = requireSubdomain(argv.subdomain);
|
|
230
|
-
if (format === 'table') addLog(<SpinnerLog message="Fetching
|
|
230
|
+
if (format === 'table') addLog(<SpinnerLog message="Fetching automations..." />);
|
|
231
231
|
const workflows = await listWorkflows(subdomain);
|
|
232
232
|
if (format === 'table') removeLastLog();
|
|
233
233
|
|
|
@@ -251,24 +251,24 @@ export const workflowsBuilder = (yargs: Argv) =>
|
|
|
251
251
|
)
|
|
252
252
|
.command(
|
|
253
253
|
'delete <id>',
|
|
254
|
-
'Delete
|
|
254
|
+
'Delete an automation by ID',
|
|
255
255
|
(yargs) =>
|
|
256
256
|
withFormat(withSubdomain(yargs)).positional('id', {
|
|
257
257
|
type: 'string',
|
|
258
258
|
demandOption: true,
|
|
259
|
-
description: '
|
|
259
|
+
description: 'Automation schema ID',
|
|
260
260
|
}),
|
|
261
261
|
async (argv) => {
|
|
262
262
|
const format = resolveFormat(argv);
|
|
263
263
|
try {
|
|
264
264
|
const subdomain = requireSubdomain(argv.subdomain);
|
|
265
|
-
if (format === 'table') addLog(<SpinnerLog message="Deleting
|
|
265
|
+
if (format === 'table') addLog(<SpinnerLog message="Deleting automation..." />);
|
|
266
266
|
await deleteWorkflow(subdomain, argv.id);
|
|
267
267
|
if (format === 'table') removeLastLog();
|
|
268
268
|
if (format === 'json') {
|
|
269
269
|
output(format, JSON.stringify({ success: true, id: argv.id }, null, 2));
|
|
270
270
|
} else {
|
|
271
|
-
addLog(<SuccessLog message={`Deleted
|
|
271
|
+
addLog(<SuccessLog message={`Deleted automation ${argv.id}`} />);
|
|
272
272
|
}
|
|
273
273
|
await terminate(0);
|
|
274
274
|
} catch (err) {
|