phewsh 0.11.9 → 0.11.10

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.
@@ -217,11 +217,12 @@ async function main() {
217
217
  console.log(` ${b(w('Welcome to PHEWSH.'))}`);
218
218
  console.log(` ${g('Your AI knows your project. No more re-explaining.')}`);
219
219
  console.log('');
220
- console.log(` ${w('To get started, you need an API key from one of these:')}`);
220
+ console.log(` ${w('To chat, you need an API key.')} ${g('(not a subscription)')}`);
221
+ console.log(` ${g('ChatGPT Plus / Claude Pro are separate — API keys are pay-as-you-go.')}`);
221
222
  console.log('');
222
223
  console.log(` ${cyan('1')} ${b('Anthropic')} ${g('(recommended)')}`);
223
224
  console.log(` ${g('console.anthropic.com/settings/keys')}`);
224
- console.log(` ${g('Direct access to Claude. Best quality.')}`);
225
+ console.log(` ${g('Direct access to Claude. Best quality. ~$0.01/message.')}`);
225
226
  console.log('');
226
227
  console.log(` ${cyan('2')} ${b('OpenRouter')}`);
227
228
  console.log(` ${g('openrouter.ai/keys')}`);
@@ -333,6 +334,7 @@ async function main() {
333
334
  ${g('/model')} ${d('<name>')} Switch model (sonnet, opus, haiku)
334
335
  ${g('/models')} List available models
335
336
  ${g('/provider')} Show current provider info
337
+ ${g('/update')} Update phewsh to the latest version
336
338
 
337
339
  ${w('debug')}
338
340
  ${g('/system')} Show current system prompt
@@ -647,6 +649,31 @@ async function main() {
647
649
  return;
648
650
  }
649
651
 
652
+ if (cmd === 'update' || cmd === 'upgrade') {
653
+ console.log(`\n ${g('Checking for updates...')}`);
654
+ try {
655
+ const pkg = require('../../package.json');
656
+ const res = await fetch(`https://registry.npmjs.org/${pkg.name}/latest`, { signal: AbortSignal.timeout(5000) });
657
+ const data = await res.json();
658
+ if (!data.version || data.version === pkg.version) {
659
+ console.log(` ${green('●')} Already on the latest version (${pkg.version})\n`);
660
+ rl.prompt();
661
+ return;
662
+ }
663
+ console.log(` ${cyan(pkg.version)} → ${cyan(data.version)}`);
664
+ console.log(` ${g('Installing...')}\n`);
665
+ const { execSync } = require('child_process');
666
+ execSync(`npm install -g ${pkg.name}@latest`, { stdio: 'inherit' });
667
+ console.log(`\n ${green('●')} Updated to ${data.version}`);
668
+ console.log(` ${g('Restart phewsh to use the new version.')}\n`);
669
+ } catch (err) {
670
+ console.log(` ${yellow('!')} Update failed: ${err.message}`);
671
+ console.log(` ${g('You can update manually:')} npm install -g phewsh\n`);
672
+ }
673
+ rl.prompt();
674
+ return;
675
+ }
676
+
650
677
  if (cmd === 'run') {
651
678
  if (!cmdArg) {
652
679
  console.log(` ${g('Usage:')} /run <prompt>`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phewsh",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "description": "Turn intent into action. Structure your thinking, execute your next step.",
5
5
  "bin": {
6
6
  "phewsh": "bin/phewsh.js"