@pollinations/cli 0.1.75 → 0.1.76
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/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var init_package = __esm({
|
|
|
14
14
|
"package.json"() {
|
|
15
15
|
package_default = {
|
|
16
16
|
name: "@pollinations/cli",
|
|
17
|
-
version: "0.1.
|
|
17
|
+
version: "0.1.76",
|
|
18
18
|
description: "The Pollinations CLI \u2014 for humans, AI agents, and everything in between",
|
|
19
19
|
type: "module",
|
|
20
20
|
bin: {
|
|
@@ -386,6 +386,9 @@ __export(auth_exports, {
|
|
|
386
386
|
whoamiCommand: () => whoamiCommand
|
|
387
387
|
});
|
|
388
388
|
import { Command as Command2, Option } from "commander";
|
|
389
|
+
function profileName(profile) {
|
|
390
|
+
return profile.githubUsername ?? profile.name ?? "unknown";
|
|
391
|
+
}
|
|
389
392
|
async function pollForToken(deviceCode, interval, expiresIn) {
|
|
390
393
|
const deadline = Date.now() + expiresIn * 1e3;
|
|
391
394
|
const pollMs = Math.max(interval, 5) * 1e3;
|
|
@@ -453,7 +456,7 @@ async function fetchProfileLabel(key) {
|
|
|
453
456
|
apiKey: key
|
|
454
457
|
}).catch(() => null);
|
|
455
458
|
if (!profile) return null;
|
|
456
|
-
return `Logged in as ${profile
|
|
459
|
+
return `Logged in as ${profileName(profile)}`;
|
|
457
460
|
}
|
|
458
461
|
async function loginWithDeviceFlow(opts = {}) {
|
|
459
462
|
printInfo("Requesting device code...");
|
|
@@ -559,7 +562,7 @@ async function showAuthStatus() {
|
|
|
559
562
|
printResult({
|
|
560
563
|
authenticated: true,
|
|
561
564
|
key: masked,
|
|
562
|
-
name: profile
|
|
565
|
+
name: profileName(profile),
|
|
563
566
|
pollen: wallet ?? "unknown",
|
|
564
567
|
key_budget: balance?.balance !== wallet ? balance?.balance : void 0
|
|
565
568
|
});
|