drivekit 1.0.1 → 1.0.2

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/cli.js CHANGED
@@ -632,6 +632,9 @@ var init_resumable_uploader = __esm({
632
632
  let chunkIndex = 0;
633
633
  try {
634
634
  while (bytesSent < totalBytes) {
635
+ if (options.signal?.aborted) {
636
+ throw new Error("Upload aborted by user signal");
637
+ }
635
638
  chunkIndex++;
636
639
  const currentChunkSize = Math.min(chunkSize, totalBytes - bytesSent);
637
640
  const buffer = Buffer.alloc(currentChunkSize);
@@ -692,6 +695,9 @@ var init_resumable_uploader = __esm({
692
695
  const totalChunks = Math.ceil(totalBytes / chunkSize) || 1;
693
696
  let chunkIndex = 0;
694
697
  while (bytesSent < totalBytes) {
698
+ if (options.signal?.aborted) {
699
+ throw new Error("Upload aborted by user signal");
700
+ }
695
701
  chunkIndex++;
696
702
  const currentChunkSize = Math.min(chunkSize, totalBytes - bytesSent);
697
703
  const chunk = buffer.subarray(bytesSent, bytesSent + currentChunkSize);
@@ -1662,6 +1668,169 @@ var init_browser_login = __esm({
1662
1668
  }
1663
1669
  });
1664
1670
 
1671
+ // src/core/resource-refs.ts
1672
+ var DriveFileRef, DriveFolderRef;
1673
+ var init_resource_refs = __esm({
1674
+ "src/core/resource-refs.ts"() {
1675
+ "use strict";
1676
+ init_esm_shims();
1677
+ DriveFileRef = class {
1678
+ drive;
1679
+ pathOrId;
1680
+ constructor(drive2, pathOrId) {
1681
+ this.drive = drive2;
1682
+ this.pathOrId = pathOrId;
1683
+ }
1684
+ /** Gets file metadata */
1685
+ async get() {
1686
+ return await this.drive.getFile(this.pathOrId);
1687
+ }
1688
+ /** Checks if the file exists */
1689
+ async exists() {
1690
+ return await this.drive.exists(this.pathOrId);
1691
+ }
1692
+ /** Reads file as UTF-8 string */
1693
+ async getText() {
1694
+ return await this.drive.getText(this.pathOrId);
1695
+ }
1696
+ /** Reads and parses JSON file */
1697
+ async getJson() {
1698
+ return await this.drive.getJson(this.pathOrId);
1699
+ }
1700
+ /** Downloads the file to destination */
1701
+ async download(optionsOrDestination) {
1702
+ const opts = typeof optionsOrDestination === "string" ? { destination: optionsOrDestination } : optionsOrDestination;
1703
+ return await this.drive.download(this.pathOrId, opts);
1704
+ }
1705
+ /** Moves the file to a new folder path or ID */
1706
+ async moveTo(newParentPathOrId) {
1707
+ return await this.drive.move(this.pathOrId, newParentPathOrId);
1708
+ }
1709
+ /** Copies the file to a target directory */
1710
+ async copyTo(parentPathOrId, newName) {
1711
+ return await this.drive.copy(this.pathOrId, { parent: parentPathOrId, name: newName });
1712
+ }
1713
+ /** Renames the file */
1714
+ async rename(newName) {
1715
+ return await this.drive.rename(this.pathOrId, newName);
1716
+ }
1717
+ /** Deletes the file (or moves to trash if permanent is false) */
1718
+ async delete(permanent = false) {
1719
+ return await this.drive.delete(this.pathOrId, permanent);
1720
+ }
1721
+ /** Moves file to trash */
1722
+ async trash() {
1723
+ return await this.drive.trash(this.pathOrId);
1724
+ }
1725
+ /** Shares file */
1726
+ async share(options) {
1727
+ return await this.drive.share(this.pathOrId, options);
1728
+ }
1729
+ /** Makes file publicly accessible */
1730
+ async sharePublic(role = "reader") {
1731
+ return await this.drive.sharePublic(this.pathOrId, role);
1732
+ }
1733
+ /** Gets public/preview links */
1734
+ async getLink() {
1735
+ return await this.drive.getShareableLink(this.pathOrId);
1736
+ }
1737
+ };
1738
+ DriveFolderRef = class {
1739
+ drive;
1740
+ pathOrId;
1741
+ constructor(drive2, pathOrId) {
1742
+ this.drive = drive2;
1743
+ this.pathOrId = pathOrId;
1744
+ }
1745
+ /** Lists contents of this folder */
1746
+ async ls() {
1747
+ return await this.drive.ls(this.pathOrId);
1748
+ }
1749
+ /** Ensures this folder and subpaths exist (mkdir -p) */
1750
+ async mkdirp(subPath) {
1751
+ const target = subPath ? this.pathOrId.endsWith("/") ? `${this.pathOrId}${subPath}` : `${this.pathOrId}/${subPath}` : this.pathOrId;
1752
+ return await this.drive.mkdirp(target);
1753
+ }
1754
+ /** Uploads a file directly into this folder */
1755
+ async upload(source, options = {}) {
1756
+ return await this.drive.upload({
1757
+ ...options,
1758
+ source,
1759
+ parent: this.pathOrId
1760
+ });
1761
+ }
1762
+ /** Synchronizes a local directory into this remote folder */
1763
+ async syncFrom(localDir, options = {}) {
1764
+ return await this.drive.syncFolder(localDir, this.pathOrId, options);
1765
+ }
1766
+ /** Pulls this remote folder down to local directory */
1767
+ async pullTo(localDestinationDir, options = {}) {
1768
+ return await this.drive.pull(this.pathOrId, localDestinationDir, options);
1769
+ }
1770
+ /** Watches this folder for real-time changes */
1771
+ async watch(options = {}) {
1772
+ return await this.drive.watch(this.pathOrId, options);
1773
+ }
1774
+ };
1775
+ }
1776
+ });
1777
+
1778
+ // src/core/plugins.ts
1779
+ var PluginManager;
1780
+ var init_plugins = __esm({
1781
+ "src/core/plugins.ts"() {
1782
+ "use strict";
1783
+ init_esm_shims();
1784
+ PluginManager = class {
1785
+ plugins = [];
1786
+ use(plugin) {
1787
+ this.plugins.push(plugin);
1788
+ return this;
1789
+ }
1790
+ async runBeforeUpload(options) {
1791
+ let current = { ...options };
1792
+ for (const plugin of this.plugins) {
1793
+ if (plugin.beforeUpload) {
1794
+ const modified = await plugin.beforeUpload(current);
1795
+ if (modified) current = modified;
1796
+ }
1797
+ }
1798
+ return current;
1799
+ }
1800
+ async runAfterUpload(file) {
1801
+ let current = file;
1802
+ for (const plugin of this.plugins) {
1803
+ if (plugin.afterUpload) {
1804
+ const modified = await plugin.afterUpload(current);
1805
+ if (modified) current = modified;
1806
+ }
1807
+ }
1808
+ return current;
1809
+ }
1810
+ async runBeforeDownload(fileId, options) {
1811
+ let current = { ...options };
1812
+ for (const plugin of this.plugins) {
1813
+ if (plugin.beforeDownload) {
1814
+ const modified = await plugin.beforeDownload(fileId, current);
1815
+ if (modified) current = modified;
1816
+ }
1817
+ }
1818
+ return current;
1819
+ }
1820
+ async runAfterDownload(result) {
1821
+ let current = result;
1822
+ for (const plugin of this.plugins) {
1823
+ if (plugin.afterDownload) {
1824
+ const modified = await plugin.afterDownload(current);
1825
+ if (modified) current = modified;
1826
+ }
1827
+ }
1828
+ return current;
1829
+ }
1830
+ };
1831
+ }
1832
+ });
1833
+
1665
1834
  // src/core/client.ts
1666
1835
  var client_exports = {};
1667
1836
  __export(client_exports, {
@@ -1685,6 +1854,8 @@ var init_client = __esm({
1685
1854
  init_storage_cleaner();
1686
1855
  init_smart_sync();
1687
1856
  init_browser_login();
1857
+ init_resource_refs();
1858
+ init_plugins();
1688
1859
  init_retry();
1689
1860
  init_format();
1690
1861
  init_mime();
@@ -1696,11 +1867,31 @@ var init_client = __esm({
1696
1867
  uploaderInstance = null;
1697
1868
  downloaderInstance = null;
1698
1869
  rootFolderId;
1870
+ pluginManager = new PluginManager();
1699
1871
  constructor(options = {}) {
1700
1872
  this.options = options;
1701
1873
  this.rootFolderId = options.rootFolderId || "root";
1702
1874
  this.authenticator = new DriveAuthenticator(options.auth);
1703
1875
  }
1876
+ /**
1877
+ * Registers a middleware plugin into DriveKit lifecycle
1878
+ */
1879
+ use(plugin) {
1880
+ this.pluginManager.use(plugin);
1881
+ return this;
1882
+ }
1883
+ /**
1884
+ * Returns a fluent, chained reference to a specific file
1885
+ */
1886
+ file(pathOrId) {
1887
+ return new DriveFileRef(this, pathOrId);
1888
+ }
1889
+ /**
1890
+ * Returns a fluent, chained reference to a specific folder
1891
+ */
1892
+ folder(pathOrId) {
1893
+ return new DriveFolderRef(this, pathOrId);
1894
+ }
1704
1895
  /**
1705
1896
  * Initializes the Google Drive API client (lazy-loaded if not called explicitly)
1706
1897
  */
@@ -1809,21 +2000,23 @@ var init_client = __esm({
1809
2000
  * - Real-time progress callback: % complete, transfer speed (MB/s), ETA
1810
2001
  */
1811
2002
  async upload(options) {
2003
+ const opts = await this.pluginManager.runBeforeUpload(options);
1812
2004
  const uploader = await this.getUploader();
1813
- let parentId = options.parent;
2005
+ let parentId = opts.parent;
1814
2006
  if (parentId && parentId.startsWith("/")) {
1815
2007
  parentId = await this.mkdirp(parentId);
1816
2008
  }
1817
- if (options.overwrite && options.name && parentId) {
1818
- const existing = await this.query().inFolder(parentId).nameEquals(options.name).notTrashed().first();
2009
+ if (opts.overwrite && opts.name && parentId) {
2010
+ const existing = await this.query().inFolder(parentId).nameEquals(opts.name).notTrashed().first();
1819
2011
  if (existing?.id) {
1820
2012
  await this.delete(existing.id, true);
1821
2013
  }
1822
2014
  }
1823
- return await uploader.upload({
1824
- ...options,
2015
+ const uploaded = await uploader.upload({
2016
+ ...opts,
1825
2017
  parent: parentId
1826
2018
  });
2019
+ return await this.pluginManager.runAfterUpload(uploaded);
1827
2020
  }
1828
2021
  /**
1829
2022
  * Downloads a file from Google Drive:
@@ -1833,8 +2026,10 @@ var init_client = __esm({
1833
2026
  */
1834
2027
  async download(fileIdOrPath, options = {}) {
1835
2028
  const fileId = await this.resolveId(fileIdOrPath);
2029
+ const processedOpts = await this.pluginManager.runBeforeDownload(fileId, options);
1836
2030
  const downloader = await this.getDownloader();
1837
- return await downloader.download(fileId, options);
2031
+ const result = await downloader.download(fileId, processedOpts);
2032
+ return await this.pluginManager.runAfterDownload(result);
1838
2033
  }
1839
2034
  /**
1840
2035
  * Gets file metadata
@@ -2258,10 +2453,166 @@ init_format();
2258
2453
  import fs6 from "fs";
2259
2454
  import path6 from "path";
2260
2455
  import { Command } from "commander";
2261
- import chalk from "chalk";
2456
+ import chalk2 from "chalk";
2262
2457
  import ora from "ora";
2458
+
2459
+ // src/cli/terminal-ui.ts
2460
+ init_esm_shims();
2461
+ init_format();
2462
+ import readline from "readline";
2463
+ import chalk from "chalk";
2464
+ function terminalLink(text, url) {
2465
+ return `\x1B]8;;${url}\x07${text}\x1B]8;;\x07`;
2466
+ }
2467
+ function renderFileRow(item, index) {
2468
+ const isDir = item.mimeType === "application/vnd.google-apps.folder";
2469
+ const icon = isDir ? "\u{1F4C1}" : getFileIcon(item.mimeType || "");
2470
+ const prefix = index !== void 0 ? `${chalk.dim((index + 1).toString().padStart(2, " ") + ".")} ` : "";
2471
+ let nameFormatted = isDir ? chalk.bold.blue(item.name || "untitled") : chalk.white(item.name || "untitled");
2472
+ if (item.webViewLink) {
2473
+ nameFormatted = terminalLink(nameFormatted, item.webViewLink);
2474
+ }
2475
+ const sizeFormatted = item.size ? chalk.dim(`[${formatBytes(parseInt(item.size, 10)).padStart(9, " ")}]`) : chalk.dim(isDir ? "[ FOLDER ]" : "[ DOC ]");
2476
+ const idFormatted = chalk.dim(`ID: ${item.id}`);
2477
+ return `${prefix}${icon} ${nameFormatted.padEnd(45)} ${sizeFormatted} ${idFormatted}`;
2478
+ }
2479
+ function getFileIcon(mimeType) {
2480
+ if (mimeType.includes("pdf")) return "\u{1F4D5}";
2481
+ if (mimeType.includes("image")) return "\u{1F5BC}\uFE0F ";
2482
+ if (mimeType.includes("video")) return "\u{1F3AC}";
2483
+ if (mimeType.includes("audio")) return "\u{1F3B5}";
2484
+ if (mimeType.includes("zip") || mimeType.includes("compressed") || mimeType.includes("tar")) return "\u{1F4E6}";
2485
+ if (mimeType.includes("spreadsheet") || mimeType.includes("excel")) return "\u{1F4CA}";
2486
+ if (mimeType.includes("document") || mimeType.includes("word")) return "\u{1F4DD}";
2487
+ if (mimeType.includes("presentation")) return "\u{1F4FD}\uFE0F ";
2488
+ if (mimeType.includes("json") || mimeType.includes("javascript") || mimeType.includes("typescript")) return "\u2699\uFE0F ";
2489
+ return "\u{1F4C4}";
2490
+ }
2491
+ async function runInteractiveExplorer(client, initialFolder = "/") {
2492
+ let currentFolder = initialFolder;
2493
+ let items = [];
2494
+ let selectedIndex = 0;
2495
+ let history = [];
2496
+ const refreshItems = async () => {
2497
+ items = await client.ls(currentFolder);
2498
+ selectedIndex = Math.min(selectedIndex, Math.max(0, items.length - 1));
2499
+ };
2500
+ await refreshItems();
2501
+ if (!process.stdin.isTTY) {
2502
+ console.log(chalk.yellow("Interactive explorer requires a TTY terminal. Listing items instead:"));
2503
+ for (const item of items) {
2504
+ console.log(renderFileRow(item));
2505
+ }
2506
+ return;
2507
+ }
2508
+ readline.emitKeypressEvents(process.stdin);
2509
+ process.stdin.setRawMode(true);
2510
+ const renderScreen = () => {
2511
+ console.clear();
2512
+ console.log(chalk.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
2513
+ console.log(chalk.bold.cyan("\u2551") + chalk.bold.yellow(" \u26A1 DriveKit Interactive Terminal Explorer ") + chalk.bold.cyan("\u2551"));
2514
+ console.log(chalk.bold.cyan("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563"));
2515
+ console.log(chalk.bold.cyan("\u2551") + ` \u{1F4C2} Path: ${chalk.bold.green(currentFolder.padEnd(72))} ` + chalk.bold.cyan("\u2551"));
2516
+ console.log(chalk.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
2517
+ console.log(chalk.dim(" [\u2191/\u2193] Navigate \u2022 [Enter] Open Folder \u2022 [B] Back \u2022 [S] Share \u2022 [Q] Exit\n"));
2518
+ if (items.length === 0) {
2519
+ console.log(chalk.dim(" (This folder is empty)\n"));
2520
+ return;
2521
+ }
2522
+ const pageSize = 12;
2523
+ const startIdx = Math.max(0, Math.min(selectedIndex - Math.floor(pageSize / 2), items.length - pageSize));
2524
+ const endIdx = Math.min(items.length, startIdx + pageSize);
2525
+ for (let i = startIdx; i < endIdx; i++) {
2526
+ const isSelected = i === selectedIndex;
2527
+ const cursor = isSelected ? chalk.bold.cyan(" \u25BA ") : " ";
2528
+ const row = renderFileRow(items[i]);
2529
+ if (isSelected) {
2530
+ console.log(chalk.bgHex("#1e293b")(cursor + row));
2531
+ } else {
2532
+ console.log(cursor + row);
2533
+ }
2534
+ }
2535
+ console.log(chalk.dim(`
2536
+ Item ${selectedIndex + 1} of ${items.length}`));
2537
+ };
2538
+ renderScreen();
2539
+ return new Promise((resolve) => {
2540
+ const onKeypress = async (str, key) => {
2541
+ if (key.ctrl && key.name === "c") {
2542
+ cleanup();
2543
+ process.exit(0);
2544
+ }
2545
+ if (key.name === "q" || key.name === "escape" && history.length === 0) {
2546
+ cleanup();
2547
+ resolve();
2548
+ return;
2549
+ }
2550
+ if (key.name === "up") {
2551
+ selectedIndex = selectedIndex > 0 ? selectedIndex - 1 : items.length - 1;
2552
+ renderScreen();
2553
+ } else if (key.name === "down") {
2554
+ selectedIndex = selectedIndex < items.length - 1 ? selectedIndex + 1 : 0;
2555
+ renderScreen();
2556
+ } else if (key.name === "return") {
2557
+ const item = items[selectedIndex];
2558
+ if (item && item.mimeType === "application/vnd.google-apps.folder") {
2559
+ history.push(currentFolder);
2560
+ currentFolder = currentFolder === "/" ? `/${item.name}` : `${currentFolder}/${item.name}`;
2561
+ selectedIndex = 0;
2562
+ await refreshItems();
2563
+ renderScreen();
2564
+ } else if (item && item.webViewLink) {
2565
+ const { exec: exec2 } = await import("child_process");
2566
+ const openCmd = process.platform === "darwin" ? `open "${item.webViewLink}"` : `xdg-open "${item.webViewLink}"`;
2567
+ exec2(openCmd);
2568
+ renderScreen();
2569
+ }
2570
+ } else if (key.name === "b" || key.name === "backspace") {
2571
+ if (history.length > 0) {
2572
+ currentFolder = history.pop();
2573
+ selectedIndex = 0;
2574
+ await refreshItems();
2575
+ renderScreen();
2576
+ }
2577
+ } else if (str === "s" || str === "S") {
2578
+ const item = items[selectedIndex];
2579
+ if (item && item.id) {
2580
+ process.stdin.pause();
2581
+ console.log(`
2582
+
2583
+ ${chalk.cyan("\u{1F517} Getting shareable link for:")} ${chalk.bold(item.name)}...`);
2584
+ try {
2585
+ const links = await client.sharePublic(item.id);
2586
+ console.log(`Preview URL: ${chalk.underline(links.previewLink)}`);
2587
+ console.log(`Direct Download URL: ${chalk.underline(links.directDownloadLink)}`);
2588
+ console.log(chalk.dim("\nPress any key to return to explorer..."));
2589
+ process.stdin.resume();
2590
+ process.stdin.once("data", () => {
2591
+ renderScreen();
2592
+ });
2593
+ } catch (err) {
2594
+ console.error(chalk.red(`Failed to share: ${err.message}`));
2595
+ setTimeout(renderScreen, 2e3);
2596
+ }
2597
+ }
2598
+ }
2599
+ };
2600
+ const cleanup = () => {
2601
+ process.stdin.removeListener("keypress", onKeypress);
2602
+ if (process.stdin.setRawMode) {
2603
+ process.stdin.setRawMode(false);
2604
+ }
2605
+ process.stdin.pause();
2606
+ console.clear();
2607
+ console.log(chalk.green("\u{1F44B} Exited DriveKit explorer."));
2608
+ };
2609
+ process.stdin.on("keypress", onKeypress);
2610
+ });
2611
+ }
2612
+
2613
+ // src/cli.ts
2263
2614
  var program = new Command();
2264
- program.name("drivekit").description(chalk.bold.cyan("\u26A1 DriveKit CLI: High-speed, flexible Google Drive tool for developers")).version("1.0.0").option("-k, --key <path>", "Path to service account JSON key file").option("-t, --token <token>", "Google OAuth2 Bearer access token");
2615
+ program.name("drivekit").description(chalk2.bold.cyan("\u26A1 DriveKit CLI: High-speed, flexible Google Drive tool for developers")).version("1.0.0").option("-k, --key <path>", "Path to service account JSON key file").option("-t, --token <token>", "Google OAuth2 Bearer access token");
2265
2616
  function getAuthConfig(cmdOptions) {
2266
2617
  const keyFilePath = cmdOptions.key || process.env.GOOGLE_APPLICATION_CREDENTIALS || process.env.GDRIVE_SERVICE_ACCOUNT_PATH;
2267
2618
  const accessToken = cmdOptions.token || process.env.GDRIVE_ACCESS_TOKEN;
@@ -2284,19 +2635,19 @@ program.command("quota").description("Show Google Drive storage usage & quota").
2284
2635
  const client = await getClient(options);
2285
2636
  const quota = await client.getStorageQuota();
2286
2637
  spinner.stop();
2287
- console.log(chalk.bold.cyan("\n\u{1F4CA} Google Drive Storage Quota:"));
2638
+ console.log(chalk2.bold.cyan("\n\u{1F4CA} Google Drive Storage Quota:"));
2288
2639
  if (quota.user?.displayName) {
2289
- console.log(`\u{1F464} User: ${chalk.yellow(quota.user.displayName)} (${quota.user.emailAddress})`);
2640
+ console.log(`\u{1F464} User: ${chalk2.yellow(quota.user.displayName)} (${quota.user.emailAddress})`);
2290
2641
  }
2291
- console.log(`\u{1F4BE} Total Usage: ${chalk.green(quota.formattedUsage)} / ${chalk.blue(quota.formattedLimit)}`);
2642
+ console.log(`\u{1F4BE} Total Usage: ${chalk2.green(quota.formattedUsage)} / ${chalk2.blue(quota.formattedLimit)}`);
2292
2643
  if (quota.percentUsed !== null) {
2293
- console.log(`\u{1F4C8} Usage %: ${chalk.bold(quota.percentUsed + "%")}`);
2644
+ console.log(`\u{1F4C8} Usage %: ${chalk2.bold(quota.percentUsed + "%")}`);
2294
2645
  }
2295
2646
  console.log(`\u{1F4C1} In Drive: ${formatBytes(quota.usageInDrive)}`);
2296
2647
  console.log(`\u{1F5D1}\uFE0F In Trash: ${formatBytes(quota.usageInDriveTrash)}
2297
2648
  `);
2298
2649
  } catch (err) {
2299
- spinner.fail(chalk.red(`Failed to fetch quota: ${err.message}`));
2650
+ spinner.fail(chalk2.red(`Failed to fetch quota: ${err.message}`));
2300
2651
  process.exit(1);
2301
2652
  }
2302
2653
  });
@@ -2307,31 +2658,35 @@ program.command("ls [folder]").description("List files and folders (by virtual p
2307
2658
  const items = await client.ls(folder);
2308
2659
  spinner.stop();
2309
2660
  if (items.length === 0) {
2310
- console.log(chalk.dim(`(Folder ${folder} is empty)`));
2661
+ console.log(chalk2.dim(`(Folder ${folder} is empty)`));
2311
2662
  return;
2312
2663
  }
2313
- console.log(chalk.bold.cyan(`
2664
+ console.log(chalk2.bold.cyan(`
2314
2665
  \u{1F4C1} Contents of "${folder}":
2315
2666
  `));
2316
- for (const item of items) {
2317
- const isDir = item.mimeType === "application/vnd.google-apps.folder";
2318
- const icon = isDir ? "\u{1F4C1}" : "\u{1F4C4}";
2319
- const nameFormatted = isDir ? chalk.bold.blue(item.name) : chalk.white(item.name);
2320
- const sizeFormatted = item.size ? chalk.dim(`[${formatBytes(parseInt(item.size, 10))}]`) : chalk.dim(isDir ? "[DIR]" : "[Google Doc]");
2321
- const idFormatted = chalk.dim(`(ID: ${item.id})`);
2322
- console.log(` ${icon} ${nameFormatted.padEnd(40)} ${sizeFormatted.padEnd(16)} ${idFormatted}`);
2667
+ for (let i = 0; i < items.length; i++) {
2668
+ console.log(renderFileRow(items[i], i));
2323
2669
  }
2324
2670
  console.log(`
2325
- Total items: ${chalk.green(items.length)}
2671
+ Total items: ${chalk2.green(items.length)}
2326
2672
  `);
2327
2673
  } catch (err) {
2328
- spinner.fail(chalk.red(`Failed to list items: ${err.message}`));
2674
+ spinner.fail(chalk2.red(`Failed to list items: ${err.message}`));
2675
+ process.exit(1);
2676
+ }
2677
+ });
2678
+ program.command("explore [folder]").description("Interactive terminal keyboard file explorer (TUI) for Google Drive").action(async (folder = "/", options) => {
2679
+ try {
2680
+ const client = await getClient(options);
2681
+ await runInteractiveExplorer(client, folder);
2682
+ } catch (err) {
2683
+ console.error(chalk2.red(`Explorer failed: ${err.message}`));
2329
2684
  process.exit(1);
2330
2685
  }
2331
2686
  });
2332
2687
  program.command("upload <localFile> [remotePath]").description("Upload a file with high speed and live progress tracking").option("-o, --overwrite", "Overwrite remote file if it exists").action(async (localFile, remotePath = "/", options) => {
2333
2688
  if (!fs6.existsSync(localFile)) {
2334
- console.error(chalk.red(`\u274C Local file not found: ${localFile}`));
2689
+ console.error(chalk2.red(`\u274C Local file not found: ${localFile}`));
2335
2690
  process.exit(1);
2336
2691
  }
2337
2692
  const fileName = path6.basename(localFile);
@@ -2347,22 +2702,22 @@ program.command("upload <localFile> [remotePath]").description("Upload a file wi
2347
2702
  overwrite: options.overwrite,
2348
2703
  onProgress: (p) => {
2349
2704
  process.stdout.write(
2350
- `\r\u{1F680} Uploading: ${chalk.cyan(p.percentage + "%")} | Speed: ${chalk.green(p.speedFormatted)} | ETA: ${chalk.yellow(p.estimatedTimeRemainingSeconds + "s")} [${formatBytes(p.bytesSent)} / ${formatBytes(p.totalBytes)}]`
2705
+ `\r\u{1F680} Uploading: ${chalk2.cyan(p.percentage + "%")} | Speed: ${chalk2.green(p.speedFormatted)} | ETA: ${chalk2.yellow(p.estimatedTimeRemainingSeconds + "s")} [${formatBytes(p.bytesSent)} / ${formatBytes(p.totalBytes)}]`
2351
2706
  );
2352
2707
  }
2353
2708
  });
2354
2709
  process.stdout.write("\n");
2355
2710
  const durationSecs = ((Date.now() - startTime) / 1e3).toFixed(1);
2356
- console.log(chalk.green(`
2711
+ console.log(chalk2.green(`
2357
2712
  \u2705 Upload completed successfully in ${durationSecs}s!`));
2358
- console.log(`\u{1F4C4} Name: ${chalk.bold(res.name)}`);
2359
- console.log(`\u{1F194} ID: ${chalk.cyan(res.id)}`);
2713
+ console.log(`\u{1F4C4} Name: ${chalk2.bold(res.name)}`);
2714
+ console.log(`\u{1F194} ID: ${chalk2.cyan(res.id)}`);
2360
2715
  if (res.webViewLink) {
2361
- console.log(`\u{1F517} Link: ${chalk.underline(res.webViewLink)}`);
2716
+ console.log(`\u{1F517} Link: ${chalk2.underline(res.webViewLink)}`);
2362
2717
  }
2363
2718
  console.log("");
2364
2719
  } catch (err) {
2365
- spinner.fail(chalk.red(`Upload failed: ${err.message}`));
2720
+ spinner.fail(chalk2.red(`Upload failed: ${err.message}`));
2366
2721
  process.exit(1);
2367
2722
  }
2368
2723
  });
@@ -2376,20 +2731,20 @@ program.command("download <fileIdOrPath> [destination]").description("Download a
2376
2731
  onProgress: (p) => {
2377
2732
  const pct = p.percentage !== void 0 ? `${p.percentage}%` : `${formatBytes(p.bytesRead)}`;
2378
2733
  process.stdout.write(
2379
- `\r\u2B07\uFE0F Downloading: ${chalk.cyan(pct)} | Speed: ${chalk.green(p.speedFormatted)}`
2734
+ `\r\u2B07\uFE0F Downloading: ${chalk2.cyan(pct)} | Speed: ${chalk2.green(p.speedFormatted)}`
2380
2735
  );
2381
2736
  }
2382
2737
  });
2383
2738
  process.stdout.write("\n");
2384
- console.log(chalk.green(`
2739
+ console.log(chalk2.green(`
2385
2740
  \u2705 Download completed!`));
2386
- console.log(`\u{1F4C2} Saved to: ${chalk.bold(res.filePath)}`);
2741
+ console.log(`\u{1F4C2} Saved to: ${chalk2.bold(res.filePath)}`);
2387
2742
  if (res.size) {
2388
2743
  console.log(`\u{1F4E6} Size: ${formatBytes(res.size)}`);
2389
2744
  }
2390
2745
  console.log("");
2391
2746
  } catch (err) {
2392
- spinner.fail(chalk.red(`Download failed: ${err.message}`));
2747
+ spinner.fail(chalk2.red(`Download failed: ${err.message}`));
2393
2748
  process.exit(1);
2394
2749
  }
2395
2750
  });
@@ -2403,16 +2758,16 @@ program.command("share <fileIdOrPath> [email]").description("Share file publicly
2403
2758
  type: "user",
2404
2759
  emailAddress: email
2405
2760
  });
2406
- spinner.succeed(chalk.green(`File shared with ${email} as reader!`));
2761
+ spinner.succeed(chalk2.green(`File shared with ${email} as reader!`));
2407
2762
  } else {
2408
2763
  const links = await client.sharePublic(fileIdOrPath);
2409
- spinner.succeed(chalk.green(`File is now publicly accessible to anyone with the link!`));
2410
- console.log(`\u{1F517} Preview Link: ${chalk.underline(links.previewLink)}`);
2411
- console.log(`\u{1F4E5} Direct Download Link: ${chalk.underline(links.directDownloadLink)}
2764
+ spinner.succeed(chalk2.green(`File is now publicly accessible to anyone with the link!`));
2765
+ console.log(`\u{1F517} Preview Link: ${chalk2.underline(links.previewLink)}`);
2766
+ console.log(`\u{1F4E5} Direct Download Link: ${chalk2.underline(links.directDownloadLink)}
2412
2767
  `);
2413
2768
  }
2414
2769
  } catch (err) {
2415
- spinner.fail(chalk.red(`Sharing failed: ${err.message}`));
2770
+ spinner.fail(chalk2.red(`Sharing failed: ${err.message}`));
2416
2771
  process.exit(1);
2417
2772
  }
2418
2773
  });
@@ -2422,19 +2777,19 @@ program.command("delete <fileIdOrPath>").description("Move a file/folder to tras
2422
2777
  try {
2423
2778
  const client = await getClient(options);
2424
2779
  await client.delete(fileIdOrPath, options.permanent);
2425
- spinner.succeed(chalk.green(`Success! ${fileIdOrPath} has been ${options.permanent ? "permanently deleted" : "moved to trash"}.`));
2780
+ spinner.succeed(chalk2.green(`Success! ${fileIdOrPath} has been ${options.permanent ? "permanently deleted" : "moved to trash"}.`));
2426
2781
  } catch (err) {
2427
- spinner.fail(chalk.red(`Failed: ${err.message}`));
2782
+ spinner.fail(chalk2.red(`Failed: ${err.message}`));
2428
2783
  process.exit(1);
2429
2784
  }
2430
2785
  });
2431
2786
  program.command("sync <localDir> <remoteFolder>").description("Sync a local directory to Google Drive recursively with high concurrency").option("-c, --concurrency <number>", "Number of parallel uploads", "4").option("-o, --overwrite", "Overwrite files if they already exist").action(async (localDir, remoteFolder, options) => {
2432
2787
  if (!fs6.existsSync(localDir)) {
2433
- console.error(chalk.red(`\u274C Local directory not found: ${localDir}`));
2788
+ console.error(chalk2.red(`\u274C Local directory not found: ${localDir}`));
2434
2789
  process.exit(1);
2435
2790
  }
2436
2791
  const concurrency = parseInt(options.concurrency, 10) || 4;
2437
- console.log(chalk.bold.cyan(`
2792
+ console.log(chalk2.bold.cyan(`
2438
2793
  \u26A1 Starting recursive sync:`));
2439
2794
  console.log(`\u{1F4C2} Local: ${localDir}`);
2440
2795
  console.log(`\u2601\uFE0F Remote: ${remoteFolder}`);
@@ -2448,30 +2803,30 @@ program.command("sync <localDir> <remoteFolder>").description("Sync a local dire
2448
2803
  concurrency,
2449
2804
  overwrite: options.overwrite,
2450
2805
  onFileStart: (_, rel) => {
2451
- console.log(` \u2B06\uFE0F Uploading: ${chalk.dim(rel)}`);
2806
+ console.log(` \u2B06\uFE0F Uploading: ${chalk2.dim(rel)}`);
2452
2807
  },
2453
2808
  onFileComplete: (_, fileId) => {
2454
- console.log(` ${chalk.green("\u2713 Completed")} ${chalk.dim(`(ID: ${fileId})`)}`);
2809
+ console.log(` ${chalk2.green("\u2713 Completed")} ${chalk2.dim(`(ID: ${fileId})`)}`);
2455
2810
  }
2456
2811
  });
2457
- console.log(chalk.bold.green(`
2812
+ console.log(chalk2.bold.green(`
2458
2813
  \u{1F389} Sync Finished in ${(result.durationMs / 1e3).toFixed(1)}s!`));
2459
- console.log(`\u2705 Uploaded: ${chalk.green(result.uploaded.length)} files (${formatBytes(result.totalBytes)})`);
2814
+ console.log(`\u2705 Uploaded: ${chalk2.green(result.uploaded.length)} files (${formatBytes(result.totalBytes)})`);
2460
2815
  if (result.failed.length > 0) {
2461
- console.log(`\u274C Failed: ${chalk.red(result.failed.length)} files`);
2816
+ console.log(`\u274C Failed: ${chalk2.red(result.failed.length)} files`);
2462
2817
  for (const f of result.failed) {
2463
- console.log(` - ${f.localPath}: ${chalk.red(f.error.message)}`);
2818
+ console.log(` - ${f.localPath}: ${chalk2.red(f.error.message)}`);
2464
2819
  }
2465
2820
  }
2466
2821
  console.log("");
2467
2822
  } catch (err) {
2468
- spinner.fail(chalk.red(`Sync failed: ${err.message}`));
2823
+ spinner.fail(chalk2.red(`Sync failed: ${err.message}`));
2469
2824
  process.exit(1);
2470
2825
  }
2471
2826
  });
2472
2827
  program.command("pull <remoteFolder> <localDir>").description("Download an entire remote Google Drive folder down to local directory with MD5 deduplication").option("-c, --concurrency <number>", "Parallel downloads", "4").option("-o, --overwrite", "Overwrite local files even if identical").action(async (remoteFolder, localDir, options) => {
2473
2828
  const concurrency = parseInt(options.concurrency, 10) || 4;
2474
- console.log(chalk.bold.cyan(`
2829
+ console.log(chalk2.bold.cyan(`
2475
2830
  \u2B07\uFE0F Starting smart pull:`));
2476
2831
  console.log(`\u2601\uFE0F Remote: ${remoteFolder}`);
2477
2832
  console.log(`\u{1F4C2} Local: ${localDir}`);
@@ -2485,24 +2840,24 @@ program.command("pull <remoteFolder> <localDir>").description("Download an entir
2485
2840
  concurrency,
2486
2841
  overwrite: options.overwrite,
2487
2842
  onFileStart: (name, rel) => {
2488
- console.log(` \u2B07\uFE0F Downloading: ${chalk.dim(rel)}`);
2843
+ console.log(` \u2B07\uFE0F Downloading: ${chalk2.dim(rel)}`);
2489
2844
  },
2490
2845
  onFileComplete: (name) => {
2491
- console.log(` ${chalk.green("\u2713 Saved")} ${name}`);
2846
+ console.log(` ${chalk2.green("\u2713 Saved")} ${name}`);
2492
2847
  }
2493
2848
  });
2494
- console.log(chalk.bold.green(`
2849
+ console.log(chalk2.bold.green(`
2495
2850
  \u{1F389} Pull Finished in ${(result.durationMs / 1e3).toFixed(1)}s!`));
2496
- console.log(`\u2705 Downloaded: ${chalk.green(result.downloaded.length)} files (${formatBytes(result.totalBytes)})`);
2851
+ console.log(`\u2705 Downloaded: ${chalk2.green(result.downloaded.length)} files (${formatBytes(result.totalBytes)})`);
2497
2852
  if (result.skipped.length > 0) {
2498
- console.log(`\u23ED\uFE0F Skipped: ${chalk.yellow(result.skipped.length)} identical files`);
2853
+ console.log(`\u23ED\uFE0F Skipped: ${chalk2.yellow(result.skipped.length)} identical files`);
2499
2854
  }
2500
2855
  if (result.failed.length > 0) {
2501
- console.log(`\u274C Failed: ${chalk.red(result.failed.length)} files`);
2856
+ console.log(`\u274C Failed: ${chalk2.red(result.failed.length)} files`);
2502
2857
  }
2503
2858
  console.log("");
2504
2859
  } catch (err) {
2505
- spinner.fail(chalk.red(`Pull failed: ${err.message}`));
2860
+ spinner.fail(chalk2.red(`Pull failed: ${err.message}`));
2506
2861
  process.exit(1);
2507
2862
  }
2508
2863
  });
@@ -2512,7 +2867,7 @@ program.command("clean").description("Storage management: find largest files, de
2512
2867
  if (options.emptyTrash) {
2513
2868
  const spinner2 = ora("Emptying trash bin...").start();
2514
2869
  await client.emptyTrash();
2515
- spinner2.succeed(chalk.green("Trash bin emptied successfully!"));
2870
+ spinner2.succeed(chalk2.green("Trash bin emptied successfully!"));
2516
2871
  return;
2517
2872
  }
2518
2873
  if (options.duplicates) {
@@ -2520,16 +2875,16 @@ program.command("clean").description("Storage management: find largest files, de
2520
2875
  const duplicates = await client.findDuplicates({ by: "name" });
2521
2876
  spinner2.stop();
2522
2877
  if (duplicates.length === 0) {
2523
- console.log(chalk.green("\n\u2728 No duplicate files found!"));
2878
+ console.log(chalk2.green("\n\u2728 No duplicate files found!"));
2524
2879
  return;
2525
2880
  }
2526
- console.log(chalk.bold.yellow(`
2881
+ console.log(chalk2.bold.yellow(`
2527
2882
  \u26A0\uFE0F Found ${duplicates.length} duplicate groups:
2528
2883
  `));
2529
2884
  for (const g of duplicates) {
2530
- console.log(`\u{1F4C4} "${chalk.bold(g.name)}" (${chalk.cyan(g.count + " copies")} - total: ${chalk.magenta(g.formattedTotalSize)})`);
2885
+ console.log(`\u{1F4C4} "${chalk2.bold(g.name)}" (${chalk2.cyan(g.count + " copies")} - total: ${chalk2.magenta(g.formattedTotalSize)})`);
2531
2886
  for (const f of g.files) {
2532
- console.log(` - ID: ${chalk.dim(f.id)} [${formatBytes(f.size)}] modified: ${chalk.dim(f.modifiedTime || "unknown")}`);
2887
+ console.log(` - ID: ${chalk2.dim(f.id)} [${formatBytes(f.size)}] modified: ${chalk2.dim(f.modifiedTime || "unknown")}`);
2533
2888
  }
2534
2889
  }
2535
2890
  console.log("");
@@ -2539,51 +2894,51 @@ program.command("clean").description("Storage management: find largest files, de
2539
2894
  const spinner = ora(`Finding top ${limit} largest files...`).start();
2540
2895
  const largest = await client.findLargestFiles(limit);
2541
2896
  spinner.stop();
2542
- console.log(chalk.bold.cyan(`
2897
+ console.log(chalk2.bold.cyan(`
2543
2898
  \u{1F4CA} Top ${largest.length} Largest Files in Drive:
2544
2899
  `));
2545
2900
  for (let i = 0; i < largest.length; i++) {
2546
2901
  const f = largest[i];
2547
- console.log(` ${chalk.bold(i + 1 + ".")} ${chalk.white(f.name.padEnd(35))} ${chalk.green(f.formattedSize.padEnd(12))} ID: ${chalk.dim(f.id)}`);
2902
+ console.log(` ${chalk2.bold(i + 1 + ".")} ${chalk2.white(f.name.padEnd(35))} ${chalk2.green(f.formattedSize.padEnd(12))} ID: ${chalk2.dim(f.id)}`);
2548
2903
  }
2549
2904
  console.log("");
2550
2905
  } catch (err) {
2551
- console.error(chalk.red(`Clean operation failed: ${err.message}`));
2906
+ console.error(chalk2.red(`Clean operation failed: ${err.message}`));
2552
2907
  process.exit(1);
2553
2908
  }
2554
2909
  });
2555
2910
  program.command("watch [folder]").description("Watch Google Drive or a specific folder for real-time changes").option("-i, --interval <ms>", "Polling interval in milliseconds", "5000").action(async (folder = "/", options) => {
2556
2911
  const intervalMs = parseInt(options.interval, 10) || 5e3;
2557
- console.log(chalk.bold.cyan(`
2912
+ console.log(chalk2.bold.cyan(`
2558
2913
  \u{1F440} Watching for changes in "${folder}" (polling every ${intervalMs / 1e3}s)...`));
2559
- console.log(chalk.dim("Press Ctrl+C to stop watching.\n"));
2914
+ console.log(chalk2.dim("Press Ctrl+C to stop watching.\n"));
2560
2915
  try {
2561
2916
  const client = await getClient(options);
2562
2917
  const watcher = await client.watch(folder === "/" ? void 0 : folder, { intervalMs });
2563
2918
  watcher.on("create", (e) => {
2564
- console.log(`${chalk.green("[CREATED]")} ${chalk.bold(e.file?.name || e.fileId)} ${chalk.dim(`(ID: ${e.fileId})`)}`);
2919
+ console.log(`${chalk2.green("[CREATED]")} ${chalk2.bold(e.file?.name || e.fileId)} ${chalk2.dim(`(ID: ${e.fileId})`)}`);
2565
2920
  });
2566
2921
  watcher.on("modify", (e) => {
2567
- console.log(`${chalk.yellow("[MODIFIED]")} ${chalk.bold(e.file?.name || e.fileId)} ${chalk.dim(`(ID: ${e.fileId})`)}`);
2922
+ console.log(`${chalk2.yellow("[MODIFIED]")} ${chalk2.bold(e.file?.name || e.fileId)} ${chalk2.dim(`(ID: ${e.fileId})`)}`);
2568
2923
  });
2569
2924
  watcher.on("delete", (e) => {
2570
- console.log(`${chalk.red("[DELETED]")} ${chalk.bold(e.file?.name || e.fileId)} ${chalk.dim(`(ID: ${e.fileId})`)}`);
2925
+ console.log(`${chalk2.red("[DELETED]")} ${chalk2.bold(e.file?.name || e.fileId)} ${chalk2.dim(`(ID: ${e.fileId})`)}`);
2571
2926
  });
2572
2927
  watcher.on("error", (err) => {
2573
- console.error(chalk.red(`[WATCHER ERROR] ${err.message}`));
2928
+ console.error(chalk2.red(`[WATCHER ERROR] ${err.message}`));
2574
2929
  });
2575
2930
  process.on("SIGINT", () => {
2576
2931
  watcher.stop();
2577
- console.log(chalk.yellow("\nWatcher stopped. Goodbye!"));
2932
+ console.log(chalk2.yellow("\nWatcher stopped. Goodbye!"));
2578
2933
  process.exit(0);
2579
2934
  });
2580
2935
  } catch (err) {
2581
- console.error(chalk.red(`Failed to start watcher: ${err.message}`));
2936
+ console.error(chalk2.red(`Failed to start watcher: ${err.message}`));
2582
2937
  process.exit(1);
2583
2938
  }
2584
2939
  });
2585
2940
  program.command("login").description("Interactive 1-click browser OAuth2 sign-in").requiredOption("--client-id <id>", "Google OAuth2 Client ID").requiredOption("--client-secret <secret>", "Google OAuth2 Client Secret").option("-p, --port <port>", "Local callback port", "3000").action(async (options) => {
2586
- console.log(chalk.bold.cyan("\n\u26A1 DriveKit Interactive Login"));
2941
+ console.log(chalk2.bold.cyan("\n\u26A1 DriveKit Interactive Login"));
2587
2942
  console.log("Opening your browser for one-click Google OAuth sign-in...\n");
2588
2943
  try {
2589
2944
  const { DriveKit: DriveKit2 } = await Promise.resolve().then(() => (init_client(), client_exports));
@@ -2592,17 +2947,17 @@ program.command("login").description("Interactive 1-click browser OAuth2 sign-in
2592
2947
  clientSecret: options.clientSecret,
2593
2948
  port: parseInt(options.port, 10) || 3e3
2594
2949
  });
2595
- console.log(chalk.bold.green("\n\u{1F389} Login successful!"));
2596
- console.log(`Access Token: ${chalk.cyan(result.tokens.access_token?.slice(0, 25) + "...")}`);
2950
+ console.log(chalk2.bold.green("\n\u{1F389} Login successful!"));
2951
+ console.log(`Access Token: ${chalk2.cyan(result.tokens.access_token?.slice(0, 25) + "...")}`);
2597
2952
  if (result.tokens.refresh_token) {
2598
- console.log(`Refresh Token: ${chalk.green(result.tokens.refresh_token?.slice(0, 25) + "...")}`);
2953
+ console.log(`Refresh Token: ${chalk2.green(result.tokens.refresh_token?.slice(0, 25) + "...")}`);
2599
2954
  }
2600
2955
  const outPath = path6.resolve("./gdrive-tokens.json");
2601
2956
  fs6.writeFileSync(outPath, JSON.stringify(result.tokens, null, 2), "utf8");
2602
- console.log(`\u{1F4BE} Saved tokens to: ${chalk.bold(outPath)}
2957
+ console.log(`\u{1F4BE} Saved tokens to: ${chalk2.bold(outPath)}
2603
2958
  `);
2604
2959
  } catch (err) {
2605
- console.error(chalk.red(`Login failed: ${err.message}`));
2960
+ console.error(chalk2.red(`Login failed: ${err.message}`));
2606
2961
  process.exit(1);
2607
2962
  }
2608
2963
  });