@superdesign/cli 0.1.12 → 0.1.13
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/dist/config/constants.d.ts +1 -1
- package/dist/index.cjs +86 -17
- package/dist/index.js +86 -17
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export declare const POLL_TIMEOUT_MS: number;
|
|
|
12
12
|
export declare const AUTH_POLL_INTERVAL_MS = 2000;
|
|
13
13
|
export declare const AUTH_POLL_TIMEOUT_MS: number;
|
|
14
14
|
/** CLI version - should match package.json */
|
|
15
|
-
export declare const CLI_VERSION = "0.1.
|
|
15
|
+
export declare const CLI_VERSION = "0.1.13";
|
|
16
16
|
/** PostHog analytics configuration */
|
|
17
17
|
export declare const POSTHOG_KEY: string;
|
|
18
18
|
export declare const POSTHOG_HOST: string;
|
package/dist/index.cjs
CHANGED
|
@@ -316,7 +316,7 @@ var __webpack_exports__ = {};
|
|
|
316
316
|
try {
|
|
317
317
|
startSpinner('Creating auth session...');
|
|
318
318
|
const session = await createSession({
|
|
319
|
-
cliVersion: "0.1.
|
|
319
|
+
cliVersion: "0.1.13",
|
|
320
320
|
os: `${external_os_namespaceObject.platform()} ${external_os_namespaceObject.release()}`,
|
|
321
321
|
hostname: external_os_namespaceObject.hostname()
|
|
322
322
|
});
|
|
@@ -1311,7 +1311,7 @@ Usage Examples:
|
|
|
1311
1311
|
durationMs: opts.durationMs,
|
|
1312
1312
|
errorCode: opts.errorCode,
|
|
1313
1313
|
options: opts.options,
|
|
1314
|
-
cliVersion: "0.1.
|
|
1314
|
+
cliVersion: "0.1.13",
|
|
1315
1315
|
os: `${external_os_default().platform()} ${external_os_default().release()}`
|
|
1316
1316
|
};
|
|
1317
1317
|
const posthog = getPostHog();
|
|
@@ -1346,9 +1346,46 @@ Usage Examples:
|
|
|
1346
1346
|
path: (0, external_path_namespaceObject.resolve)(src_dirname, '../.env')
|
|
1347
1347
|
});
|
|
1348
1348
|
(0, external_dotenv_namespaceObject.config)();
|
|
1349
|
+
function getFailedCommandUsage(program) {
|
|
1350
|
+
const failedCommand = findFailedCommand(program);
|
|
1351
|
+
if (!failedCommand) return {
|
|
1352
|
+
message: 'Run with --help for usage information'
|
|
1353
|
+
};
|
|
1354
|
+
return {
|
|
1355
|
+
command: failedCommand.name(),
|
|
1356
|
+
description: failedCommand.description(),
|
|
1357
|
+
requiredOptions: failedCommand.options.filter((opt)=>opt.mandatory).map((opt)=>({
|
|
1358
|
+
flags: opt.flags,
|
|
1359
|
+
description: opt.description
|
|
1360
|
+
})),
|
|
1361
|
+
allOptions: failedCommand.options.map((opt)=>({
|
|
1362
|
+
flags: opt.flags,
|
|
1363
|
+
description: opt.description,
|
|
1364
|
+
required: opt.mandatory
|
|
1365
|
+
}))
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
function getFailedCommandHelp(program) {
|
|
1369
|
+
const failedCommand = findFailedCommand(program);
|
|
1370
|
+
if (!failedCommand) return '\nRun with --help for usage information\n';
|
|
1371
|
+
return '\n' + failedCommand.helpInformation();
|
|
1372
|
+
}
|
|
1373
|
+
function findFailedCommand(program) {
|
|
1374
|
+
const args = process.argv;
|
|
1375
|
+
const commandName = args[2];
|
|
1376
|
+
if (!commandName || commandName.startsWith('-')) return program;
|
|
1377
|
+
const subcommand = program.commands.find((cmd)=>cmd.name() === commandName);
|
|
1378
|
+
return subcommand || program;
|
|
1379
|
+
}
|
|
1349
1380
|
function createProgram() {
|
|
1350
1381
|
const program = new external_commander_namespaceObject.Command();
|
|
1351
|
-
program.name('superdesign').description('SuperDesign CLI - AI product designer for coding agents').version("0.1.
|
|
1382
|
+
program.name('superdesign').description('SuperDesign CLI - AI product designer for coding agents').version("0.1.13");
|
|
1383
|
+
program.configureOutput({
|
|
1384
|
+
writeErr: (str)=>{
|
|
1385
|
+
if (!process.argv.includes('--json')) process.stderr.write(str);
|
|
1386
|
+
}
|
|
1387
|
+
});
|
|
1388
|
+
program.exitOverride();
|
|
1352
1389
|
let startTime = 0;
|
|
1353
1390
|
program.hook('preAction', ()=>{
|
|
1354
1391
|
startTime = Date.now();
|
|
@@ -1362,26 +1399,58 @@ Usage Examples:
|
|
|
1362
1399
|
});
|
|
1363
1400
|
await shutdownAnalytics();
|
|
1364
1401
|
});
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1402
|
+
const addCommandWithOverride = (cmd, opts)=>{
|
|
1403
|
+
cmd.exitOverride();
|
|
1404
|
+
cmd.configureOutput({
|
|
1405
|
+
writeErr: (str)=>{
|
|
1406
|
+
if (!process.argv.includes('--json')) process.stderr.write(str);
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
program.addCommand(cmd, opts);
|
|
1410
|
+
};
|
|
1411
|
+
addCommandWithOverride(createLoginCommand());
|
|
1412
|
+
addCommandWithOverride(createLogoutCommand());
|
|
1413
|
+
addCommandWithOverride(createInitCommand());
|
|
1414
|
+
addCommandWithOverride(createCreateProjectCommand());
|
|
1415
|
+
addCommandWithOverride(createIterateDesignDraftCommand());
|
|
1416
|
+
addCommandWithOverride(createPlanFlowPagesCommand(), {
|
|
1371
1417
|
hidden: true
|
|
1372
1418
|
});
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1419
|
+
addCommandWithOverride(createExecuteFlowPagesCommand());
|
|
1420
|
+
addCommandWithOverride(createExtractBrandGuideCommand());
|
|
1421
|
+
addCommandWithOverride(createSearchPromptsCommand());
|
|
1422
|
+
addCommandWithOverride(createGetPromptsCommand());
|
|
1423
|
+
addCommandWithOverride(createFetchDesignNodesCommand());
|
|
1424
|
+
addCommandWithOverride(createGetDesignCommand());
|
|
1425
|
+
addCommandWithOverride(createCreateDesignDraftCommand());
|
|
1380
1426
|
return program;
|
|
1381
1427
|
}
|
|
1382
1428
|
async function run() {
|
|
1383
1429
|
const program = createProgram();
|
|
1384
|
-
|
|
1430
|
+
try {
|
|
1431
|
+
await program.parseAsync(process.argv);
|
|
1432
|
+
} catch (err) {
|
|
1433
|
+
if (err && 'object' == typeof err && 'code' in err) {
|
|
1434
|
+
const commanderError = err;
|
|
1435
|
+
if ('commander.helpDisplayed' === commanderError.code || 'commander.version' === commanderError.code) process.exit(0);
|
|
1436
|
+
if ('commander.missingMandatoryOptionValue' === commanderError.code) {
|
|
1437
|
+
const hasJsonFlag = process.argv.includes('--json');
|
|
1438
|
+
if (hasJsonFlag) {
|
|
1439
|
+
const errorOutput = {
|
|
1440
|
+
error: commanderError.message,
|
|
1441
|
+
usage: getFailedCommandUsage(program)
|
|
1442
|
+
};
|
|
1443
|
+
process.stderr.write(JSON.stringify(errorOutput, null, 2) + '\n');
|
|
1444
|
+
} else {
|
|
1445
|
+
process.stderr.write('\n');
|
|
1446
|
+
const helpInfo = getFailedCommandHelp(program);
|
|
1447
|
+
if (helpInfo) process.stderr.write(helpInfo);
|
|
1448
|
+
}
|
|
1449
|
+
process.exit(1);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
throw err;
|
|
1453
|
+
}
|
|
1385
1454
|
}
|
|
1386
1455
|
})();
|
|
1387
1456
|
exports.ApiClientError = __webpack_exports__.ApiClientError;
|
package/dist/index.js
CHANGED
|
@@ -226,7 +226,7 @@ async function runAuthFlow(options = {}) {
|
|
|
226
226
|
try {
|
|
227
227
|
startSpinner('Creating auth session...');
|
|
228
228
|
const session = await createSession({
|
|
229
|
-
cliVersion: "0.1.
|
|
229
|
+
cliVersion: "0.1.13",
|
|
230
230
|
os: `${platform()} ${release()}`,
|
|
231
231
|
hostname: hostname()
|
|
232
232
|
});
|
|
@@ -1219,7 +1219,7 @@ async function trackCommand(opts) {
|
|
|
1219
1219
|
durationMs: opts.durationMs,
|
|
1220
1220
|
errorCode: opts.errorCode,
|
|
1221
1221
|
options: opts.options,
|
|
1222
|
-
cliVersion: "0.1.
|
|
1222
|
+
cliVersion: "0.1.13",
|
|
1223
1223
|
os: `${os.platform()} ${os.release()}`
|
|
1224
1224
|
};
|
|
1225
1225
|
const posthog = getPostHog();
|
|
@@ -1254,9 +1254,46 @@ external_dotenv_config({
|
|
|
1254
1254
|
path: external_path_resolve(src_dirname, '../.env')
|
|
1255
1255
|
});
|
|
1256
1256
|
external_dotenv_config();
|
|
1257
|
+
function getFailedCommandUsage(program) {
|
|
1258
|
+
const failedCommand = findFailedCommand(program);
|
|
1259
|
+
if (!failedCommand) return {
|
|
1260
|
+
message: 'Run with --help for usage information'
|
|
1261
|
+
};
|
|
1262
|
+
return {
|
|
1263
|
+
command: failedCommand.name(),
|
|
1264
|
+
description: failedCommand.description(),
|
|
1265
|
+
requiredOptions: failedCommand.options.filter((opt)=>opt.mandatory).map((opt)=>({
|
|
1266
|
+
flags: opt.flags,
|
|
1267
|
+
description: opt.description
|
|
1268
|
+
})),
|
|
1269
|
+
allOptions: failedCommand.options.map((opt)=>({
|
|
1270
|
+
flags: opt.flags,
|
|
1271
|
+
description: opt.description,
|
|
1272
|
+
required: opt.mandatory
|
|
1273
|
+
}))
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
function getFailedCommandHelp(program) {
|
|
1277
|
+
const failedCommand = findFailedCommand(program);
|
|
1278
|
+
if (!failedCommand) return '\nRun with --help for usage information\n';
|
|
1279
|
+
return '\n' + failedCommand.helpInformation();
|
|
1280
|
+
}
|
|
1281
|
+
function findFailedCommand(program) {
|
|
1282
|
+
const args = process.argv;
|
|
1283
|
+
const commandName = args[2];
|
|
1284
|
+
if (!commandName || commandName.startsWith('-')) return program;
|
|
1285
|
+
const subcommand = program.commands.find((cmd)=>cmd.name() === commandName);
|
|
1286
|
+
return subcommand || program;
|
|
1287
|
+
}
|
|
1257
1288
|
function createProgram() {
|
|
1258
1289
|
const program = new Command();
|
|
1259
|
-
program.name('superdesign').description('SuperDesign CLI - AI product designer for coding agents').version("0.1.
|
|
1290
|
+
program.name('superdesign').description('SuperDesign CLI - AI product designer for coding agents').version("0.1.13");
|
|
1291
|
+
program.configureOutput({
|
|
1292
|
+
writeErr: (str)=>{
|
|
1293
|
+
if (!process.argv.includes('--json')) process.stderr.write(str);
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
program.exitOverride();
|
|
1260
1297
|
let startTime = 0;
|
|
1261
1298
|
program.hook('preAction', ()=>{
|
|
1262
1299
|
startTime = Date.now();
|
|
@@ -1270,25 +1307,57 @@ function createProgram() {
|
|
|
1270
1307
|
});
|
|
1271
1308
|
await shutdownAnalytics();
|
|
1272
1309
|
});
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1310
|
+
const addCommandWithOverride = (cmd, opts)=>{
|
|
1311
|
+
cmd.exitOverride();
|
|
1312
|
+
cmd.configureOutput({
|
|
1313
|
+
writeErr: (str)=>{
|
|
1314
|
+
if (!process.argv.includes('--json')) process.stderr.write(str);
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
program.addCommand(cmd, opts);
|
|
1318
|
+
};
|
|
1319
|
+
addCommandWithOverride(createLoginCommand());
|
|
1320
|
+
addCommandWithOverride(createLogoutCommand());
|
|
1321
|
+
addCommandWithOverride(createInitCommand());
|
|
1322
|
+
addCommandWithOverride(createCreateProjectCommand());
|
|
1323
|
+
addCommandWithOverride(createIterateDesignDraftCommand());
|
|
1324
|
+
addCommandWithOverride(createPlanFlowPagesCommand(), {
|
|
1279
1325
|
hidden: true
|
|
1280
1326
|
});
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1327
|
+
addCommandWithOverride(createExecuteFlowPagesCommand());
|
|
1328
|
+
addCommandWithOverride(createExtractBrandGuideCommand());
|
|
1329
|
+
addCommandWithOverride(createSearchPromptsCommand());
|
|
1330
|
+
addCommandWithOverride(createGetPromptsCommand());
|
|
1331
|
+
addCommandWithOverride(createFetchDesignNodesCommand());
|
|
1332
|
+
addCommandWithOverride(createGetDesignCommand());
|
|
1333
|
+
addCommandWithOverride(createCreateDesignDraftCommand());
|
|
1288
1334
|
return program;
|
|
1289
1335
|
}
|
|
1290
1336
|
async function run() {
|
|
1291
1337
|
const program = createProgram();
|
|
1292
|
-
|
|
1338
|
+
try {
|
|
1339
|
+
await program.parseAsync(process.argv);
|
|
1340
|
+
} catch (err) {
|
|
1341
|
+
if (err && 'object' == typeof err && 'code' in err) {
|
|
1342
|
+
const commanderError = err;
|
|
1343
|
+
if ('commander.helpDisplayed' === commanderError.code || 'commander.version' === commanderError.code) process.exit(0);
|
|
1344
|
+
if ('commander.missingMandatoryOptionValue' === commanderError.code) {
|
|
1345
|
+
const hasJsonFlag = process.argv.includes('--json');
|
|
1346
|
+
if (hasJsonFlag) {
|
|
1347
|
+
const errorOutput = {
|
|
1348
|
+
error: commanderError.message,
|
|
1349
|
+
usage: getFailedCommandUsage(program)
|
|
1350
|
+
};
|
|
1351
|
+
process.stderr.write(JSON.stringify(errorOutput, null, 2) + '\n');
|
|
1352
|
+
} else {
|
|
1353
|
+
process.stderr.write('\n');
|
|
1354
|
+
const helpInfo = getFailedCommandHelp(program);
|
|
1355
|
+
if (helpInfo) process.stderr.write(helpInfo);
|
|
1356
|
+
}
|
|
1357
|
+
process.exit(1);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
throw err;
|
|
1361
|
+
}
|
|
1293
1362
|
}
|
|
1294
1363
|
export { ApiClientError, addDraft, claimSession, clearConfig, createApiClient, createDraft, createProgram, createProject, createPublicApiClient, createSession, executeFlowPages, extractBrandGuide, fetchDesignNodes, getApiClient, getApiKey, getApiUrl, getConfigDir, getConfigPath, getDesignHtml, getJobStatus, getPrompts, manager_isAuthenticated as isAuthenticated, isJobCompleted, isJobDone, isJobFailed, iterateDraft, loadConfig, planFlowPages, pollSession, run, saveConfig, searchPrompts, updateConfig };
|