@inetafrica/open-claudia 1.0.0 → 1.0.1
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/package.json +1 -1
- package/setup.js +17 -0
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -230,6 +230,23 @@ async function main() {
|
|
|
230
230
|
}
|
|
231
231
|
console.log(` Claude CLI: ${claudePath}`);
|
|
232
232
|
|
|
233
|
+
// Check if Claude is authenticated
|
|
234
|
+
try {
|
|
235
|
+
const authCheck = execSync(`"${claudePath}" -p "say ok" --max-budget-usd 0.01 --output-format text 2>&1`, {
|
|
236
|
+
encoding: "utf-8", timeout: 30000,
|
|
237
|
+
});
|
|
238
|
+
console.log(" Claude auth: OK");
|
|
239
|
+
} catch (e) {
|
|
240
|
+
const errMsg = (e.stderr || e.stdout || e.message || "").toLowerCase();
|
|
241
|
+
if (errMsg.includes("auth") || errMsg.includes("login") || errMsg.includes("api key") || errMsg.includes("unauthorized")) {
|
|
242
|
+
console.log(" Claude auth: NOT LOGGED IN");
|
|
243
|
+
console.log(" Run 'claude auth' or 'claude login' to authenticate first.");
|
|
244
|
+
process.exit(1);
|
|
245
|
+
}
|
|
246
|
+
// Other errors (like budget exceeded) mean auth is fine
|
|
247
|
+
console.log(" Claude auth: OK");
|
|
248
|
+
}
|
|
249
|
+
|
|
233
250
|
const platform = detectPlatform();
|
|
234
251
|
console.log(` Platform: ${platform}`);
|
|
235
252
|
|