natureco-cli 5.20.4 → 5.22.0

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/bin/natureco.js CHANGED
@@ -1,1095 +1,1099 @@
1
- #!/usr/bin/env node
2
-
3
- const { Command } = require('commander');
4
- const chalk = require('chalk');
5
- const packageJson = require('../package.json');
6
- const login = require('../src/commands/login');
7
- const logout = require('../src/commands/logout');
8
- const bots = require('../src/commands/bots');
9
- const chat = require('../src/commands/chat');
10
- const help = require('../src/commands/help');
11
- const gateway = require('../src/commands/gateway');
12
- const init = require('../src/commands/init');
13
- const config = require('../src/commands/config');
14
- const ask = require('../src/commands/ask');
15
- const run = require('../src/commands/run');
16
- const signal = require('../src/commands/signal');
17
- const irc = require('../src/commands/irc');
18
- const mattermost = require('../src/commands/mattermost');
19
- const imessage = require('../src/commands/imessage');
20
- const sms = require('../src/commands/sms');
21
- const webhooks = require('../src/commands/webhooks');
22
- const bonjour = require('../src/commands/bonjour');
23
- const policy = require('../src/commands/policy');
24
- const voice = require('../src/commands/voice');
25
- const clickclack = require('../src/commands/clickclack');
26
- const adminRpc = require('../src/commands/admin-rpc');
27
- const ocPath = require('../src/commands/oc-path');
28
- const workboard = require('../src/commands/workboard');
29
- const threadOwnership = require('../src/commands/thread-ownership');
30
- const devicePair = require('../src/commands/device-pair');
31
- const openProse = require('../src/commands/open-prose');
32
- const vydra = require('../src/commands/vydra');
33
- // OpenClaw uyumlu komutlar
34
- const agent = require('../src/commands/agent');
35
- const approvals = require('../src/commands/approvals');
36
- const backup = require('../src/commands/backup');
37
- const audit = require('../src/commands/audit');
38
- const cost = require('../src/commands/cost');
39
- const naturehub = require('../src/commands/naturehub');
40
- const medium = require('../src/commands/medium');
41
- const seo = require('../src/commands/seo');
42
- const xp = require('../src/commands/xp');
43
- const team = require('../src/commands/team');
44
- const repl = require('../src/commands/repl');
45
- const capability = require('../src/commands/capability');
46
- const commitments = require('../src/commands/commitments');
47
- const completion = require('../src/commands/completion');
48
- const configure = require('../src/commands/configure');
49
- const crestodian = require('../src/commands/crestodian');
50
- const daemon = require('../src/commands/daemon');
51
- const devices = require('../src/commands/devices');
52
- const directory = require('../src/commands/directory');
53
- const dns = require('../src/commands/dns');
54
- const docs = require('../src/commands/docs');
55
- const execPolicy = require('../src/commands/exec-policy');
56
- const health = require('../src/commands/health');
57
- const infer = require('../src/commands/infer');
58
- const node = require('../src/commands/node');
59
- const nodes = require('../src/commands/nodes');
60
- const onboard = require('../src/commands/onboard');
61
- const proxy = require('../src/commands/proxy');
62
- const qr = require('../src/commands/qr');
63
- const sandbox = require('../src/commands/sandbox');
64
- const secrets = require('../src/commands/secrets');
65
- const system = require('../src/commands/system');
66
- const terminal = require('../src/commands/terminal');
67
- const transcripts = require('../src/commands/transcripts');
68
- const wiki = require('../src/commands/wiki');
69
- const browser = require('../src/commands/browser');
70
- const tools = require('../src/commands/tools');
71
-
72
- const program = new Command();
73
-
74
- program
75
- .name('natureco')
76
- .description('NatureCo AI Bot Terminal Interface')
77
- .version(packageJson.version);
78
-
79
- program.addHelpText('after', `
80
- ${chalk.yellow('🤖 AI & Chat')}
81
- ${chalk.cyan('chat')} AI sohbet başlat
82
- ${chalk.cyan('code')} Code agent — dosya oku, yaz, komut çalıştır
83
- ${chalk.cyan('ask')} Tek soru sor
84
- ${chalk.cyan('run')} Markdown script çalıştır
85
- ${chalk.cyan('bots')} Bot listesi
86
- ${chalk.cyan('agent')} One-shot agent (run|abort|tail|logs)
87
- ${chalk.cyan('agents')} Agent yönetimi (list|set|info|add|bindings|bind|unbind|set-identity)
88
- ${chalk.cyan('commitments')} Eylem taahhütleri (list|add|check|resolve|summary|pending|done)
89
- ${chalk.cyan('infer')} Yetenek/algılama (list|inspect|model|image|audio|tts|video|web|embedding|auth)
90
-
91
- ${chalk.yellow('⚙️ Kurulum & Ayarlar')}
92
- ${chalk.cyan('setup')} İlk kurulum (config|workspace|dirs|status)
93
- ${chalk.cyan('onboard')} Interaktif onboarding (gateway|auth|workspace|channels|skills|health|status)
94
- ${chalk.cyan('configure')} Interaktif yapılandırma (gateway|auth|channels|plugins|skills)
95
- ${chalk.cyan('login')} API key ile giriş
96
- ${chalk.cyan('logout')} Çıkış
97
- ${chalk.cyan('config')} Ayarlar (get|set|unset|list|file|schema|validate|backups|restore)
98
- ${chalk.cyan('doctor')} Sistem teşhis (run|list|check)
99
- ${chalk.cyan('update')} Güncelleme (run|status|wizard)
100
- ${chalk.cyan('init')} Proje başlatma
101
- ${chalk.cyan('completion')} Shell completion (bash|zsh|fish)
102
-
103
- ${chalk.yellow('🔌 Entegrasyonlar')}
104
- ${chalk.cyan('telegram')} Telegram bağlantısı
105
- ${chalk.cyan('whatsapp')} WhatsApp bağlantısı
106
- ${chalk.cyan('discord')} Discord bağlantısı
107
- ${chalk.cyan('slack')} Slack bağlantısı
108
- ${chalk.cyan('signal')} Signal bağlantısı
109
- ${chalk.cyan('irc')} IRC bağlantısı
110
- ${chalk.cyan('mattermost')} Mattermost bağlantısı
111
- ${chalk.cyan('imessage')} iMessage bağlantısı
112
- ${chalk.cyan('sms')} SMS (Twilio) bağlantısı
113
- ${chalk.cyan('channels')} Kanal yönetimi (list|status|add|remove|logs|login|logout|capabilities|resolve)
114
- ${chalk.cyan('message')} Cross-channel mesaj (send|broadcast|poll|react|read|edit|delete|search|pin|thread|sticker|role|moderation|event|timeout|kick|ban)
115
- ${chalk.cyan('gateway')} WebSocket gateway (start|stop|status|call|usage-cost|probe|discover|install|uninstall|health|restart|diagnostics|run)
116
-
117
- ${chalk.yellow('💻 Geliştirici Araçları')}
118
- ${chalk.cyan('git')} Git entegrasyonu
119
- ${chalk.cyan('mcp')} MCP sunucuları (serve|list|show|set|unset)
120
- ${chalk.cyan('skills')} Skill yönetimi (list|install|remove|update|create|search|browse|info|check)
121
- ${chalk.cyan('hooks')} Hook yönetimi (list|info|check|enable|disable|install|update)
122
- ${chalk.cyan('cron')} Zamanlanmış görevler (add|list|remove|get|edit|enable|disable|runs|run)
123
- ${chalk.cyan('sessions')} Oturum yönetimi (list|show|cleanup|prune)
124
- ${chalk.cyan('ultrareview')} Detaylı kod inceleme
125
- ${chalk.cyan('transcripts')} Transcript yönetimi (list|show|path|delete)
126
- ${chalk.cyan('wiki')} Wiki vault (status|init|ingest|compile|lint|search|get|apply|doctor|bridge import|obsidian)
127
-
128
- ${chalk.yellow('📊 Yönetim & Sistem')}
129
- ${chalk.cyan('dashboard')} Web kontrol paneli (open|status|url)
130
- ${chalk.cyan('memory')} Hafıza yönetimi (status|list|search|show|clear|index|export|import|semantic|wiki)
131
- ${chalk.cyan('logs')} Log yönetimi (tail|show|search|clear|path)
132
- ${chalk.cyan('status')} Sistem durumu (run|simple|usage)
133
- ${chalk.cyan('plugins')} Plugin yönetimi (list|install|uninstall|enable|disable|info|update|search|doctor|registry|marketplace)
134
- ${chalk.cyan('security')} Güvenlik denetimi (audit)
135
- ${chalk.cyan('reset')} Sıfırlama (config|workspace|all|list)
136
- ${chalk.cyan('uninstall')} Kaldırma (run|dry-run)
137
- ${chalk.cyan('system')} Sistem durumu/heartbeat/presence (status|heartbeat|presence)
138
- ${chalk.cyan('health')} Servis sağlık kontrolü (run|list|check)
139
- ${chalk.cyan('backup')} Yedekleme (create|list|restore|verify)
140
- ${chalk.cyan('secrets')} Gizli değerler (list|set|get|unset|audit|reload|configure|apply)
141
- ${chalk.cyan('approvals')} Onay politikası (add|pending|approve|reject)
142
- ${chalk.cyan('exec-policy')} Exec politikası (show|preset|set)
143
- ${chalk.cyan('workboard')} Görev/pano yönetimi
144
-
145
- ${chalk.yellow('🛰️ Ağ & Cihaz')}
146
- ${chalk.cyan('bonjour')} keşfi ve servis tarama
147
- ${chalk.cyan('dns')} Ağ keşfi — DNS (discover|resolve|setup)
148
- ${chalk.cyan('directory')} Dizin sorgulama (self|peers|search|register|remove)
149
- ${chalk.cyan('policy')} Workspace uyumluluk politikası
150
- ${chalk.cyan('voice')} Sesli sohbet yapılandırması
151
- ${chalk.cyan('clickclack')} Bildirim/beep kanalı
152
- ${chalk.cyan('admin-rpc')} HTTP admin RPC endpoint
153
- ${chalk.cyan('oc-path')} nc:// URI path handler
154
- ${chalk.cyan('thread-ownership')} Slack thread koordinasyonu
155
- ${chalk.cyan('device-pair')} Cihaz eşleştirme (QR kod)
156
- ${chalk.cyan('devices')} Cihaz yönetimi (list|pair|unpair|token|regenerate-token|rotate|revoke|clear)
157
- ${chalk.cyan('qr')} QR kod ile eşleştirme
158
- ${chalk.cyan('pairing')} Cihaz eşleştirme (list|approve|reject|generate)
159
-
160
- ${chalk.yellow('🔧 Altyapı')}
161
- ${chalk.cyan('daemon')} Gateway daemon (status|start|stop|restart)
162
- ${chalk.cyan('node')} Node host (run|status|install|uninstall|stop|restart)
163
- ${chalk.cyan('nodes')} Node network (list|pending|approve|reject|remove|rename|status|describe|invoke|notify|push|canvas|camera|screen|location)
164
- ${chalk.cyan('proxy')} Debug proxy (start|stop|status|run|coverage|sessions|query|blob|purge)
165
- ${chalk.cyan('sandbox')} Sandbox container (list|recreate|explain)
166
- ${chalk.cyan('capability')} Yetenek sorgulama (list|inspect)
167
- ${chalk.cyan('acp')} ACP endpoint (status|info)
168
- ${chalk.cyan('tui')} Terminal UI (start|local|status)
169
- ${chalk.cyan('path')} nc:// URI path yönetimi (resolve|find|set|validate|emit)
170
- ${chalk.cyan('clawbot')} Legacy clawbot (qr)
171
-
172
- ${chalk.yellow('📦 Medya & İçerik')}
173
- ${chalk.cyan('open-prose')} Prose skills bundle
174
- ${chalk.cyan('vydra')} Vydra medya sağlayıcı
175
- ${chalk.cyan('docs')} Dokümantasyon arama
176
- ${chalk.cyan('browser')} Browser automation (status|start|stop|tabs|open|close|navigate|screenshot|snapshot|click|type|press|resize|hover|drag|select|upload|fill|dialog|wait|evaluate|console|pdf|profiles|focus|reset-profile|create-profile|delete-profile)
177
-
178
- ${chalk.yellow('Örnekler:')}
179
- ${chalk.gray('$ natureco setup')} İlk kurulum
180
- ${chalk.gray('$ natureco onbord')} Onboarding
181
- ${chalk.gray('$ natureco chat')} Sohbet başlat
182
- ${chalk.gray('$ natureco code')} Code agent
183
- ${chalk.gray('$ natureco doctor')} Sistem kontrolü
184
- ${chalk.gray('$ natureco agent run "dosya oku"')} One-shot agent
185
- ${chalk.gray('$ natureco completion bash')} Shell completion
186
- `);
187
-
188
- program
189
- .command('login')
190
- .description('Login with your NatureCo API key')
191
- .action(login);
192
-
193
- program
194
- .command('setup [action]')
195
- .description('Run initial setup wizard (wizard|config|workspace|dirs|status)')
196
- .action(async (action) => {
197
- const setup = require('../src/commands/setup');
198
- await setup(action ? [action] : []);
199
- });
200
-
201
- program
202
- .command('logout')
203
- .description('Logout and remove stored credentials')
204
- .action(logout);
205
-
206
- program
207
- .command('bots')
208
- .description('List your AI bots')
209
- .action(bots);
210
-
211
- program
212
- .command('chat [bot-name...]')
213
- .description('Start interactive chat with a bot (uses default bot if not specified)')
214
- .option('--resume [session-id]', 'Resume a previous session')
215
- .option('--continue', 'son oturumu devam ettir')
216
- .option('--list', 'geçmiş oturumları listele')
217
- .option('--no-stream', 'streaming devre dışı')
218
- .action((botNameParts, options) => {
219
- const botName = Array.isArray(botNameParts) ? botNameParts.join(' ') : botNameParts;
220
- chat(botName, options);
221
- });
222
-
223
- program
224
- .command('code [file]')
225
- .description('Agentic coding modu v5 — Claude Code alternative (47 tools, TUI, auto tool selection)')
226
- .option('--dir <path>', 'çalışma dizini', process.cwd())
227
- .option('--no-stream', 'streaming devre dışı')
228
- .option('--dry-run', 'değişiklikleri göster ama uygulama')
229
- .option('--legacy', 'v2.23 eski code agent kullan')
230
- .action((file, options) => {
231
- if (options.legacy) {
232
- const codeCmd = require('../src/commands/code');
233
- codeCmd(file, options);
234
- } else {
235
- const codeV5 = require('../src/commands/code_v5');
236
- codeV5(options.dir || (file ? path.dirname(path.resolve(file)) : null));
237
- }
238
- });
239
-
240
- program
241
- .command('init')
242
- .description('Initialize NatureCo project in current directory')
243
- .action(init);
244
-
245
- program
246
- .command('config <action> [key] [value...]')
247
- .description('Manage configuration (get|set|unset|list|file|schema|validate|backups|restore)')
248
- .action((action, key, value) => config([action, key, ...(value || [])]));
249
-
250
- program
251
- .command('skills [action] [params...]')
252
- .description('Manage skills (list|install|remove|update|create|search|browse|info|check)')
253
- .action((action, params) => {
254
- const skillsCmd = require('../src/commands/skills');
255
- skillsCmd([action, ...(params || [])]);
256
- });
257
-
258
- program
259
- .command('ask <question>')
260
- .description('Ask a single question to your default bot')
261
- .action(ask);
262
-
263
- program
264
- .command('run <script>')
265
- .description('Run a markdown script file')
266
- .action(run);
267
-
268
- program
269
- .command('mcp [action] [params...]')
270
- .description('Manage MCP servers (list|add|remove|test|enable|disable|templates)')
271
- .action((action, params) => {
272
- const mcpCmd = require('../src/commands/mcp');
273
- mcpCmd([action, ...(params || [])]);
274
- });
275
-
276
- program
277
- .command('update [action] [params...]')
278
- .description('Update management (run|status|wizard)')
279
- .action((action, params) => {
280
- const updateCmd = require('../src/commands/update');
281
- updateCmd([action, ...(params || [])]);
282
- });
283
-
284
- program
285
- .command('migrate')
286
- .description('Migrate from other CLI tools (openclaw, claude-code, hermes)')
287
- .option('--from <source>', 'Source CLI (openclaw, claude-code, hermes)', 'openclaw')
288
- .option('--openclaw-dir <path>', 'OpenClaw directory path (default: ~/.openclaw)')
289
- .action((options) => {
290
- const migrateCmd = require('../src/commands/migrate');
291
- migrateCmd(options);
292
- });
293
-
294
- program
295
- .command('commands [action] [params...]')
296
- .description('Manage custom commands (list|create)')
297
- .action((action, params) => {
298
- const commandsCmd = require('../src/commands/commands');
299
- commandsCmd(action, ...(params || []));
300
- });
301
-
302
- program
303
- .command('cron <action>')
304
- .option('--name <name>', 'Cron job adı')
305
- .option('--schedule <schedule>', 'Cron schedule (örnek: "0 9 * * *")')
306
- .option('--action <action>', 'Aksiyon: whatsapp veya telegram')
307
- .option('--target <target>', 'Hedef numara veya chat ID')
308
- .option('--prompt <prompt>', 'AI\'a gönderilecek prompt')
309
- .description('Cron job yönetimi (add|list|remove|get|edit|enable|disable|runs|run)')
310
- .action((action, options) => {
311
- const cronCmd = require('../src/commands/cron');
312
- cronCmd(action, options);
313
- });
314
-
315
- program
316
- .command('hooks [action] [params...]')
317
- .description('Manage hooks (list|info|check|enable|disable|install|update)')
318
- .action((action, params) => {
319
- const hooksCmd = require('../src/commands/hooks');
320
- hooksCmd([action, ...(params || [])]);
321
- });
322
-
323
- program
324
- .command('sessions [action] [params...]')
325
- .description('Session management (list|show|cleanup|prune)')
326
- .action((action, params) => {
327
- const sessionsCmd = require('../src/commands/sessions');
328
- sessionsCmd([action, ...(params || [])]);
329
- });
330
-
331
- program
332
- .command('git <action>')
333
- .description('Git integration (review|commit|pr|explain)')
334
- .action((action) => {
335
- const gitCmd = require('../src/commands/git');
336
- gitCmd(action);
337
- });
338
-
339
- program
340
- .command('tasks [action] [params...]')
341
- .description('Manage background tasks (list|show|cancel|audit|maintenance|flow|summary|notify)')
342
- .action((action, params) => {
343
- const tasksCmd = require('../src/commands/tasks');
344
- tasksCmd([action, ...(params || [])]);
345
- });
346
-
347
- program
348
- .command('gateway [action]')
349
- .description('WebSocket gateway (start|stop|status|call|usage-cost|probe|discover|install|uninstall|health|restart|diagnostics|run)')
350
- .action((action) => {
351
- if (action === 'stop' || action === 'status') {
352
- const gatewayServerCmd = require('../src/commands/gateway-server');
353
- gatewayServerCmd(action);
354
- } else {
355
- const args = process.argv.slice(3);
356
- gateway(...args);
357
- }
358
- });
359
-
360
- program
361
- .command('ultrareview [file]')
362
- .description('Ultra detailed code review')
363
- .action((file) => {
364
- const ultrareviewCmd = require('../src/commands/ultrareview');
365
- ultrareviewCmd(file);
366
- });
367
-
368
- program
369
- .command('discord <action>')
370
- .description('Discord integration (connect|disconnect|status)')
371
- .action((action) => {
372
- const discordCmd = require('../src/commands/discord');
373
- discordCmd(action);
374
- });
375
-
376
- program
377
- .command('slack <action>')
378
- .description('Slack integration (connect|disconnect|status)')
379
- .action((action) => {
380
- const slackCmd = require('../src/commands/slack');
381
- slackCmd(action);
382
- });
383
-
384
- program
385
- .command('whatsapp <action> [number]')
386
- .description('WhatsApp integration (connect|disconnect|status|allow)')
387
- .action((action, number) => {
388
- const whatsappCmd = require('../src/commands/whatsapp');
389
- whatsappCmd(action, number);
390
- });
391
-
392
- program
393
- .command('telegram <action> [chatId]')
394
- .description('Telegram integration (connect|disconnect|status|allow)')
395
- .action((action, chatId) => {
396
- const telegramCmd = require('../src/commands/telegram');
397
- telegramCmd(action, chatId);
398
- });
399
-
400
- program
401
- .command('signal <action>')
402
- .description('Signal integration (connect|disconnect|status)')
403
- .action((action) => {
404
- const signalCmd = require('../src/commands/signal');
405
- signalCmd(action);
406
- });
407
-
408
- program
409
- .command('irc <action>')
410
- .description('IRC integration (connect|disconnect|status)')
411
- .action((action) => {
412
- const ircCmd = require('../src/commands/irc');
413
- ircCmd(action);
414
- });
415
-
416
- program
417
- .command('mattermost <action>')
418
- .description('Mattermost integration (connect|disconnect|status)')
419
- .action((action) => {
420
- const mattermostCmd = require('../src/commands/mattermost');
421
- mattermostCmd(action);
422
- });
423
-
424
- program
425
- .command('imessage <action> [recipient] [message]')
426
- .description('iMessage integration (connect|disconnect|status|probe|send)')
427
- .action((action, recipient, message) => {
428
- const imessageCmd = require('../src/commands/imessage');
429
- imessageCmd(action, recipient, message);
430
- });
431
-
432
- program
433
- .command('sms <action>')
434
- .description('SMS/Twilio integration (connect|disconnect|status)')
435
- .action((action) => {
436
- const smsCmd = require('../src/commands/sms');
437
- smsCmd(action);
438
- });
439
-
440
- program
441
- .command('webhooks <action>')
442
- .description('Webhook management (list|gmail)')
443
- .action((action) => {
444
- const webhooksCmd = require('../src/commands/webhooks');
445
- webhooksCmd(process.argv.slice(3));
446
- });
447
-
448
- program
449
- .command('message [action]')
450
- .description('Unified cross-channel messaging (send|broadcast|poll|react|reactions|read|edit|delete|search|pin|unpin|pins|permissions|thread|emoji|sticker|role|channel|member|voice|event|timeout|kick|ban|moderation)')
451
- .action((action) => {
452
- const messageCmd = require('../src/commands/message');
453
- const args = process.argv.slice(3);
454
- messageCmd(args);
455
- });
456
-
457
- program
458
- .command('dashboard [action]')
459
- .description('Web Control UI (start|stop|status)')
460
- .action((action) => {
461
- const dashboardCmd = require('../src/commands/dashboard');
462
- dashboardCmd(action);
463
- });
464
-
465
- program
466
- .command('doctor')
467
- .description('System diagnostics and health check')
468
- .option('--fix', 'Automatically fix issues')
469
- .action((options) => {
470
- const doctorCmd = require('../src/commands/doctor');
471
- const args = process.argv.slice(3);
472
- doctorCmd(args);
473
- });
474
-
475
- program
476
- .command('channels [action] [params...]')
477
- .description('Manage connected channels (list|status|add|remove|logs|login|logout|capabilities|resolve)')
478
- .action((action, params) => {
479
- const channelsCmd = require('../src/commands/channels');
480
- channelsCmd([action, ...(params || [])]);
481
- });
482
-
483
- program
484
- .command('bonjour [action]')
485
- .description('Network discovery (scan|discover|status) — find NatureCo services on LAN')
486
- .action((action) => {
487
- const bonjourCmd = require('../src/commands/bonjour');
488
- const args = process.argv.slice(3);
489
- bonjourCmd(args);
490
- });
491
-
492
- program
493
- .command('policy [action]')
494
- .description('Workspace policy checks (check|set|list|remove)')
495
- .action((action) => {
496
- const policyCmd = require('../src/commands/policy');
497
- const args = process.argv.slice(3);
498
- policyCmd(args);
499
- });
500
-
501
- program
502
- .command('voice [action]')
503
- .description('Voice configuration (status|providers|set) — manage TTS voice settings')
504
- .action((action) => {
505
- const voiceCmd = require('../src/commands/voice');
506
- const args = process.argv.slice(3);
507
- voiceCmd(args);
508
- });
509
-
510
- program
511
- .command('clickclack [action]')
512
- .description('ClickClack notification channel (status|test|enable|disable|listen|notify)')
513
- .action((action) => {
514
- const clickclackCmd = require('../src/commands/clickclack');
515
- const args = process.argv.slice(3);
516
- clickclackCmd(args);
517
- });
518
-
519
- program
520
- .command('admin-rpc [action]')
521
- .description('Admin HTTP RPC server (status|start|stop|call|methods)')
522
- .action((action) => {
523
- const args = process.argv.slice(3);
524
- adminRpc(args);
525
- });
526
-
527
- program
528
- .command('oc-path [action]')
529
- .description('nc:// URI path handler (resolve|list|cat|ls)')
530
- .action((action) => {
531
- const args = process.argv.slice(3);
532
- ocPath(args);
533
- });
534
-
535
- program
536
- .command('workboard [action]')
537
- .description('Work board (show|add|move|remove|clear|columns|export|import)')
538
- .action((action) => {
539
- const args = process.argv.slice(3);
540
- workboard(args);
541
- });
542
-
543
- program
544
- .command('thread-ownership [action]')
545
- .description('Thread ownership (status|list|assign|release|check|agent)')
546
- .action((action) => {
547
- const args = process.argv.slice(3);
548
- threadOwnership(args);
549
- });
550
-
551
- program
552
- .command('device-pair [action]')
553
- .description('Device pairing (list|request|approve|reject|remove|pairing-code|verify)')
554
- .action((action) => {
555
- const args = process.argv.slice(3);
556
- devicePair(args);
557
- });
558
-
559
- program
560
- .command('open-prose [action]')
561
- .description('OpenProse skills bundle (list|info)')
562
- .action((action) => {
563
- const args = process.argv.slice(3);
564
- openProse(args);
565
- });
566
-
567
- program
568
- .command('vydra [action]')
569
- .description('Vydra media provider (status|configure|test)')
570
- .action((action) => {
571
- const args = process.argv.slice(3);
572
- vydra(args);
573
- });
574
-
575
- program
576
- .command('models [action] [params...]')
577
- .description('Manage AI models (list|set|scan|aliases|fallbacks|set-image|image-fallbacks)')
578
- .allowUnknownOption()
579
- .action((action, params) => {
580
- const modelsCmd = require('../src/commands/models');
581
- const allArgs = process.argv.slice(process.argv.indexOf('models') + 1);
582
- modelsCmd(allArgs);
583
- });
584
-
585
- program
586
- .command('audit [action] [params...]')
587
- .description('Audit log görüntüleyici (today|stats|show|search|files|cleanup|tail)')
588
- .action((action, params) => {
589
- audit(action ? [action, ...(params || [])] : ['today']);
590
- });
591
-
592
- program
593
- .command('cost [action] [params...]')
594
- .description('Maliyet takibi (today|week|month|all|budget|set|model|prices)')
595
- .action((action, params) => {
596
- cost(action ? [action, ...(params || [])] : ['today']);
597
- });
598
-
599
- program
600
- .command('naturehub [action] [params...]')
601
- .description('Nature Hub\'a içerik yayınla (post|dm|inbox|robot-house|forum|list|info|config)')
602
- .action((action, params) => {
603
- naturehub(action ? [action, ...(params || [])] : []);
604
- });
605
-
606
- program
607
- .command('medium [action] [params...]')
608
- .description('Medium makale yayınla (draft|publish|list)')
609
- .action((action, params) => {
610
- medium(action ? [action, ...(params || [])] : []);
611
- });
612
-
613
- program
614
- .command('seo [action] [params...]')
615
- .description('SEO analizi (audit|meta|speed)')
616
- .action((action, params) => {
617
- seo(action ? [action, ...(params || [])] : []);
618
- });
619
-
620
- program
621
- .command('xp [action]')
622
- .description('NatureCo XP/Level sistemi')
623
- .action((action) => {
624
- xp(action ? [action] : []);
625
- });
626
-
627
- program
628
- .command('tools [action] [name]')
629
- .description('Tool registry (list|enable|disable)')
630
- .action((action, name) => {
631
- tools(action ? [action, name].filter(Boolean) : []);
632
- });
633
-
634
- program
635
- .command('team [action] [params...]')
636
- .description('Multi-agent orkestrasyon (list|status|spawn|parallel)')
637
- .action((action, params) => {
638
- team(action ? [action, ...(params || [])] : []);
639
- });
640
-
641
- program
642
- .command('repl [options...]')
643
- .description('İnteraktif REPL — bizim bu konuşmamız gibi sohbet modu')
644
- .option('--resume [id]', 'Önceki oturumu yükle')
645
- .action((options) => {
646
- const resumeOpt = options.resume ? [options.resume === true ? 'last' : options.resume] : [];
647
- repl(options._args || resumeOpt);
648
- });
649
-
650
- program
651
- .command('memory [action] [params...]')
652
- .description('Manage memory (status|list|search|show|clear|index|export|import|semantic|wiki)')
653
- .action((action, params) => {
654
- const memoryCmd = require('../src/commands/memory-cmd');
655
- memoryCmd([action, ...(params || [])]);
656
- });
657
-
658
- program
659
- .command('logs [action] [params...]')
660
- .description('View and manage logs (tail|show|search|clear|path)')
661
- .action((action, params) => {
662
- const logsCmd = require('../src/commands/logs');
663
- logsCmd([action, ...(params || [])]);
664
- });
665
-
666
- program
667
- .command('status [action] [params...]')
668
- .description('Show system status (run|simple|usage)')
669
- .action((action, params) => {
670
- const statusCmd = require('../src/commands/status');
671
- statusCmd([action, ...(params || [])]);
672
- });
673
-
674
- program
675
- .command('reset')
676
- .description('Reset local config/state')
677
- .option('--scope <scope>', 'Scope: config|memory|sessions|full', 'config')
678
- .option('--yes, -y', 'Skip confirmation')
679
- .action(() => {
680
- const resetModule = require('../src/commands/reset');
681
- const resetFn = resetModule.reset || resetModule;
682
- resetFn(process.argv.slice(3));
683
- });
684
-
685
- program
686
- .command('security [action]')
687
- .description('Security audit (audit)')
688
- .option('--fix', 'Auto-fix issues')
689
- .option('--json', 'JSON output')
690
- .action((action) => {
691
- const securityCmd = require('../src/commands/security');
692
- securityCmd(process.argv.slice(3));
693
- });
694
-
695
- program
696
- .command('agents [action] [params...]')
697
- .description('Manage agents/bots (list|set|info|add|bindings|bind|unbind|set-identity)')
698
- .action((action, params) => {
699
- const agentsCmd = require('../src/commands/agents');
700
- agentsCmd([action, ...(params || [])]);
701
- });
702
-
703
- program
704
- .command('plugins [action] [params...]')
705
- .description('Manage plugins (list|install|uninstall|enable|disable|info|update|search|doctor|registry)')
706
- .action((action, params) => {
707
- const pluginsCmd = require('../src/commands/plugins');
708
- pluginsCmd([action, ...(params || [])]);
709
- });
710
-
711
- program
712
- .command('pairing [action] [params...]')
713
- .description('Manage device pairings (list|approve|reject)')
714
- .action((action, params) => {
715
- const pairingCmd = require('../src/commands/pairing');
716
- pairingCmd([action, ...(params || [])]);
717
- });
718
-
719
- program
720
- .command('uninstall')
721
- .description('Uninstall NatureCo CLI data')
722
- .option('--all', 'Remove all data including config')
723
- .option('--yes, -y', 'Skip confirmation')
724
- .option('--dry-run', 'Preview actions without executing')
725
- .action(() => {
726
- const uninstallCmd = require('../src/commands/uninstall');
727
- uninstallCmd(process.argv.slice(3));
728
- });
729
-
730
- // === OpenClaw uyumlu komutlar ===
731
-
732
- program
733
- .command('agent <action> [args...]')
734
- .description('One-shot agent task (run|abort|tail|logs)')
735
- .action((action, args) => {
736
- agent([action, ...(args || [])]);
737
- });
738
-
739
- program
740
- .command('approvals <action> [text...]')
741
- .description('Exec approval policy (list|allow|deny|status)')
742
- .action((action, text) => {
743
- approvals([action, ...(text || [])]);
744
- });
745
-
746
- program
747
- .command('backup <action>')
748
- .description('Backup management (create|list|restore|verify)')
749
- .action((action) => {
750
- backup([action]);
751
- });
752
-
753
- program
754
- .command('capability [action]')
755
- .description('Query agent capabilities (list|infer)')
756
- .action((action) => {
757
- const args = process.argv.slice(3);
758
- capability(args);
759
- });
760
-
761
- program
762
- .command('commitments <action> [text...]')
763
- .description('Manage action commitments (list|add|check|resolve|summary|pending|done)')
764
- .action((action, text) => {
765
- commitments([action, ...(text || [])]);
766
- });
767
-
768
- program
769
- .command('completion <shell>')
770
- .description('Generate shell completion script (bash|zsh|fish|powershell)')
771
- .action((shell) => {
772
- completion(shell);
773
- });
774
-
775
- program
776
- .command('configure')
777
- .description('Interactive configuration wizard')
778
- .action(() => {
779
- configure(process.argv.slice(3));
780
- });
781
-
782
- program
783
- .command('crestodian [action]')
784
- .description('Crestodian repair assistant (repair|analyze|plan)')
785
- .action((action) => {
786
- const args = process.argv.slice(3);
787
- crestodian(args);
788
- });
789
-
790
- program
791
- .command('daemon <action>')
792
- .description('Gateway daemon management (status|start|stop|restart)')
793
- .action((action) => {
794
- daemon([action, ...process.argv.slice(4)]);
795
- });
796
-
797
- program
798
- .command('devices [action]')
799
- .description('Device management (list|pair|unpair|token|regenerate-token|rotate|revoke|clear)')
800
- .action((action) => {
801
- const args = process.argv.slice(3);
802
- devices(args);
803
- });
804
-
805
- program
806
- .command('directory <action>')
807
- .description('Directory query (query|search)')
808
- .action((action) => {
809
- const args = process.argv.slice(3);
810
- directory(args);
811
- });
812
-
813
- program
814
- .command('dns <action>')
815
- .description('Network DNS discovery (discover|resolve)')
816
- .action((action) => {
817
- const args = process.argv.slice(3);
818
- dns(args);
819
- });
820
-
821
- program
822
- .command('docs [query...]')
823
- .description('Documentation search')
824
- .action((query) => {
825
- docs(query || []);
826
- });
827
-
828
- program
829
- .command('exec-policy [action]')
830
- .description('Exec policy management (show|preset|set)')
831
- .action((action) => {
832
- const args = process.argv.slice(3);
833
- execPolicy(args);
834
- });
835
-
836
- program
837
- .command('health [action]')
838
- .description('Service health check')
839
- .action((action) => {
840
- const args = process.argv.slice(3);
841
- health(args);
842
- });
843
-
844
- program
845
- .command('infer [action]')
846
- .description('Infer capabilities/models/media (models|media|capabilities|model run|auth|image|audio|tts|video|web|embedding)')
847
- .action((action) => {
848
- const args = process.argv.slice(3);
849
- infer(args);
850
- });
851
-
852
- program
853
- .command('node <action>')
854
- .description('Node host management (run|status|install|uninstall|stop|restart)')
855
- .action((action) => {
856
- const args = process.argv.slice(3);
857
- node(args);
858
- });
859
-
860
- program
861
- .command('nodes [action]')
862
- .description('Node network management (list|pending|approve|reject|remove|rename|status|describe|invoke|notify|push|canvas|camera|screen|location)')
863
- .action((action) => {
864
- const args = process.argv.slice(3);
865
- nodes(args);
866
- });
867
-
868
- program
869
- .command('onboard')
870
- .description('Interactive onboarding wizard')
871
- .action(() => {
872
- onboard(process.argv.slice(3));
873
- });
874
-
875
- program
876
- .command('proxy [action]')
877
- .description('Debug proxy server (start|stop|status|run|coverage|sessions|query|blob|purge)')
878
- .action((action) => {
879
- const args = process.argv.slice(3);
880
- proxy(args);
881
- });
882
-
883
- program
884
- .command('qr [action]')
885
- .description('QR code pairing (show|generate|verify)')
886
- .action((action) => {
887
- const args = process.argv.slice(3);
888
- qr(args);
889
- });
890
-
891
- program
892
- .command('sandbox <action>')
893
- .description('Sandbox container management (list|create|destroy)')
894
- .action((action) => {
895
- sandbox([action]);
896
- });
897
-
898
- program
899
- .command('secrets [action]')
900
- .description('Secret value management (list|set|get|unset|audit|reload|configure|apply)')
901
- .action((action) => {
902
- const args = process.argv.slice(3);
903
- secrets(args);
904
- });
905
-
906
- program
907
- .command('system <action>')
908
- .description('System status/heartbeat/presence (status|heartbeat|presence)')
909
- .action((action) => {
910
- system([action]);
911
- });
912
-
913
- program
914
- .command('terminal <action> [text...]')
915
- .description('Terminal session management (exec|connect|disconnect|list)')
916
- .action((action, text) => {
917
- terminal([action, ...(text || [])]);
918
- });
919
-
920
- program
921
- .command('transcripts [action]')
922
- .description('Transcript management (list|show|delete)')
923
- .action((action) => {
924
- const args = process.argv.slice(3);
925
- transcripts(args);
926
- });
927
-
928
- program
929
- .command('wiki [action] [params...]')
930
- .description('Wiki/knowledge base (status|init|ingest|compile|lint|search|get|apply|doctor|bridge import|unsafe-local import|obsidian)')
931
- .action((action, params) => {
932
- wiki([action, ...(params || [])]);
933
- });
934
-
935
- program
936
- .command('browser [action] [params...]')
937
- .description('Browser automation (status|start|stop|tabs|open|close|navigate|screenshot|snapshot|click|type|press|resize|hover|drag|select|upload|fill|dialog|wait|evaluate|console|pdf|profiles|focus|reset-profile|create-profile|delete-profile)')
938
- .action((action, params) => {
939
- browser([action, ...(params || [])]);
940
- });
941
-
942
- program
943
- .command('path [action] [params...]')
944
- .description('nc:// URI path management (resolve|find|set|validate|emit)')
945
- .action((action, params) => {
946
- const pathCmd = require('../src/commands/path');
947
- pathCmd([action, ...(params || [])]);
948
- });
949
-
950
- program
951
- .command('clawbot [action] [params...]')
952
- .description('Legacy clawbot namespace (qr)')
953
- .action((action, params) => {
954
- const clawbotCmd = require('../src/commands/clawbot');
955
- clawbotCmd([action, ...(params || [])]);
956
- });
957
-
958
- // === OpenClaw uyumlu alias komutlar ===
959
-
960
- program
961
- .command('acp [file]')
962
- .description('Alias for code command')
963
- .action((file) => {
964
- const codeCmd = require('../src/commands/code');
965
- codeCmd(file, { dir: process.cwd() });
966
- });
967
-
968
- program
969
- .command('web-fetch [url]')
970
- .description('Fetch a URL and convert to markdown')
971
- .action(async (url) => {
972
- const webFetch = require('../src/commands/web-fetch');
973
- await webFetch(url);
974
- });
975
-
976
- program
977
- .command('help')
978
- .description('Show help information')
979
- .action(help);
980
-
981
- // Yardım çıktısı için colors
982
- program.configureHelp({
983
- sortSubcommands: true,
984
- showGlobalOptions: true,
985
- });
986
-
987
- // Global options
988
- program
989
- .option('--no-splash', 'Splash animasyonunu atla')
990
- .option('--plain', 'Düz metin (renk ve animasyon yok)')
991
- .option('--profile <name>', 'Farklı profil kullan (multi-account)')
992
- .allowUnknownOption(); // kendi custom option'larımız için
993
-
994
- // ════════════════════════════════════════════════════════════
995
- // First-run akışı: setup yoksa otomatik wizard'a yönlendir
996
- // ════════════════════════════════════════════════════════════
997
- const path = require('path');
998
- const fs = require('fs');
999
- const os = require('os');
1000
- const brand = require('../src/utils/branding');
1001
- const tui = require('../src/utils/tui');
1002
- tui.init();
1003
- const { firstRunScreen } = brand;
1004
-
1005
- const argv = process.argv.slice(2);
1006
-
1007
- // Global option'ları filtrele bunlar command değil
1008
- const GLOBAL_FLAGS = ['--no-splash', '--plain', '--profile'];
1009
- const realArgs = argv.filter(a => !GLOBAL_FLAGS.includes(a) && !a.startsWith('--profile='));
1010
- const hasCommand = realArgs.length > 0;
1011
- const CONFIG_DIR = path.join(os.homedir(), '.natureco');
1012
- const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
1013
-
1014
- // Yardım/versiyon için asla first-run'a sokma
1015
- const skipFirstRun = argv.includes('--help') || argv.includes('-h')
1016
- || argv.includes('--version') || argv.includes('-V')
1017
- || argv[0] === 'help' || argv[0] === 'setup' || argv[0] === 'update'
1018
- || argv[0] === 'doctor' || argv[0] === 'uninstall';
1019
-
1020
- // --no-splash flag'i ile splash atlanabilsin
1021
- const noSplash = argv.includes('--no-splash') || process.env.NATURECO_NO_SPLASH;
1022
-
1023
- function needsFirstRun() {
1024
- try {
1025
- if (!fs.existsSync(CONFIG_FILE)) return true;
1026
- const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
1027
- return !cfg.setupCompleted;
1028
- } catch {
1029
- return true;
1030
- }
1031
- }
1032
-
1033
- async function handleNoArgs() {
1034
- if (!hasCommand) {
1035
- // Splash animasyonu (sadece TTY'de ve --no-splash yoksa)
1036
- if (!noSplash && tui.CAPS.isTTY && !process.env.CI) {
1037
- await tui.splash({
1038
- title: 'NatureCo CLI',
1039
- version: packageJson.version,
1040
- subtitle: 'OpenClaw\'dan daha güvenli, daha hızlı, daha ucuz',
1041
- duration: 1200,
1042
- });
1043
- }
1044
-
1045
- if (!skipFirstRun && needsFirstRun()) {
1046
- if (tui.CAPS.isTTY && !noSplash) {
1047
- console.log('\n' + tui.C.amber(' ⌥ İlk kurulum hoş geldin! Hızlıca ayarlayalım.\n'));
1048
- } else {
1049
- console.log(firstRunScreen());
1050
- }
1051
- const setup = require('../src/commands/setup');
1052
- await setup(['wizard']);
1053
- console.log('\n');
1054
- const userName = require('os').userInfo().username;
1055
- console.log(tui.welcomeCard({
1056
- version: packageJson.version,
1057
- user: { name: userName },
1058
- status: tui.C.green('✓ Aktif'),
1059
- tips: brand.pickDailyTip(),
1060
- }));
1061
- return;
1062
- }
1063
- // Normal kullanım — welcome card
1064
- const userName = require('os').userInfo().username;
1065
- let loginStatus = 'ok';
1066
- try {
1067
- if (fs.existsSync(CONFIG_FILE)) {
1068
- const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
1069
- if (!cfg.providerApiKey && !cfg.apiKey) loginStatus = 'needed';
1070
- } else {
1071
- loginStatus = 'needed';
1072
- }
1073
- } catch { loginStatus = 'unknown'; }
1074
- console.log('\n' + tui.welcomeCard({
1075
- version: packageJson.version,
1076
- user: { name: userName },
1077
- status: loginStatus === 'ok' ? tui.C.green('✓ Aktif') : tui.C.amber('⚠ API key gerekli'),
1078
- tips: brand.pickDailyTip(),
1079
- }));
1080
- return;
1081
- }
1082
- // Global option'ları filtrele (--no-splash, --plain, --profile) ve parse et
1083
- const opts = program.opts();
1084
- if (opts.profile) {
1085
- process.env.NATURECO_PROFILE = opts.profile;
1086
- // TODO: profile dizinini değiştir
1087
- }
1088
- if (opts.plain) {
1089
- process.env.FORCE_COLOR = '0';
1090
- process.env.NATURECO_NO_SPLASH = '1';
1091
- }
1092
- program.parse(process.argv);
1093
- }
1094
-
1095
- handleNoArgs();
1
+ #!/usr/bin/env node
2
+
3
+ const { Command } = require('commander');
4
+ const chalk = require('chalk');
5
+ const packageJson = require('../package.json');
6
+ // Küresel çökme/EPIPE yakalayıcıları — ham Node stack yerine düzgün mesaj + audit log
7
+ require('../src/utils/process-errors').install();
8
+ const login = require('../src/commands/login');
9
+ const logout = require('../src/commands/logout');
10
+ const bots = require('../src/commands/bots');
11
+ const chat = require('../src/commands/chat');
12
+ const help = require('../src/commands/help');
13
+ const gateway = require('../src/commands/gateway');
14
+ const init = require('../src/commands/init');
15
+ const config = require('../src/commands/config');
16
+ const ask = require('../src/commands/ask');
17
+ const run = require('../src/commands/run');
18
+ const signal = require('../src/commands/signal');
19
+ const irc = require('../src/commands/irc');
20
+ const mattermost = require('../src/commands/mattermost');
21
+ const imessage = require('../src/commands/imessage');
22
+ const sms = require('../src/commands/sms');
23
+ const webhooks = require('../src/commands/webhooks');
24
+ const bonjour = require('../src/commands/bonjour');
25
+ const policy = require('../src/commands/policy');
26
+ const voice = require('../src/commands/voice');
27
+ const clickclack = require('../src/commands/clickclack');
28
+ const adminRpc = require('../src/commands/admin-rpc');
29
+ const ocPath = require('../src/commands/oc-path');
30
+ const workboard = require('../src/commands/workboard');
31
+ const threadOwnership = require('../src/commands/thread-ownership');
32
+ const devicePair = require('../src/commands/device-pair');
33
+ const openProse = require('../src/commands/open-prose');
34
+ const vydra = require('../src/commands/vydra');
35
+ // OpenClaw uyumlu komutlar
36
+ const agent = require('../src/commands/agent');
37
+ const approvals = require('../src/commands/approvals');
38
+ const backup = require('../src/commands/backup');
39
+ const audit = require('../src/commands/audit');
40
+ const cost = require('../src/commands/cost');
41
+ const naturehub = require('../src/commands/naturehub');
42
+ const medium = require('../src/commands/medium');
43
+ const seo = require('../src/commands/seo');
44
+ const xp = require('../src/commands/xp');
45
+ const team = require('../src/commands/team');
46
+ const repl = require('../src/commands/repl');
47
+ const capability = require('../src/commands/capability');
48
+ const commitments = require('../src/commands/commitments');
49
+ const completion = require('../src/commands/completion');
50
+ const configure = require('../src/commands/configure');
51
+ const crestodian = require('../src/commands/crestodian');
52
+ const daemon = require('../src/commands/daemon');
53
+ const devices = require('../src/commands/devices');
54
+ const directory = require('../src/commands/directory');
55
+ const dns = require('../src/commands/dns');
56
+ const docs = require('../src/commands/docs');
57
+ const execPolicy = require('../src/commands/exec-policy');
58
+ const health = require('../src/commands/health');
59
+ const infer = require('../src/commands/infer');
60
+ const node = require('../src/commands/node');
61
+ const nodes = require('../src/commands/nodes');
62
+ const onboard = require('../src/commands/onboard');
63
+ const proxy = require('../src/commands/proxy');
64
+ const qr = require('../src/commands/qr');
65
+ const sandbox = require('../src/commands/sandbox');
66
+ const secrets = require('../src/commands/secrets');
67
+ const system = require('../src/commands/system');
68
+ const terminal = require('../src/commands/terminal');
69
+ const transcripts = require('../src/commands/transcripts');
70
+ const wiki = require('../src/commands/wiki');
71
+ const browser = require('../src/commands/browser');
72
+ const tools = require('../src/commands/tools');
73
+
74
+ const program = new Command();
75
+
76
+ program
77
+ .name('natureco')
78
+ .description('NatureCo AI Bot Terminal Interface')
79
+ .version(packageJson.version)
80
+ .showSuggestionAfterError(true); // yazım hatasında "şunu mu demek istediniz?"
81
+
82
+ program.addHelpText('after', `
83
+ ${chalk.yellow('🤖 AI & Chat')}
84
+ ${chalk.cyan('chat')} AI sohbet başlat
85
+ ${chalk.cyan('code')} Code agent — dosya oku, yaz, komut çalıştır
86
+ ${chalk.cyan('ask')} Tek soru sor
87
+ ${chalk.cyan('run')} Markdown script çalıştır
88
+ ${chalk.cyan('bots')} Bot listesi
89
+ ${chalk.cyan('agent')} One-shot agent (run|abort|tail|logs)
90
+ ${chalk.cyan('agents')} Agent yönetimi (list|set|info|add|bindings|bind|unbind|set-identity)
91
+ ${chalk.cyan('commitments')} Eylem taahhütleri (list|add|check|resolve|summary|pending|done)
92
+ ${chalk.cyan('infer')} Yetenek/algılama (list|inspect|model|image|audio|tts|video|web|embedding|auth)
93
+
94
+ ${chalk.yellow('⚙️ Kurulum & Ayarlar')}
95
+ ${chalk.cyan('setup')} İlk kurulum (config|workspace|dirs|status)
96
+ ${chalk.cyan('onboard')} Interaktif onboarding (gateway|auth|workspace|channels|skills|health|status)
97
+ ${chalk.cyan('configure')} Interaktif yapılandırma (gateway|auth|channels|plugins|skills)
98
+ ${chalk.cyan('login')} API key ile giriş
99
+ ${chalk.cyan('logout')} Çıkış
100
+ ${chalk.cyan('config')} Ayarlar (get|set|unset|list|file|schema|validate|backups|restore)
101
+ ${chalk.cyan('doctor')} Sistem teşhis (run|list|check)
102
+ ${chalk.cyan('update')} Güncelleme (run|status|wizard)
103
+ ${chalk.cyan('init')} Proje başlatma
104
+ ${chalk.cyan('completion')} Shell completion (bash|zsh|fish)
105
+
106
+ ${chalk.yellow('🔌 Entegrasyonlar')}
107
+ ${chalk.cyan('telegram')} Telegram bağlantısı
108
+ ${chalk.cyan('whatsapp')} WhatsApp bağlantısı
109
+ ${chalk.cyan('discord')} Discord bağlantısı
110
+ ${chalk.cyan('slack')} Slack bağlantısı
111
+ ${chalk.cyan('signal')} Signal bağlantısı
112
+ ${chalk.cyan('irc')} IRC bağlantısı
113
+ ${chalk.cyan('mattermost')} Mattermost bağlantısı
114
+ ${chalk.cyan('imessage')} iMessage bağlantısı
115
+ ${chalk.cyan('sms')} SMS (Twilio) bağlantısı
116
+ ${chalk.cyan('channels')} Kanal yönetimi (list|status|add|remove|logs|login|logout|capabilities|resolve)
117
+ ${chalk.cyan('message')} Cross-channel mesaj (send|broadcast|poll|react|read|edit|delete|search|pin|thread|sticker|role|moderation|event|timeout|kick|ban)
118
+ ${chalk.cyan('gateway')} WebSocket gateway (start|stop|status|call|usage-cost|probe|discover|install|uninstall|health|restart|diagnostics|run)
119
+
120
+ ${chalk.yellow('💻 Geliştirici Araçları')}
121
+ ${chalk.cyan('git')} Git entegrasyonu
122
+ ${chalk.cyan('mcp')} MCP sunucuları (serve|list|show|set|unset)
123
+ ${chalk.cyan('skills')} Skill yönetimi (list|install|remove|update|create|search|browse|info|check)
124
+ ${chalk.cyan('hooks')} Hook yönetimi (list|info|check|enable|disable|install|update)
125
+ ${chalk.cyan('cron')} Zamanlanmış görevler (add|list|remove|get|edit|enable|disable|runs|run)
126
+ ${chalk.cyan('sessions')} Oturum yönetimi (list|show|cleanup|prune)
127
+ ${chalk.cyan('ultrareview')} Detaylı kod inceleme
128
+ ${chalk.cyan('transcripts')} Transcript yönetimi (list|show|path|delete)
129
+ ${chalk.cyan('wiki')} Wiki vault (status|init|ingest|compile|lint|search|get|apply|doctor|bridge import|obsidian)
130
+
131
+ ${chalk.yellow('📊 Yönetim & Sistem')}
132
+ ${chalk.cyan('dashboard')} Web kontrol paneli (open|status|url)
133
+ ${chalk.cyan('memory')} Hafıza yönetimi (status|list|search|show|clear|index|export|import|semantic|wiki)
134
+ ${chalk.cyan('logs')} Log yönetimi (tail|show|search|clear|path)
135
+ ${chalk.cyan('status')} Sistem durumu (run|simple|usage)
136
+ ${chalk.cyan('plugins')} Plugin yönetimi (list|install|uninstall|enable|disable|info|update|search|doctor|registry|marketplace)
137
+ ${chalk.cyan('security')} Güvenlik denetimi (audit)
138
+ ${chalk.cyan('reset')} Sıfırlama (config|workspace|all|list)
139
+ ${chalk.cyan('uninstall')} Kaldırma (run|dry-run)
140
+ ${chalk.cyan('system')} Sistem durumu/heartbeat/presence (status|heartbeat|presence)
141
+ ${chalk.cyan('health')} Servis sağlık kontrolü (run|list|check)
142
+ ${chalk.cyan('backup')} Yedekleme (create|list|restore|verify)
143
+ ${chalk.cyan('secrets')} Gizli değerler (list|set|get|unset|audit|reload|configure|apply)
144
+ ${chalk.cyan('approvals')} Onay politikası (add|pending|approve|reject)
145
+ ${chalk.cyan('exec-policy')} Exec politikası (show|preset|set)
146
+ ${chalk.cyan('workboard')} Görev/pano yönetimi
147
+
148
+ ${chalk.yellow('🛰️ Ağ & Cihaz')}
149
+ ${chalk.cyan('bonjour')} keşfi ve servis tarama
150
+ ${chalk.cyan('dns')} keşfi — DNS (discover|resolve|setup)
151
+ ${chalk.cyan('directory')} Dizin sorgulama (self|peers|search|register|remove)
152
+ ${chalk.cyan('policy')} Workspace uyumluluk politikası
153
+ ${chalk.cyan('voice')} Sesli sohbet yapılandırması
154
+ ${chalk.cyan('clickclack')} Bildirim/beep kanalı
155
+ ${chalk.cyan('admin-rpc')} HTTP admin RPC endpoint
156
+ ${chalk.cyan('oc-path')} nc:// URI path handler
157
+ ${chalk.cyan('thread-ownership')} Slack thread koordinasyonu
158
+ ${chalk.cyan('device-pair')} Cihaz eşleştirme (QR kod)
159
+ ${chalk.cyan('devices')} Cihaz yönetimi (list|pair|unpair|token|regenerate-token|rotate|revoke|clear)
160
+ ${chalk.cyan('qr')} QR kod ile eşleştirme
161
+ ${chalk.cyan('pairing')} Cihaz eşleştirme (list|approve|reject|generate)
162
+
163
+ ${chalk.yellow('🔧 Altyapı')}
164
+ ${chalk.cyan('daemon')} Gateway daemon (status|start|stop|restart)
165
+ ${chalk.cyan('node')} Node host (run|status|install|uninstall|stop|restart)
166
+ ${chalk.cyan('nodes')} Node network (list|pending|approve|reject|remove|rename|status|describe|invoke|notify|push|canvas|camera|screen|location)
167
+ ${chalk.cyan('proxy')} Debug proxy (start|stop|status|run|coverage|sessions|query|blob|purge)
168
+ ${chalk.cyan('sandbox')} Sandbox container (list|recreate|explain)
169
+ ${chalk.cyan('capability')} Yetenek sorgulama (list|inspect)
170
+ ${chalk.cyan('acp')} ACP endpoint (status|info)
171
+ ${chalk.cyan('tui')} Terminal UI (start|local|status)
172
+ ${chalk.cyan('path')} nc:// URI path yönetimi (resolve|find|set|validate|emit)
173
+ ${chalk.cyan('clawbot')} Legacy clawbot (qr)
174
+
175
+ ${chalk.yellow('📦 Medya & İçerik')}
176
+ ${chalk.cyan('open-prose')} Prose skills bundle
177
+ ${chalk.cyan('vydra')} Vydra medya sağlayıcı
178
+ ${chalk.cyan('docs')} Dokümantasyon arama
179
+ ${chalk.cyan('browser')} Browser automation (status|start|stop|tabs|open|close|navigate|screenshot|snapshot|click|type|press|resize|hover|drag|select|upload|fill|dialog|wait|evaluate|console|pdf|profiles|focus|reset-profile|create-profile|delete-profile)
180
+
181
+ ${chalk.yellow('Örnekler:')}
182
+ ${chalk.gray('$ natureco setup')} İlk kurulum
183
+ ${chalk.gray('$ natureco onbord')} Onboarding
184
+ ${chalk.gray('$ natureco chat')} Sohbet başlat
185
+ ${chalk.gray('$ natureco code')} Code agent
186
+ ${chalk.gray('$ natureco doctor')} Sistem kontrolü
187
+ ${chalk.gray('$ natureco agent run "dosya oku"')} One-shot agent
188
+ ${chalk.gray('$ natureco completion bash')} Shell completion
189
+ `);
190
+
191
+ program
192
+ .command('login')
193
+ .description('Login with your NatureCo API key')
194
+ .action(login);
195
+
196
+ program
197
+ .command('setup [action]')
198
+ .description('Run initial setup wizard (wizard|config|workspace|dirs|status)')
199
+ .action(async (action) => {
200
+ const setup = require('../src/commands/setup');
201
+ await setup(action ? [action] : []);
202
+ });
203
+
204
+ program
205
+ .command('logout')
206
+ .description('Logout and remove stored credentials')
207
+ .action(logout);
208
+
209
+ program
210
+ .command('bots')
211
+ .description('List your AI bots')
212
+ .action(bots);
213
+
214
+ program
215
+ .command('chat [bot-name...]')
216
+ .description('Start interactive chat with a bot (uses default bot if not specified)')
217
+ .option('--resume [session-id]', 'Resume a previous session')
218
+ .option('--continue', 'son oturumu devam ettir')
219
+ .option('--list', 'geçmiş oturumları listele')
220
+ .option('--no-stream', 'streaming devre dışı')
221
+ .action((botNameParts, options) => {
222
+ const botName = Array.isArray(botNameParts) ? botNameParts.join(' ') : botNameParts;
223
+ chat(botName, options);
224
+ });
225
+
226
+ program
227
+ .command('code [file]')
228
+ .description('Agentic coding modu v5 — Claude Code alternative (47 tools, TUI, auto tool selection)')
229
+ .option('--dir <path>', 'çalışma dizini', process.cwd())
230
+ .option('--no-stream', 'streaming devre dışı')
231
+ .option('--dry-run', 'değişiklikleri göster ama uygulama')
232
+ .option('--legacy', 'v2.23 eski code agent kullan')
233
+ .action((file, options) => {
234
+ if (options.legacy) {
235
+ const codeCmd = require('../src/commands/code');
236
+ codeCmd(file, options);
237
+ } else {
238
+ const codeV5 = require('../src/commands/code_v5');
239
+ codeV5(options.dir || (file ? path.dirname(path.resolve(file)) : null));
240
+ }
241
+ });
242
+
243
+ program
244
+ .command('init')
245
+ .description('Initialize NatureCo project in current directory')
246
+ .action(init);
247
+
248
+ program
249
+ .command('config <action> [key] [value...]')
250
+ .description('Manage configuration (get|set|unset|list|file|schema|validate|backups|restore)')
251
+ .action((action, key, value) => config([action, key, ...(value || [])]));
252
+
253
+ program
254
+ .command('skills [action] [params...]')
255
+ .description('Manage skills (list|install|remove|update|create|search|browse|info|check)')
256
+ .action((action, params) => {
257
+ const skillsCmd = require('../src/commands/skills');
258
+ skillsCmd([action, ...(params || [])]);
259
+ });
260
+
261
+ program
262
+ .command('ask <question>')
263
+ .description('Ask a single question to your default bot')
264
+ .option('--tools', 'araç kullanımını etkinleştir (varsayılan: kapalı — %90 daha az token)')
265
+ .action((question, options) => ask(question, options));
266
+
267
+ program
268
+ .command('run <script>')
269
+ .description('Run a markdown script file')
270
+ .action(run);
271
+
272
+ program
273
+ .command('mcp [action] [params...]')
274
+ .description('Manage MCP servers (list|add|remove|test|enable|disable|templates)')
275
+ .action((action, params) => {
276
+ const mcpCmd = require('../src/commands/mcp');
277
+ mcpCmd([action, ...(params || [])]);
278
+ });
279
+
280
+ program
281
+ .command('update [action] [params...]')
282
+ .description('Update management (run|status|wizard)')
283
+ .action((action, params) => {
284
+ const updateCmd = require('../src/commands/update');
285
+ updateCmd([action, ...(params || [])]);
286
+ });
287
+
288
+ program
289
+ .command('migrate')
290
+ .description('Migrate from other CLI tools (openclaw, claude-code, hermes)')
291
+ .option('--from <source>', 'Source CLI (openclaw, claude-code, hermes)', 'openclaw')
292
+ .option('--openclaw-dir <path>', 'OpenClaw directory path (default: ~/.openclaw)')
293
+ .action((options) => {
294
+ const migrateCmd = require('../src/commands/migrate');
295
+ migrateCmd(options);
296
+ });
297
+
298
+ program
299
+ .command('commands [action] [params...]')
300
+ .description('Manage custom commands (list|create)')
301
+ .action((action, params) => {
302
+ const commandsCmd = require('../src/commands/commands');
303
+ commandsCmd(action, ...(params || []));
304
+ });
305
+
306
+ program
307
+ .command('cron <action>')
308
+ .option('--name <name>', 'Cron job adı')
309
+ .option('--schedule <schedule>', 'Cron schedule (örnek: "0 9 * * *")')
310
+ .option('--action <action>', 'Aksiyon: whatsapp veya telegram')
311
+ .option('--target <target>', 'Hedef numara veya chat ID')
312
+ .option('--prompt <prompt>', 'AI\'a gönderilecek prompt')
313
+ .description('Cron job yönetimi (add|list|remove|get|edit|enable|disable|runs|run)')
314
+ .action((action, options) => {
315
+ const cronCmd = require('../src/commands/cron');
316
+ cronCmd(action, options);
317
+ });
318
+
319
+ program
320
+ .command('hooks [action] [params...]')
321
+ .description('Manage hooks (list|info|check|enable|disable|install|update)')
322
+ .action((action, params) => {
323
+ const hooksCmd = require('../src/commands/hooks');
324
+ hooksCmd([action, ...(params || [])]);
325
+ });
326
+
327
+ program
328
+ .command('sessions [action] [params...]')
329
+ .description('Session management (list|show|cleanup|prune)')
330
+ .action((action, params) => {
331
+ const sessionsCmd = require('../src/commands/sessions');
332
+ sessionsCmd([action, ...(params || [])]);
333
+ });
334
+
335
+ program
336
+ .command('git <action>')
337
+ .description('Git integration (review|commit|pr|explain)')
338
+ .action((action) => {
339
+ const gitCmd = require('../src/commands/git');
340
+ gitCmd(action);
341
+ });
342
+
343
+ program
344
+ .command('tasks [action] [params...]')
345
+ .description('Manage background tasks (list|show|cancel|audit|maintenance|flow|summary|notify)')
346
+ .action((action, params) => {
347
+ const tasksCmd = require('../src/commands/tasks');
348
+ tasksCmd([action, ...(params || [])]);
349
+ });
350
+
351
+ program
352
+ .command('gateway [action]')
353
+ .description('WebSocket gateway (start|stop|status|call|usage-cost|probe|discover|install|uninstall|health|restart|diagnostics|run)')
354
+ .action((action) => {
355
+ if (action === 'stop' || action === 'status') {
356
+ const gatewayServerCmd = require('../src/commands/gateway-server');
357
+ gatewayServerCmd(action);
358
+ } else {
359
+ const args = process.argv.slice(3);
360
+ gateway(...args);
361
+ }
362
+ });
363
+
364
+ program
365
+ .command('ultrareview [file]')
366
+ .description('Ultra detailed code review')
367
+ .action((file) => {
368
+ const ultrareviewCmd = require('../src/commands/ultrareview');
369
+ ultrareviewCmd(file);
370
+ });
371
+
372
+ program
373
+ .command('discord <action>')
374
+ .description('Discord integration (connect|disconnect|status)')
375
+ .action((action) => {
376
+ const discordCmd = require('../src/commands/discord');
377
+ discordCmd(action);
378
+ });
379
+
380
+ program
381
+ .command('slack <action>')
382
+ .description('Slack integration (connect|disconnect|status)')
383
+ .action((action) => {
384
+ const slackCmd = require('../src/commands/slack');
385
+ slackCmd(action);
386
+ });
387
+
388
+ program
389
+ .command('whatsapp <action> [number]')
390
+ .description('WhatsApp integration (connect|disconnect|status|allow)')
391
+ .action((action, number) => {
392
+ const whatsappCmd = require('../src/commands/whatsapp');
393
+ whatsappCmd(action, number);
394
+ });
395
+
396
+ program
397
+ .command('telegram <action> [chatId]')
398
+ .description('Telegram integration (connect|disconnect|status|allow)')
399
+ .action((action, chatId) => {
400
+ const telegramCmd = require('../src/commands/telegram');
401
+ telegramCmd(action, chatId);
402
+ });
403
+
404
+ program
405
+ .command('signal <action>')
406
+ .description('Signal integration (connect|disconnect|status)')
407
+ .action((action) => {
408
+ const signalCmd = require('../src/commands/signal');
409
+ signalCmd(action);
410
+ });
411
+
412
+ program
413
+ .command('irc <action>')
414
+ .description('IRC integration (connect|disconnect|status)')
415
+ .action((action) => {
416
+ const ircCmd = require('../src/commands/irc');
417
+ ircCmd(action);
418
+ });
419
+
420
+ program
421
+ .command('mattermost <action>')
422
+ .description('Mattermost integration (connect|disconnect|status)')
423
+ .action((action) => {
424
+ const mattermostCmd = require('../src/commands/mattermost');
425
+ mattermostCmd(action);
426
+ });
427
+
428
+ program
429
+ .command('imessage <action> [recipient] [message]')
430
+ .description('iMessage integration (connect|disconnect|status|probe|send)')
431
+ .action((action, recipient, message) => {
432
+ const imessageCmd = require('../src/commands/imessage');
433
+ imessageCmd(action, recipient, message);
434
+ });
435
+
436
+ program
437
+ .command('sms <action>')
438
+ .description('SMS/Twilio integration (connect|disconnect|status)')
439
+ .action((action) => {
440
+ const smsCmd = require('../src/commands/sms');
441
+ smsCmd(action);
442
+ });
443
+
444
+ program
445
+ .command('webhooks <action>')
446
+ .description('Webhook management (list|gmail)')
447
+ .action((action) => {
448
+ const webhooksCmd = require('../src/commands/webhooks');
449
+ webhooksCmd(process.argv.slice(3));
450
+ });
451
+
452
+ program
453
+ .command('message [action]')
454
+ .description('Unified cross-channel messaging (send|broadcast|poll|react|reactions|read|edit|delete|search|pin|unpin|pins|permissions|thread|emoji|sticker|role|channel|member|voice|event|timeout|kick|ban|moderation)')
455
+ .action((action) => {
456
+ const messageCmd = require('../src/commands/message');
457
+ const args = process.argv.slice(3);
458
+ messageCmd(args);
459
+ });
460
+
461
+ program
462
+ .command('dashboard [action]')
463
+ .description('Web Control UI (start|stop|status)')
464
+ .action((action) => {
465
+ const dashboardCmd = require('../src/commands/dashboard');
466
+ dashboardCmd(action);
467
+ });
468
+
469
+ program
470
+ .command('doctor')
471
+ .description('System diagnostics and health check')
472
+ .option('--fix', 'Automatically fix issues')
473
+ .action((options) => {
474
+ const doctorCmd = require('../src/commands/doctor');
475
+ const args = process.argv.slice(3);
476
+ doctorCmd(args);
477
+ });
478
+
479
+ program
480
+ .command('channels [action] [params...]')
481
+ .description('Manage connected channels (list|status|add|remove|logs|login|logout|capabilities|resolve)')
482
+ .action((action, params) => {
483
+ const channelsCmd = require('../src/commands/channels');
484
+ channelsCmd([action, ...(params || [])]);
485
+ });
486
+
487
+ program
488
+ .command('bonjour [action]')
489
+ .description('Network discovery (scan|discover|status) — find NatureCo services on LAN')
490
+ .action((action) => {
491
+ const bonjourCmd = require('../src/commands/bonjour');
492
+ const args = process.argv.slice(3);
493
+ bonjourCmd(args);
494
+ });
495
+
496
+ program
497
+ .command('policy [action]')
498
+ .description('Workspace policy checks (check|set|list|remove)')
499
+ .action((action) => {
500
+ const policyCmd = require('../src/commands/policy');
501
+ const args = process.argv.slice(3);
502
+ policyCmd(args);
503
+ });
504
+
505
+ program
506
+ .command('voice [action]')
507
+ .description('Voice configuration (status|providers|set) — manage TTS voice settings')
508
+ .action((action) => {
509
+ const voiceCmd = require('../src/commands/voice');
510
+ const args = process.argv.slice(3);
511
+ voiceCmd(args);
512
+ });
513
+
514
+ program
515
+ .command('clickclack [action]')
516
+ .description('ClickClack notification channel (status|test|enable|disable|listen|notify)')
517
+ .action((action) => {
518
+ const clickclackCmd = require('../src/commands/clickclack');
519
+ const args = process.argv.slice(3);
520
+ clickclackCmd(args);
521
+ });
522
+
523
+ program
524
+ .command('admin-rpc [action]')
525
+ .description('Admin HTTP RPC server (status|start|stop|call|methods)')
526
+ .action((action) => {
527
+ const args = process.argv.slice(3);
528
+ adminRpc(args);
529
+ });
530
+
531
+ program
532
+ .command('oc-path [action]')
533
+ .description('nc:// URI path handler (resolve|list|cat|ls)')
534
+ .action((action) => {
535
+ const args = process.argv.slice(3);
536
+ ocPath(args);
537
+ });
538
+
539
+ program
540
+ .command('workboard [action]')
541
+ .description('Work board (show|add|move|remove|clear|columns|export|import)')
542
+ .action((action) => {
543
+ const args = process.argv.slice(3);
544
+ workboard(args);
545
+ });
546
+
547
+ program
548
+ .command('thread-ownership [action]')
549
+ .description('Thread ownership (status|list|assign|release|check|agent)')
550
+ .action((action) => {
551
+ const args = process.argv.slice(3);
552
+ threadOwnership(args);
553
+ });
554
+
555
+ program
556
+ .command('device-pair [action]')
557
+ .description('Device pairing (list|request|approve|reject|remove|pairing-code|verify)')
558
+ .action((action) => {
559
+ const args = process.argv.slice(3);
560
+ devicePair(args);
561
+ });
562
+
563
+ program
564
+ .command('open-prose [action]')
565
+ .description('OpenProse skills bundle (list|info)')
566
+ .action((action) => {
567
+ const args = process.argv.slice(3);
568
+ openProse(args);
569
+ });
570
+
571
+ program
572
+ .command('vydra [action]')
573
+ .description('Vydra media provider (status|configure|test)')
574
+ .action((action) => {
575
+ const args = process.argv.slice(3);
576
+ vydra(args);
577
+ });
578
+
579
+ program
580
+ .command('models [action] [params...]')
581
+ .description('Manage AI models (list|set|scan|aliases|fallbacks|set-image|image-fallbacks)')
582
+ .allowUnknownOption()
583
+ .action((action, params) => {
584
+ const modelsCmd = require('../src/commands/models');
585
+ const allArgs = process.argv.slice(process.argv.indexOf('models') + 1);
586
+ modelsCmd(allArgs);
587
+ });
588
+
589
+ program
590
+ .command('audit [action] [params...]')
591
+ .description('Audit log görüntüleyici (today|stats|show|search|files|cleanup|tail)')
592
+ .action((action, params) => {
593
+ audit(action ? [action, ...(params || [])] : ['today']);
594
+ });
595
+
596
+ program
597
+ .command('cost [action] [params...]')
598
+ .description('Maliyet takibi (today|week|month|all|budget|set|model|prices)')
599
+ .action((action, params) => {
600
+ cost(action ? [action, ...(params || [])] : ['today']);
601
+ });
602
+
603
+ program
604
+ .command('naturehub [action] [params...]')
605
+ .description('Nature Hub\'a içerik yayınla (post|list|trending|config)')
606
+ .action((action, params) => {
607
+ naturehub(action ? [action, ...(params || [])] : []);
608
+ });
609
+
610
+ program
611
+ .command('medium [action] [params...]')
612
+ .description('Medium makale yayınla (draft|publish|list)')
613
+ .action((action, params) => {
614
+ medium(action ? [action, ...(params || [])] : []);
615
+ });
616
+
617
+ program
618
+ .command('seo [action] [params...]')
619
+ .description('SEO analizi (audit|meta|speed)')
620
+ .action((action, params) => {
621
+ seo(action ? [action, ...(params || [])] : []);
622
+ });
623
+
624
+ program
625
+ .command('xp [action]')
626
+ .description('NatureCo XP/Level sistemi')
627
+ .action((action) => {
628
+ xp(action ? [action] : []);
629
+ });
630
+
631
+ program
632
+ .command('tools [action] [name]')
633
+ .description('Tool registry (list|enable|disable)')
634
+ .action((action, name) => {
635
+ tools(action ? [action, name].filter(Boolean) : []);
636
+ });
637
+
638
+ program
639
+ .command('team [action] [params...]')
640
+ .description('Multi-agent orkestrasyon (list|status|spawn|parallel)')
641
+ .action((action, params) => {
642
+ team(action ? [action, ...(params || [])] : []);
643
+ });
644
+
645
+ program
646
+ .command('repl [options...]')
647
+ .description('İnteraktif REPL — bizim bu konuşmamız gibi sohbet modu')
648
+ .option('--resume [id]', 'Önceki oturumu yükle')
649
+ .action((options) => {
650
+ const resumeOpt = options.resume ? [options.resume === true ? 'last' : options.resume] : [];
651
+ repl(options._args || resumeOpt);
652
+ });
653
+
654
+ program
655
+ .command('memory [action] [params...]')
656
+ .description('Manage memory (status|list|search|show|clear|index|export|import|semantic|wiki)')
657
+ .action((action, params) => {
658
+ const memoryCmd = require('../src/commands/memory-cmd');
659
+ memoryCmd([action, ...(params || [])]);
660
+ });
661
+
662
+ program
663
+ .command('logs [action] [params...]')
664
+ .description('View and manage logs (tail|show|search|clear|path)')
665
+ .action((action, params) => {
666
+ const logsCmd = require('../src/commands/logs');
667
+ logsCmd([action, ...(params || [])]);
668
+ });
669
+
670
+ program
671
+ .command('status [action] [params...]')
672
+ .description('Show system status (run|simple|usage)')
673
+ .action((action, params) => {
674
+ const statusCmd = require('../src/commands/status');
675
+ statusCmd([action, ...(params || [])]);
676
+ });
677
+
678
+ program
679
+ .command('reset')
680
+ .description('Reset local config/state')
681
+ .option('--scope <scope>', 'Scope: config|memory|sessions|full', 'config')
682
+ .option('--yes, -y', 'Skip confirmation')
683
+ .action(() => {
684
+ const resetModule = require('../src/commands/reset');
685
+ const resetFn = resetModule.reset || resetModule;
686
+ resetFn(process.argv.slice(3));
687
+ });
688
+
689
+ program
690
+ .command('security [action]')
691
+ .description('Security audit (audit)')
692
+ .option('--fix', 'Auto-fix issues')
693
+ .option('--json', 'JSON output')
694
+ .action((action) => {
695
+ const securityCmd = require('../src/commands/security');
696
+ securityCmd(process.argv.slice(3));
697
+ });
698
+
699
+ program
700
+ .command('agents [action] [params...]')
701
+ .description('Manage agents/bots (list|set|info|add|bindings|bind|unbind|set-identity)')
702
+ .action((action, params) => {
703
+ const agentsCmd = require('../src/commands/agents');
704
+ agentsCmd([action, ...(params || [])]);
705
+ });
706
+
707
+ program
708
+ .command('plugins [action] [params...]')
709
+ .description('Manage plugins (list|install|uninstall|enable|disable|info|update|search|doctor|registry)')
710
+ .action((action, params) => {
711
+ const pluginsCmd = require('../src/commands/plugins');
712
+ pluginsCmd([action, ...(params || [])]);
713
+ });
714
+
715
+ program
716
+ .command('pairing [action] [params...]')
717
+ .description('Manage device pairings (list|approve|reject)')
718
+ .action((action, params) => {
719
+ const pairingCmd = require('../src/commands/pairing');
720
+ pairingCmd([action, ...(params || [])]);
721
+ });
722
+
723
+ program
724
+ .command('uninstall')
725
+ .description('Uninstall NatureCo CLI data')
726
+ .option('--all', 'Remove all data including config')
727
+ .option('--yes, -y', 'Skip confirmation')
728
+ .option('--dry-run', 'Preview actions without executing')
729
+ .action(() => {
730
+ const uninstallCmd = require('../src/commands/uninstall');
731
+ uninstallCmd(process.argv.slice(3));
732
+ });
733
+
734
+ // === OpenClaw uyumlu komutlar ===
735
+
736
+ program
737
+ .command('agent <action> [args...]')
738
+ .description('One-shot agent task (run|abort|tail|logs)')
739
+ .action((action, args) => {
740
+ agent([action, ...(args || [])]);
741
+ });
742
+
743
+ program
744
+ .command('approvals <action> [text...]')
745
+ .description('Exec approval policy (list|allow|deny|status)')
746
+ .action((action, text) => {
747
+ approvals([action, ...(text || [])]);
748
+ });
749
+
750
+ program
751
+ .command('backup <action>')
752
+ .description('Backup management (create|list|restore|verify)')
753
+ .action((action) => {
754
+ backup([action]);
755
+ });
756
+
757
+ program
758
+ .command('capability [action]')
759
+ .description('Query agent capabilities (list|infer)')
760
+ .action((action) => {
761
+ const args = process.argv.slice(3);
762
+ capability(args);
763
+ });
764
+
765
+ program
766
+ .command('commitments <action> [text...]')
767
+ .description('Manage action commitments (list|add|check|resolve|summary|pending|done)')
768
+ .action((action, text) => {
769
+ commitments([action, ...(text || [])]);
770
+ });
771
+
772
+ program
773
+ .command('completion <shell>')
774
+ .description('Generate shell completion script (bash|zsh|fish|powershell)')
775
+ .action((shell) => {
776
+ completion(shell);
777
+ });
778
+
779
+ program
780
+ .command('configure')
781
+ .description('Interactive configuration wizard')
782
+ .action(() => {
783
+ configure(process.argv.slice(3));
784
+ });
785
+
786
+ program
787
+ .command('crestodian [action]')
788
+ .description('Crestodian repair assistant (repair|analyze|plan)')
789
+ .action((action) => {
790
+ const args = process.argv.slice(3);
791
+ crestodian(args);
792
+ });
793
+
794
+ program
795
+ .command('daemon <action>')
796
+ .description('Gateway daemon management (status|start|stop|restart)')
797
+ .action((action) => {
798
+ daemon([action, ...process.argv.slice(4)]);
799
+ });
800
+
801
+ program
802
+ .command('devices [action]')
803
+ .description('Device management (list|pair|unpair|token|regenerate-token|rotate|revoke|clear)')
804
+ .action((action) => {
805
+ const args = process.argv.slice(3);
806
+ devices(args);
807
+ });
808
+
809
+ program
810
+ .command('directory <action>')
811
+ .description('Directory query (query|search)')
812
+ .action((action) => {
813
+ const args = process.argv.slice(3);
814
+ directory(args);
815
+ });
816
+
817
+ program
818
+ .command('dns <action>')
819
+ .description('Network DNS discovery (discover|resolve)')
820
+ .action((action) => {
821
+ const args = process.argv.slice(3);
822
+ dns(args);
823
+ });
824
+
825
+ program
826
+ .command('docs [query...]')
827
+ .description('Documentation search')
828
+ .action((query) => {
829
+ docs(query || []);
830
+ });
831
+
832
+ program
833
+ .command('exec-policy [action]')
834
+ .description('Exec policy management (show|preset|set)')
835
+ .action((action) => {
836
+ const args = process.argv.slice(3);
837
+ execPolicy(args);
838
+ });
839
+
840
+ program
841
+ .command('health [action]')
842
+ .description('Service health check')
843
+ .action((action) => {
844
+ const args = process.argv.slice(3);
845
+ health(args);
846
+ });
847
+
848
+ program
849
+ .command('infer [action]')
850
+ .description('Infer capabilities/models/media (models|media|capabilities|model run|auth|image|audio|tts|video|web|embedding)')
851
+ .action((action) => {
852
+ const args = process.argv.slice(3);
853
+ infer(args);
854
+ });
855
+
856
+ program
857
+ .command('node <action>')
858
+ .description('Node host management (run|status|install|uninstall|stop|restart)')
859
+ .action((action) => {
860
+ const args = process.argv.slice(3);
861
+ node(args);
862
+ });
863
+
864
+ program
865
+ .command('nodes [action]')
866
+ .description('Node network management (list|pending|approve|reject|remove|rename|status|describe|invoke|notify|push|canvas|camera|screen|location)')
867
+ .action((action) => {
868
+ const args = process.argv.slice(3);
869
+ nodes(args);
870
+ });
871
+
872
+ program
873
+ .command('onboard')
874
+ .description('Interactive onboarding wizard')
875
+ .action(() => {
876
+ onboard(process.argv.slice(3));
877
+ });
878
+
879
+ program
880
+ .command('proxy [action]')
881
+ .description('Debug proxy server (start|stop|status|run|coverage|sessions|query|blob|purge)')
882
+ .action((action) => {
883
+ const args = process.argv.slice(3);
884
+ proxy(args);
885
+ });
886
+
887
+ program
888
+ .command('qr [action]')
889
+ .description('QR code pairing (show|generate|verify)')
890
+ .action((action) => {
891
+ const args = process.argv.slice(3);
892
+ qr(args);
893
+ });
894
+
895
+ program
896
+ .command('sandbox <action>')
897
+ .description('Sandbox container management (list|create|destroy)')
898
+ .action((action) => {
899
+ sandbox([action]);
900
+ });
901
+
902
+ program
903
+ .command('secrets [action]')
904
+ .description('Secret value management (list|set|get|unset|audit|reload|configure|apply)')
905
+ .action((action) => {
906
+ const args = process.argv.slice(3);
907
+ secrets(args);
908
+ });
909
+
910
+ program
911
+ .command('system <action>')
912
+ .description('System status/heartbeat/presence (status|heartbeat|presence)')
913
+ .action((action) => {
914
+ system([action]);
915
+ });
916
+
917
+ program
918
+ .command('terminal <action> [text...]')
919
+ .description('Terminal session management (exec|connect|disconnect|list)')
920
+ .action((action, text) => {
921
+ terminal([action, ...(text || [])]);
922
+ });
923
+
924
+ program
925
+ .command('transcripts [action]')
926
+ .description('Transcript management (list|show|delete)')
927
+ .action((action) => {
928
+ const args = process.argv.slice(3);
929
+ transcripts(args);
930
+ });
931
+
932
+ program
933
+ .command('wiki [action] [params...]')
934
+ .description('Wiki/knowledge base (status|init|ingest|compile|lint|search|get|apply|doctor|bridge import|unsafe-local import|obsidian)')
935
+ .action((action, params) => {
936
+ wiki([action, ...(params || [])]);
937
+ });
938
+
939
+ program
940
+ .command('browser [action] [params...]')
941
+ .description('Browser automation (status|start|stop|tabs|open|close|navigate|screenshot|snapshot|click|type|press|resize|hover|drag|select|upload|fill|dialog|wait|evaluate|console|pdf|profiles|focus|reset-profile|create-profile|delete-profile)')
942
+ .action((action, params) => {
943
+ browser([action, ...(params || [])]);
944
+ });
945
+
946
+ program
947
+ .command('path [action] [params...]')
948
+ .description('nc:// URI path management (resolve|find|set|validate|emit)')
949
+ .action((action, params) => {
950
+ const pathCmd = require('../src/commands/path');
951
+ pathCmd([action, ...(params || [])]);
952
+ });
953
+
954
+ program
955
+ .command('clawbot [action] [params...]')
956
+ .description('Legacy clawbot namespace (qr)')
957
+ .action((action, params) => {
958
+ const clawbotCmd = require('../src/commands/clawbot');
959
+ clawbotCmd([action, ...(params || [])]);
960
+ });
961
+
962
+ // === OpenClaw uyumlu alias komutlar ===
963
+
964
+ program
965
+ .command('acp [file]')
966
+ .description('Alias for code command')
967
+ .action((file) => {
968
+ const codeCmd = require('../src/commands/code');
969
+ codeCmd(file, { dir: process.cwd() });
970
+ });
971
+
972
+ program
973
+ .command('web-fetch [url]')
974
+ .description('Fetch a URL and convert to markdown')
975
+ .action(async (url) => {
976
+ const webFetch = require('../src/commands/web-fetch');
977
+ await webFetch(url);
978
+ });
979
+
980
+ program
981
+ .command('help')
982
+ .description('Show help information')
983
+ .action(help);
984
+
985
+ // Yardım çıktısı için colors
986
+ program.configureHelp({
987
+ sortSubcommands: true,
988
+ showGlobalOptions: true,
989
+ });
990
+
991
+ // Global options
992
+ program
993
+ .option('--no-splash', 'Splash animasyonunu atla')
994
+ .option('--plain', 'Düz metin (renk ve animasyon yok)')
995
+ .option('--profile <name>', 'Farklı profil kullan (multi-account)')
996
+ .allowUnknownOption(); // kendi custom option'larımız için
997
+
998
+ // ════════════════════════════════════════════════════════════
999
+ // First-run akışı: setup yoksa otomatik wizard'a yönlendir
1000
+ // ════════════════════════════════════════════════════════════
1001
+ const path = require('path');
1002
+ const fs = require('fs');
1003
+ const os = require('os');
1004
+ const brand = require('../src/utils/branding');
1005
+ const tui = require('../src/utils/tui');
1006
+ tui.init();
1007
+ const { firstRunScreen } = brand;
1008
+
1009
+ const argv = process.argv.slice(2);
1010
+
1011
+ // Global option'ları filtrele — bunlar command değil
1012
+ const GLOBAL_FLAGS = ['--no-splash', '--plain', '--profile'];
1013
+ const realArgs = argv.filter(a => !GLOBAL_FLAGS.includes(a) && !a.startsWith('--profile='));
1014
+ const hasCommand = realArgs.length > 0;
1015
+ const CONFIG_DIR = path.join(os.homedir(), '.natureco');
1016
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
1017
+
1018
+ // Yardım/versiyon için asla first-run'a sokma
1019
+ const skipFirstRun = argv.includes('--help') || argv.includes('-h')
1020
+ || argv.includes('--version') || argv.includes('-V')
1021
+ || argv[0] === 'help' || argv[0] === 'setup' || argv[0] === 'update'
1022
+ || argv[0] === 'doctor' || argv[0] === 'uninstall';
1023
+
1024
+ // --no-splash flag'i ile splash atlanabilsin
1025
+ const noSplash = argv.includes('--no-splash') || process.env.NATURECO_NO_SPLASH;
1026
+
1027
+ function needsFirstRun() {
1028
+ try {
1029
+ if (!fs.existsSync(CONFIG_FILE)) return true;
1030
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
1031
+ return !cfg.setupCompleted;
1032
+ } catch {
1033
+ return true;
1034
+ }
1035
+ }
1036
+
1037
+ async function handleNoArgs() {
1038
+ if (!hasCommand) {
1039
+ // Splash animasyonu (sadece TTY'de ve --no-splash yoksa)
1040
+ if (!noSplash && tui.CAPS.isTTY && !process.env.CI) {
1041
+ await tui.splash({
1042
+ title: 'NatureCo CLI',
1043
+ version: packageJson.version,
1044
+ subtitle: 'OpenClaw\'dan daha güvenli, daha hızlı, daha ucuz',
1045
+ duration: 1200,
1046
+ });
1047
+ }
1048
+
1049
+ if (!skipFirstRun && needsFirstRun()) {
1050
+ if (tui.CAPS.isTTY && !noSplash) {
1051
+ console.log('\n' + tui.C.amber(' ⌥ İlk kurulum hoş geldin! Hızlıca ayarlayalım.\n'));
1052
+ } else {
1053
+ console.log(firstRunScreen());
1054
+ }
1055
+ const setup = require('../src/commands/setup');
1056
+ await setup(['wizard']);
1057
+ console.log('\n');
1058
+ const userName = require('os').userInfo().username;
1059
+ console.log(tui.welcomeCard({
1060
+ version: packageJson.version,
1061
+ user: { name: userName },
1062
+ status: tui.C.green('✓ Aktif'),
1063
+ tips: brand.pickDailyTip(),
1064
+ }));
1065
+ return;
1066
+ }
1067
+ // Normal kullanım — welcome card
1068
+ const userName = require('os').userInfo().username;
1069
+ let loginStatus = 'ok';
1070
+ try {
1071
+ if (fs.existsSync(CONFIG_FILE)) {
1072
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
1073
+ if (!cfg.providerApiKey && !cfg.apiKey) loginStatus = 'needed';
1074
+ } else {
1075
+ loginStatus = 'needed';
1076
+ }
1077
+ } catch { loginStatus = 'unknown'; }
1078
+ console.log('\n' + tui.welcomeCard({
1079
+ version: packageJson.version,
1080
+ user: { name: userName },
1081
+ status: loginStatus === 'ok' ? tui.C.green('✓ Aktif') : tui.C.amber('⚠ API key gerekli'),
1082
+ tips: brand.pickDailyTip(),
1083
+ }));
1084
+ return;
1085
+ }
1086
+ // Global option'ları filtrele (--no-splash, --plain, --profile) ve parse et
1087
+ const opts = program.opts();
1088
+ if (opts.profile) {
1089
+ process.env.NATURECO_PROFILE = opts.profile;
1090
+ // TODO: profile dizinini değiştir
1091
+ }
1092
+ if (opts.plain) {
1093
+ process.env.FORCE_COLOR = '0';
1094
+ process.env.NATURECO_NO_SPLASH = '1';
1095
+ }
1096
+ program.parse(process.argv);
1097
+ }
1098
+
1099
+ handleNoArgs();