wormclaude 1.0.2 → 1.0.3

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/dist/auth.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import * as fs from 'node:fs';
3
3
  import * as path from 'node:path';
4
4
  import * as os from 'node:os';
5
+ import * as readline from 'node:readline';
5
6
  import { spawn } from 'node:child_process';
6
7
  export const CONFIG_DIR = path.join(os.homedir(), '.wormclaude');
7
8
  export const CONFIG_PATH = path.join(CONFIG_DIR, 'config.json');
@@ -93,6 +94,20 @@ export function runUpdate() {
93
94
  child.on('exit', () => resolve());
94
95
  });
95
96
  }
97
+ // Giriş yapılmamışken `wormclaude` çalışınca gösterilen menü.
98
+ // 1 → giriş yap, diğer her şey → çıkış.
99
+ export function promptLoginMenu() {
100
+ return new Promise((resolve) => {
101
+ process.stdout.write('\n \x1b[1mWormClaude\x1b[0m\n\n');
102
+ process.stdout.write(' 1) Giriş yap\n');
103
+ process.stdout.write(' 2) Çıkış\n\n');
104
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
105
+ rl.question(' Seçim (1/2): ', (ans) => {
106
+ rl.close();
107
+ resolve((ans || '').trim() === '1' ? 'login' : 'exit');
108
+ });
109
+ });
110
+ }
96
111
  export async function deviceLogin() {
97
112
  const base = process.env.WORMCLAUDE_BASE_URL || loadStored().baseUrl || DEFAULT_BASE_URL;
98
113
  const origin = apiOrigin(base);
package/dist/cli.js CHANGED
@@ -40,8 +40,17 @@ if (_arg === 'login' || _arg === 'logout' || _arg === 'whoami' || _arg === '--ve
40
40
  }
41
41
  const config = loadConfig();
42
42
  if (!config.apiKey) {
43
- process.stdout.write('\nWormClaude\'a hos geldiniz!\n\nKullanmadan once giris yapin:\n wormclaude login\n\n');
44
- process.exit(0);
43
+ const _a = await import('./auth.js');
44
+ const _choice = await _a.promptLoginMenu();
45
+ if (_choice !== 'login')
46
+ process.exit(0);
47
+ await _a.deviceLogin();
48
+ const _fresh = loadConfig();
49
+ config.apiKey = _fresh.apiKey;
50
+ config.baseUrl = _fresh.baseUrl;
51
+ config.model = _fresh.model;
52
+ if (!config.apiKey)
53
+ process.exit(0);
45
54
  }
46
55
  let _updateLatest = null;
47
56
  import('./auth.js').then((a) => a.checkForUpdate(VERSION)).then((v) => { _updateLatest = v; }).catch(() => { });
package/dist/theme.js CHANGED
@@ -8,4 +8,4 @@ export const theme = {
8
8
  green: '#4ade80',
9
9
  errorRed: '#ff6b6b',
10
10
  };
11
- export const VERSION = '1.0.2';
11
+ export const VERSION = '1.0.3';
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {
7
- "wormclaude": "./dist/cli.js"
7
+ "wormclaude": "dist/cli.js"
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "tsx src/cli.tsx",