adhdev 0.1.15 → 0.1.17
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 +86 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -177,8 +177,8 @@ async function detectIDEs() {
|
|
|
177
177
|
if ((0, import_fs.existsSync)(bundledCli)) resolvedCli = bundledCli;
|
|
178
178
|
}
|
|
179
179
|
if (!resolvedCli && appPath && os2 === "win32") {
|
|
180
|
-
const { dirname } = await import("path");
|
|
181
|
-
const appDir =
|
|
180
|
+
const { dirname: dirname2 } = await import("path");
|
|
181
|
+
const appDir = dirname2(appPath);
|
|
182
182
|
const candidates = [
|
|
183
183
|
`${appDir}\\bin\\${def.cli}.cmd`,
|
|
184
184
|
`${appDir}\\bin\\${def.cli}`,
|
|
@@ -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,21 +1342,63 @@ async function launchLinux(ide, port, workspace, newWindow) {
|
|
|
1336
1342
|
}
|
|
1337
1343
|
|
|
1338
1344
|
// src/index.ts
|
|
1339
|
-
var
|
|
1340
|
-
var
|
|
1341
|
-
var
|
|
1342
|
-
|
|
1345
|
+
var import_fs3 = require("fs");
|
|
1346
|
+
var import_path2 = require("path");
|
|
1347
|
+
var pkgVersion = "unknown";
|
|
1348
|
+
try {
|
|
1349
|
+
const possiblePaths = [
|
|
1350
|
+
(0, import_path2.join)(__dirname, "..", "package.json"),
|
|
1351
|
+
(0, import_path2.join)(__dirname, "package.json")
|
|
1352
|
+
];
|
|
1353
|
+
for (const p of possiblePaths) {
|
|
1354
|
+
try {
|
|
1355
|
+
const data = JSON.parse((0, import_fs3.readFileSync)(p, "utf-8"));
|
|
1356
|
+
if (data.version) {
|
|
1357
|
+
pkgVersion = data.version;
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
} catch {
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
} catch {
|
|
1364
|
+
}
|
|
1343
1365
|
var program = new import_commander.Command();
|
|
1344
|
-
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(
|
|
1345
|
-
program.command("setup"
|
|
1366
|
+
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version(pkgVersion);
|
|
1367
|
+
program.command("setup").description("Run the interactive setup wizard").option("-f, --force", "Force re-run setup even if already configured").action(async (options) => {
|
|
1346
1368
|
await runWizard({ force: options.force });
|
|
1347
1369
|
});
|
|
1348
|
-
program.command("launch [ide]").description("Launch or relaunch IDE with CDP debugging port
|
|
1370
|
+
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) => {
|
|
1371
|
+
let targetIdeId = ideArg;
|
|
1372
|
+
if (!targetIdeId) {
|
|
1373
|
+
const ides = await detectIDEs();
|
|
1374
|
+
const installed = ides.filter((i) => i.installed && i.cliCommand);
|
|
1375
|
+
if (installed.length === 0) {
|
|
1376
|
+
console.log(import_chalk2.default.red("\n\u2717 No supported IDE found.\n"));
|
|
1377
|
+
process.exit(1);
|
|
1378
|
+
}
|
|
1379
|
+
if (installed.length === 1) {
|
|
1380
|
+
targetIdeId = installed[0].id;
|
|
1381
|
+
} else {
|
|
1382
|
+
const inquirer2 = await import("inquirer");
|
|
1383
|
+
const { selectedIde } = await inquirer2.default.prompt([
|
|
1384
|
+
{
|
|
1385
|
+
type: "list",
|
|
1386
|
+
name: "selectedIde",
|
|
1387
|
+
message: "Which IDE to launch with CDP?",
|
|
1388
|
+
choices: installed.map((ide) => ({
|
|
1389
|
+
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
1390
|
+
value: ide.id
|
|
1391
|
+
}))
|
|
1392
|
+
}
|
|
1393
|
+
]);
|
|
1394
|
+
targetIdeId = selectedIde;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1349
1397
|
const ora2 = await import("ora");
|
|
1350
1398
|
const spinner = ora2.default("Detecting IDE...").start();
|
|
1351
1399
|
try {
|
|
1352
1400
|
const result = await launchWithCdp({
|
|
1353
|
-
ideId:
|
|
1401
|
+
ideId: targetIdeId,
|
|
1354
1402
|
workspace: options.workspace,
|
|
1355
1403
|
newWindow: options.newWindow
|
|
1356
1404
|
});
|
|
@@ -1398,7 +1446,7 @@ program.command("launch [ide]").description("Launch or relaunch IDE with CDP deb
|
|
|
1398
1446
|
process.exit(1);
|
|
1399
1447
|
}
|
|
1400
1448
|
});
|
|
1401
|
-
program.command("status").description("Show current ADHDev setup status").action(() => {
|
|
1449
|
+
program.command("status").description("Show current ADHDev setup status").action(async () => {
|
|
1402
1450
|
const config = loadConfig();
|
|
1403
1451
|
console.log(import_chalk2.default.bold("\n\u{1F309} ADHDev Status\n"));
|
|
1404
1452
|
if (!config.setupCompleted) {
|
|
@@ -1406,12 +1454,26 @@ program.command("status").description("Show current ADHDev setup status").action
|
|
|
1406
1454
|
console.log(import_chalk2.default.gray(" Run `adhdev setup` to get started.\n"));
|
|
1407
1455
|
return;
|
|
1408
1456
|
}
|
|
1457
|
+
const ideList = config.configuredIdes?.length ? config.configuredIdes : config.selectedIde ? [config.selectedIde] : [];
|
|
1409
1458
|
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("\u2713 Configured")}`);
|
|
1410
|
-
|
|
1459
|
+
if (ideList.length > 0) {
|
|
1460
|
+
const ides = await detectIDEs();
|
|
1461
|
+
console.log(` ${import_chalk2.default.bold("IDEs:")}`);
|
|
1462
|
+
for (const ideId of ideList) {
|
|
1463
|
+
const ide = ides.find((i) => i.id === ideId);
|
|
1464
|
+
if (ide?.installed) {
|
|
1465
|
+
const ver = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
1466
|
+
console.log(` ${import_chalk2.default.green("\u2713")} ${ide.icon} ${ide.displayName}${ver}`);
|
|
1467
|
+
} else {
|
|
1468
|
+
console.log(` ${import_chalk2.default.yellow("?")} ${ideId}`);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1411
1472
|
console.log(` ${import_chalk2.default.bold("Extensions:")} ${config.installedExtensions.length} installed`);
|
|
1412
1473
|
config.installedExtensions.forEach((ext) => {
|
|
1413
1474
|
console.log(import_chalk2.default.gray(` \u2022 ${ext}`));
|
|
1414
1475
|
});
|
|
1476
|
+
console.log(` ${import_chalk2.default.bold("User:")} ${config.userEmail || import_chalk2.default.gray("not logged in")}`);
|
|
1415
1477
|
console.log(` ${import_chalk2.default.bold("Auto-connect:")} ${config.autoConnect ? import_chalk2.default.green("enabled") : import_chalk2.default.gray("disabled")}`);
|
|
1416
1478
|
console.log(` ${import_chalk2.default.bold("Server:")} ${config.serverUrl}`);
|
|
1417
1479
|
console.log(` ${import_chalk2.default.bold("Setup date:")} ${config.setupDate || "unknown"}`);
|
|
@@ -1452,4 +1514,15 @@ program.command("reset").description("Reset ADHDev configuration").action(async
|
|
|
1452
1514
|
console.log(import_chalk2.default.gray(" Run `adhdev setup` to reconfigure.\n"));
|
|
1453
1515
|
}
|
|
1454
1516
|
});
|
|
1455
|
-
|
|
1517
|
+
if (process.argv.length <= 2) {
|
|
1518
|
+
program.outputHelp();
|
|
1519
|
+
console.log();
|
|
1520
|
+
console.log(import_chalk2.default.gray(" Quick start:"));
|
|
1521
|
+
console.log(import_chalk2.default.gray(" adhdev setup \u2014 First-time setup"));
|
|
1522
|
+
console.log(import_chalk2.default.gray(" adhdev launch cursor \u2014 Launch Cursor with CDP"));
|
|
1523
|
+
console.log(import_chalk2.default.gray(" adhdev launch \u2014 Choose IDE to launch"));
|
|
1524
|
+
console.log(import_chalk2.default.gray(" adhdev status \u2014 Check current setup"));
|
|
1525
|
+
console.log();
|
|
1526
|
+
} else {
|
|
1527
|
+
program.parse(process.argv);
|
|
1528
|
+
}
|