adhdev 0.1.14 → 0.1.16
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/index.js +68 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -639,6 +639,12 @@ async function quickSetup() {
|
|
|
639
639
|
console.log(` ${import_chalk.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
640
640
|
console.log(` ${import_chalk.default.bold("Status:")} ${import_chalk.default.green("Ready to connect")}`);
|
|
641
641
|
console.log();
|
|
642
|
+
console.log(import_chalk.default.gray(" Available commands:"));
|
|
643
|
+
console.log(import_chalk.default.gray(" adhdev launch \u2014 Launch IDE with CDP (choose IDE)"));
|
|
644
|
+
console.log(import_chalk.default.gray(" adhdev launch cursor \u2014 Launch specific IDE"));
|
|
645
|
+
console.log(import_chalk.default.gray(" adhdev status \u2014 Check setup status"));
|
|
646
|
+
console.log(import_chalk.default.gray(" adhdev setup \u2014 Reconfigure"));
|
|
647
|
+
console.log();
|
|
642
648
|
await installCliOnly();
|
|
643
649
|
}
|
|
644
650
|
async function customSetup() {
|
|
@@ -1336,17 +1342,47 @@ async function launchLinux(ide, port, workspace, newWindow) {
|
|
|
1336
1342
|
}
|
|
1337
1343
|
|
|
1338
1344
|
// src/index.ts
|
|
1345
|
+
var import_module = require("module");
|
|
1346
|
+
var import_meta = {};
|
|
1347
|
+
var require2 = (0, import_module.createRequire)(import_meta.url);
|
|
1348
|
+
var pkg = require2("../package.json");
|
|
1339
1349
|
var program = new import_commander.Command();
|
|
1340
|
-
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(
|
|
1341
|
-
program.command("setup"
|
|
1350
|
+
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(pkg.version);
|
|
1351
|
+
program.command("setup").description("Run the interactive setup wizard").option("-f, --force", "Force re-run setup even if already configured").action(async (options) => {
|
|
1342
1352
|
await runWizard({ force: options.force });
|
|
1343
1353
|
});
|
|
1344
|
-
program.command("launch [ide]").description("Launch or relaunch IDE with CDP debugging port
|
|
1354
|
+
program.command("launch [ide]").description("Launch or relaunch IDE with CDP debugging port").option("-w, --workspace <path>", "Workspace/folder to open").option("-n, --new-window", "Open in a new window").action(async (ideArg, options) => {
|
|
1355
|
+
let targetIdeId = ideArg;
|
|
1356
|
+
if (!targetIdeId) {
|
|
1357
|
+
const ides = await detectIDEs();
|
|
1358
|
+
const installed = ides.filter((i) => i.installed && i.cliCommand);
|
|
1359
|
+
if (installed.length === 0) {
|
|
1360
|
+
console.log(import_chalk2.default.red("\n\u2717 No supported IDE found.\n"));
|
|
1361
|
+
process.exit(1);
|
|
1362
|
+
}
|
|
1363
|
+
if (installed.length === 1) {
|
|
1364
|
+
targetIdeId = installed[0].id;
|
|
1365
|
+
} else {
|
|
1366
|
+
const inquirer2 = await import("inquirer");
|
|
1367
|
+
const { selectedIde } = await inquirer2.default.prompt([
|
|
1368
|
+
{
|
|
1369
|
+
type: "list",
|
|
1370
|
+
name: "selectedIde",
|
|
1371
|
+
message: "Which IDE to launch with CDP?",
|
|
1372
|
+
choices: installed.map((ide) => ({
|
|
1373
|
+
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
1374
|
+
value: ide.id
|
|
1375
|
+
}))
|
|
1376
|
+
}
|
|
1377
|
+
]);
|
|
1378
|
+
targetIdeId = selectedIde;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1345
1381
|
const ora2 = await import("ora");
|
|
1346
1382
|
const spinner = ora2.default("Detecting IDE...").start();
|
|
1347
1383
|
try {
|
|
1348
1384
|
const result = await launchWithCdp({
|
|
1349
|
-
ideId:
|
|
1385
|
+
ideId: targetIdeId,
|
|
1350
1386
|
workspace: options.workspace,
|
|
1351
1387
|
newWindow: options.newWindow
|
|
1352
1388
|
});
|
|
@@ -1394,7 +1430,7 @@ program.command("launch [ide]").description("Launch or relaunch IDE with CDP deb
|
|
|
1394
1430
|
process.exit(1);
|
|
1395
1431
|
}
|
|
1396
1432
|
});
|
|
1397
|
-
program.command("status").description("Show current ADHDev setup status").action(() => {
|
|
1433
|
+
program.command("status").description("Show current ADHDev setup status").action(async () => {
|
|
1398
1434
|
const config = loadConfig();
|
|
1399
1435
|
console.log(import_chalk2.default.bold("\n\u{1F309} ADHDev Status\n"));
|
|
1400
1436
|
if (!config.setupCompleted) {
|
|
@@ -1402,12 +1438,26 @@ program.command("status").description("Show current ADHDev setup status").action
|
|
|
1402
1438
|
console.log(import_chalk2.default.gray(" Run `adhdev setup` to get started.\n"));
|
|
1403
1439
|
return;
|
|
1404
1440
|
}
|
|
1441
|
+
const ideList = config.configuredIdes?.length ? config.configuredIdes : config.selectedIde ? [config.selectedIde] : [];
|
|
1405
1442
|
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("\u2713 Configured")}`);
|
|
1406
|
-
|
|
1443
|
+
if (ideList.length > 0) {
|
|
1444
|
+
const ides = await detectIDEs();
|
|
1445
|
+
console.log(` ${import_chalk2.default.bold("IDEs:")}`);
|
|
1446
|
+
for (const ideId of ideList) {
|
|
1447
|
+
const ide = ides.find((i) => i.id === ideId);
|
|
1448
|
+
if (ide?.installed) {
|
|
1449
|
+
const ver = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
1450
|
+
console.log(` ${import_chalk2.default.green("\u2713")} ${ide.icon} ${ide.displayName}${ver}`);
|
|
1451
|
+
} else {
|
|
1452
|
+
console.log(` ${import_chalk2.default.yellow("?")} ${ideId}`);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1407
1456
|
console.log(` ${import_chalk2.default.bold("Extensions:")} ${config.installedExtensions.length} installed`);
|
|
1408
1457
|
config.installedExtensions.forEach((ext) => {
|
|
1409
1458
|
console.log(import_chalk2.default.gray(` \u2022 ${ext}`));
|
|
1410
1459
|
});
|
|
1460
|
+
console.log(` ${import_chalk2.default.bold("User:")} ${config.userEmail || import_chalk2.default.gray("not logged in")}`);
|
|
1411
1461
|
console.log(` ${import_chalk2.default.bold("Auto-connect:")} ${config.autoConnect ? import_chalk2.default.green("enabled") : import_chalk2.default.gray("disabled")}`);
|
|
1412
1462
|
console.log(` ${import_chalk2.default.bold("Server:")} ${config.serverUrl}`);
|
|
1413
1463
|
console.log(` ${import_chalk2.default.bold("Setup date:")} ${config.setupDate || "unknown"}`);
|
|
@@ -1448,4 +1498,15 @@ program.command("reset").description("Reset ADHDev configuration").action(async
|
|
|
1448
1498
|
console.log(import_chalk2.default.gray(" Run `adhdev setup` to reconfigure.\n"));
|
|
1449
1499
|
}
|
|
1450
1500
|
});
|
|
1451
|
-
|
|
1501
|
+
if (process.argv.length <= 2) {
|
|
1502
|
+
program.outputHelp();
|
|
1503
|
+
console.log();
|
|
1504
|
+
console.log(import_chalk2.default.gray(" Quick start:"));
|
|
1505
|
+
console.log(import_chalk2.default.gray(" adhdev setup \u2014 First-time setup"));
|
|
1506
|
+
console.log(import_chalk2.default.gray(" adhdev launch cursor \u2014 Launch Cursor with CDP"));
|
|
1507
|
+
console.log(import_chalk2.default.gray(" adhdev launch \u2014 Choose IDE to launch"));
|
|
1508
|
+
console.log(import_chalk2.default.gray(" adhdev status \u2014 Check current setup"));
|
|
1509
|
+
console.log();
|
|
1510
|
+
} else {
|
|
1511
|
+
program.parse(process.argv);
|
|
1512
|
+
}
|