@vibetasks/cli 0.4.3 → 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.
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibetasks/cli",
3
- "version": "0.4.3",
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",