fix(cliproxy): resolve windows auth browser not opening

- skip TTY check on Windows (process.stdin.isTTY returns undefined)
- Windows desktop environments always have browser capability
- also fix help-command version to read from package.json

Closes #42
This commit is contained in:
kaitranntt
2025-12-02 21:10:38 -05:00
parent 9f40a0e255
commit af4d6cff89
2 changed files with 10 additions and 4 deletions
+4 -2
View File
@@ -94,8 +94,10 @@ function isHeadlessEnvironment(): boolean {
return true;
}
// Non-interactive (piped stdin)
if (!process.stdin.isTTY) {
// Non-interactive (piped stdin) - skip on Windows
// Windows npm wrappers don't set isTTY correctly (returns undefined, not true)
// Windows desktop environments always have browser capability
if (process.platform !== 'win32' && !process.stdin.isTTY) {
return true;
}
+6 -2
View File
@@ -1,7 +1,11 @@
import * as fs from 'fs';
import * as path from 'path';
import { initUI, box, color, dim, sectionHeader, subheader } from '../utils/ui';
// Version is read from VERSION file during build
const VERSION = '5.3.0';
// Get version from package.json (same as version-command.ts)
const VERSION = JSON.parse(
fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8')
).version;
/**
* Print a major section with ═══ borders (only for 3 main sections)