@vibetasks/cli 0.5.4 → 0.5.6
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 +10 -4
- package/package.json +1 -1
package/dist/bin/vibetasks.js
CHANGED
|
@@ -45,7 +45,12 @@ ${url}
|
|
|
45
45
|
`));
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
function getAuthBaseUrl() {
|
|
48
|
+
async function getAuthBaseUrl() {
|
|
49
|
+
const authManager = new AuthManager();
|
|
50
|
+
const configUrl = await authManager.getConfig("auth-url");
|
|
51
|
+
if (configUrl) {
|
|
52
|
+
return String(configUrl);
|
|
53
|
+
}
|
|
49
54
|
if (process.env.VIBETASKS_AUTH_URL) {
|
|
50
55
|
return process.env.VIBETASKS_AUTH_URL;
|
|
51
56
|
}
|
|
@@ -58,6 +63,7 @@ async function loginWithBrowser() {
|
|
|
58
63
|
console.log(chalk.blue.bold("\n\u{1F510} VibeTasks Browser Login\n"));
|
|
59
64
|
const spinner = ora("Starting local server...").start();
|
|
60
65
|
const port = await getAvailablePort();
|
|
66
|
+
const baseUrl = await getAuthBaseUrl();
|
|
61
67
|
return new Promise((resolve, reject) => {
|
|
62
68
|
let timeoutId = null;
|
|
63
69
|
const server = createServer(async (req, res) => {
|
|
@@ -258,7 +264,7 @@ async function loginWithBrowser() {
|
|
|
258
264
|
</p>
|
|
259
265
|
<div class="success-badge">Ready to use</div>
|
|
260
266
|
<div class="button-group">
|
|
261
|
-
<a href="
|
|
267
|
+
<a href="${baseUrl}/settings?tab=ai" class="button button-primary">Setup AI Integration</a>
|
|
262
268
|
<button onclick="window.close()" class="button button-secondary">Close Window</button>
|
|
263
269
|
</div>
|
|
264
270
|
</div>
|
|
@@ -314,7 +320,6 @@ Error: ${error.message}`));
|
|
|
314
320
|
});
|
|
315
321
|
server.listen(port, async () => {
|
|
316
322
|
spinner.text = "Opening browser...";
|
|
317
|
-
const baseUrl = getAuthBaseUrl();
|
|
318
323
|
const authUrl = `${baseUrl}/cli-auth?port=${port}`;
|
|
319
324
|
spinner.text = "Waiting for authentication in browser...";
|
|
320
325
|
console.log(chalk.gray(`
|
|
@@ -363,6 +368,7 @@ async function getAvailablePort(startPort = 3737) {
|
|
|
363
368
|
var loginCommand = new Command("login").description("Authenticate with VibeTasks via browser (Google OAuth)").option("-b, --browser", "Login via browser (default)").action(async () => {
|
|
364
369
|
console.log(chalk2.blue.bold("\n\u{1F510} VibeTasks Login\n"));
|
|
365
370
|
console.log(chalk2.gray("Opening browser for Google sign-in...\n"));
|
|
371
|
+
console.log(chalk2.gray("Tip: For local development, run: vibetasks config auth-url http://localhost:3847\n"));
|
|
366
372
|
await loginWithBrowser();
|
|
367
373
|
});
|
|
368
374
|
|
|
@@ -1754,7 +1760,7 @@ async function runBrowserAuth() {
|
|
|
1754
1760
|
res.end();
|
|
1755
1761
|
});
|
|
1756
1762
|
server.listen(port, async () => {
|
|
1757
|
-
const taskflowPort = process.env.TASKFLOW_WEB_PORT || "
|
|
1763
|
+
const taskflowPort = process.env.TASKFLOW_WEB_PORT || "3847";
|
|
1758
1764
|
const authUrl = `http://localhost:${taskflowPort}/cli-auth?port=${port}`;
|
|
1759
1765
|
console.log(chalk13.gray(`
|
|
1760
1766
|
If browser doesn't open, visit:`));
|
package/package.json
CHANGED