phewsh 0.13.0 → 0.13.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/commands/setup.js +22 -0
- package/package.json +1 -1
package/commands/setup.js
CHANGED
|
@@ -56,6 +56,28 @@ module.exports = async function setup() {
|
|
|
56
56
|
}
|
|
57
57
|
console.log('');
|
|
58
58
|
|
|
59
|
+
// Agent-run (no TTY): auto-configure instead of asking questions nobody
|
|
60
|
+
// can answer. Pick the first installed harness; humans can change it later.
|
|
61
|
+
if (!process.stdin.isTTY) {
|
|
62
|
+
if (installed.length > 0) {
|
|
63
|
+
config.defaultRoute = installed[0].id;
|
|
64
|
+
saveConfig(config);
|
|
65
|
+
console.log(` ${teal('●')} ${sage('Auto-configured (non-interactive): default route =')} ${cream(installed[0].label)} ${slate('— no API key needed')}`);
|
|
66
|
+
console.log(` ${slate('Change anytime: run `phewsh setup` in your own terminal, or /use inside a session.')}`);
|
|
67
|
+
} else if (config.apiKey) {
|
|
68
|
+
config.defaultRoute = 'api';
|
|
69
|
+
saveConfig(config);
|
|
70
|
+
console.log(` ${teal('●')} ${sage('Auto-configured: default route = API (existing key found)')}`);
|
|
71
|
+
} else {
|
|
72
|
+
console.log(` ${ember('!')} ${sage('Nothing to configure yet — no agent CLI installed and no API key.')}`);
|
|
73
|
+
console.log(` ${slate('Install Claude Code or Codex (or set a key), then rerun phewsh setup.')}`);
|
|
74
|
+
}
|
|
75
|
+
console.log('');
|
|
76
|
+
console.log(` ${sage('Start working:')} ${cream('phewsh')}`);
|
|
77
|
+
console.log('');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
59
81
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
60
82
|
|
|
61
83
|
// ── 2. Pick the default route ─────────────────────────
|