@vibetasks/cli 0.4.2 → 0.4.4

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.
Files changed (2) hide show
  1. package/dist/bin/vibetasks.js +113 -25
  2. package/package.json +1 -1
@@ -351,33 +351,46 @@ async function getAvailablePort(startPort = 3737) {
351
351
  }
352
352
 
353
353
  // src/commands/login.ts
354
- var loginCommand = new Command("login").description("Authenticate with TaskFlow").option("-b, --browser", "Login via browser (recommended)").action(async (options) => {
354
+ var loginCommand = new Command("login").description("Authenticate with TaskFlow").option("-b, --browser", "Login via browser (recommended)").option("-e, --email <email>", "Email for non-interactive login").option("-p, --password <password>", "Password for non-interactive login").action(async (options) => {
355
355
  if (options.browser) {
356
356
  await loginWithBrowser();
357
357
  return;
358
358
  }
359
- console.log(chalk2.blue.bold("\n\u{1F510} TaskFlow Login\n"));
360
- const answers = await inquirer.prompt([
361
- {
362
- type: "input",
363
- name: "email",
364
- message: "Email:",
365
- validate: (input) => {
366
- if (!input.includes("@")) return "Please enter a valid email address";
367
- return true;
368
- }
369
- },
370
- {
371
- type: "password",
372
- name: "password",
373
- message: "Password:",
374
- mask: "*",
375
- validate: (input) => {
376
- if (input.length < 6) return "Password must be at least 6 characters";
377
- return true;
359
+ let email = options.email;
360
+ let password = options.password;
361
+ if (email && password) {
362
+ console.log(chalk2.blue.bold("\nVibeTasks Login\n"));
363
+ } else if (!process.stdin.isTTY) {
364
+ console.log(chalk2.red("Error: Non-interactive environment requires --email and --password flags"));
365
+ console.log(chalk2.gray("\nUsage: vibetasks login --email you@example.com --password yourpassword"));
366
+ console.log(chalk2.gray(" Or: vibetasks login --browser (opens browser for OAuth)"));
367
+ process.exit(1);
368
+ } else {
369
+ console.log(chalk2.blue.bold("\nVibeTasks Login\n"));
370
+ const answers = await inquirer.prompt([
371
+ {
372
+ type: "input",
373
+ name: "email",
374
+ message: "Email:",
375
+ validate: (input) => {
376
+ if (!input.includes("@")) return "Please enter a valid email address";
377
+ return true;
378
+ }
379
+ },
380
+ {
381
+ type: "password",
382
+ name: "password",
383
+ message: "Password:",
384
+ mask: "*",
385
+ validate: (input) => {
386
+ if (input.length < 6) return "Password must be at least 6 characters";
387
+ return true;
388
+ }
378
389
  }
379
- }
380
- ]);
390
+ ]);
391
+ email = answers.email;
392
+ password = answers.password;
393
+ }
381
394
  const spinner = ora2("Authenticating...").start();
382
395
  try {
383
396
  const authManager = new AuthManager2();
@@ -390,8 +403,8 @@ var loginCommand = new Command("login").description("Authenticate with TaskFlow"
390
403
  supabaseKey
391
404
  });
392
405
  const { data, error } = await supabase.auth.signInWithPassword({
393
- email: answers.email,
394
- password: answers.password
406
+ email,
407
+ password
395
408
  });
396
409
  if (error) throw error;
397
410
  if (!data.session) {
@@ -1798,7 +1811,82 @@ function getErrorHtml(message) {
1798
1811
  </body>
1799
1812
  </html>`;
1800
1813
  }
1801
- var setupCommand = new Command12("setup").description("Interactive setup wizard for VibeTasks").option("--skip-auth", "Skip authentication step").option("--skip-claude", "Skip Claude Code configuration").option("--skip-project", "Skip project initialization").option("--skip-verify", "Skip verification step").action(async (options) => {
1814
+ async function runNonInteractiveSetup() {
1815
+ console.log(chalk13.bold.magenta("\n\u2501\u2501\u2501 VibeTasks Auto Setup \u2501\u2501\u2501\n"));
1816
+ console.log(chalk13.gray("Checking authentication..."));
1817
+ const existing = await checkExistingAuth();
1818
+ let authResult;
1819
+ if (existing.authenticated) {
1820
+ console.log(chalk13.green("\u2713") + ` Already authenticated as ${chalk13.cyan(existing.email)}`);
1821
+ authResult = { success: true, email: existing.email, skipped: true };
1822
+ } else {
1823
+ console.log(chalk13.yellow("\u26A0") + " Not authenticated");
1824
+ console.log(chalk13.gray(" Run: vibetasks login"));
1825
+ authResult = { success: false };
1826
+ }
1827
+ console.log(chalk13.gray("\nConfiguring Claude Code MCP server..."));
1828
+ const configPath = getClaudeConfigPath();
1829
+ const configDir = path2.dirname(configPath);
1830
+ try {
1831
+ await fs2.mkdir(configDir, { recursive: true });
1832
+ let config = {};
1833
+ try {
1834
+ const existingConfig = await fs2.readFile(configPath, "utf-8");
1835
+ config = JSON.parse(existingConfig);
1836
+ } catch {
1837
+ }
1838
+ if (!config.mcpServers) config.mcpServers = {};
1839
+ let mcpCommand = "vibetasks-mcp";
1840
+ let mcpArgs = [];
1841
+ try {
1842
+ if (process.platform === "win32") {
1843
+ await execAsync2("where vibetasks-mcp");
1844
+ } else {
1845
+ await execAsync2("which vibetasks-mcp");
1846
+ }
1847
+ } catch {
1848
+ mcpCommand = "npx";
1849
+ mcpArgs = ["@vibetasks/mcp-server"];
1850
+ }
1851
+ config.mcpServers.vibetasks = {
1852
+ command: mcpCommand,
1853
+ ...mcpArgs.length > 0 && { args: mcpArgs }
1854
+ };
1855
+ await fs2.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
1856
+ console.log(chalk13.green("\u2713") + " MCP server configured");
1857
+ console.log(chalk13.gray(` Config: ${configPath}`));
1858
+ } catch (error) {
1859
+ console.log(chalk13.red("\u2717") + ` Failed to configure: ${error.message}`);
1860
+ }
1861
+ if (authResult.success) {
1862
+ console.log(chalk13.gray("\nVerifying connection..."));
1863
+ try {
1864
+ const authManager = new AuthManager12();
1865
+ const taskOps = await TaskOperations8.fromAuthManager(authManager);
1866
+ const tasks = await taskOps.getTasks("all");
1867
+ console.log(chalk13.green("\u2713") + ` Connected (${tasks.length} tasks)`);
1868
+ } catch (error) {
1869
+ console.log(chalk13.yellow("\u26A0") + ` Connection test failed: ${error.message}`);
1870
+ }
1871
+ }
1872
+ console.log(chalk13.bold.green("\n\u2501\u2501\u2501 Setup Complete \u2501\u2501\u2501\n"));
1873
+ if (!authResult.success) {
1874
+ console.log(chalk13.yellow('Next step: Run "vibetasks login" to authenticate\n'));
1875
+ } else {
1876
+ console.log(chalk13.yellow("\u26A1 Restart Claude Code to activate MCP server\n"));
1877
+ }
1878
+ console.log(chalk13.gray("Available commands:"));
1879
+ console.log(chalk13.cyan(' vibetasks add "task title"') + chalk13.gray(" - Create a task"));
1880
+ console.log(chalk13.cyan(" vibetasks list") + chalk13.gray(" - Show tasks"));
1881
+ console.log(chalk13.cyan(" vibetasks login") + chalk13.gray(" - Authenticate"));
1882
+ console.log("");
1883
+ }
1884
+ var setupCommand = new Command12("setup").description("Interactive setup wizard for VibeTasks").option("--skip-auth", "Skip authentication step").option("--skip-claude", "Skip Claude Code configuration").option("--skip-project", "Skip project initialization").option("--skip-verify", "Skip verification step").option("--auto", "Non-interactive mode (for CI/automation)").option("--non-interactive", "Alias for --auto").action(async (options) => {
1885
+ const isNonInteractive = options.auto || options.nonInteractive || !process.stdin.isTTY;
1886
+ if (isNonInteractive) {
1887
+ await runNonInteractiveSetup();
1888
+ process.exit(0);
1889
+ }
1802
1890
  showWelcome();
1803
1891
  const { proceed } = await inquirer5.prompt([{
1804
1892
  type: "confirm",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibetasks/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "VibeTasks CLI - Lightning-fast task management from your terminal. Works with Claude Code, Cursor, and all AI coding tools.",
5
5
  "author": "Vyas",
6
6
  "license": "MIT",