natureco-cli 5.6.16 → 5.6.17

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