@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.
- package/dist/bin/vibetasks.js +37 -24
- package/package.json +1 -1
package/dist/bin/vibetasks.js
CHANGED
|
@@ -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
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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
|
|
394
|
-
password
|
|
406
|
+
email,
|
|
407
|
+
password
|
|
395
408
|
});
|
|
396
409
|
if (error) throw error;
|
|
397
410
|
if (!data.session) {
|
package/package.json
CHANGED