Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 8fefdb4

Browse files
greynewellclaude
andcommitted
fix: refine proactive installation and error handling
- Remove redundant 'Command failed' message in NPM postinstall - Use correct dashboard URL: https://dashboard.supermodeltools.com/api-keys/ - Provide explicit subscription guidance in 'status' next steps - Display hidden input prompt during 'auth login' Co-Authored-By: Grey Newell <greyshipscode@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b030526 commit 8fefdb4

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

cmd/auth.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ func authLoginHandler(cmd *cobra.Command, args []string) error {
100100
if err != nil {
101101
fmt.Println("✗")
102102
if strings.Contains(err.Error(), "402") {
103-
return fmt.Errorf("subscription required: visit %s to subscribe", config.DashboardURL)
103+
fmt.Println()
104+
fmt.Println("⚠️ SUBSCRIPTION REQUIRED")
105+
fmt.Println(" The API key is valid, but your account requires an active subscription.")
106+
fmt.Printf(" Please visit: %s\n", config.DashboardURL)
107+
fmt.Println()
108+
return fmt.Errorf("subscription required")
104109
}
105110
return fmt.Errorf("key validation failed: %w", err)
106111
}

npm/install.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,15 @@ async function main() {
212212
const authStatus = execSync(checkAuthCmd).toString();
213213
if (authStatus.includes("Status: not authenticated") || authStatus.includes("✗")) {
214214
log("\n[uncompact] Authentication required. Starting login flow...\n");
215-
try {
216-
// Use 'auth login' which opens browser AND prompts for key
217-
execFileSync(destPath, ["auth", "login"], { stdio: "inherit" });
218-
log("\n[uncompact] Login successful.\n");
219-
} catch (err) {
220-
log(`\n[uncompact] Login process exited: ${err.message}\n`);
221-
log("[uncompact] You can run it manually later: uncompact auth login\n");
222-
}
215+
try {
216+
// Use 'auth login' which opens browser AND prompts for key
217+
execFileSync(destPath, ["auth", "login"], { stdio: "inherit" });
218+
log("\n[uncompact] Login successful.\n");
219+
} catch (err) {
220+
// Command failed (e.g. invalid key, 402, or user cancelled)
221+
// We don't print the error message here because 'inherit' already showed it
222+
log("\n[uncompact] Login incomplete or failed. You can run it manually later: uncompact auth login\n");
223+
}
223224
}
224225
} catch (e) {}
225226
} else {

0 commit comments

Comments
 (0)