natureco-cli 2.23.30 → 2.23.32

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.
Files changed (69) hide show
  1. package/bin/natureco.js +178 -167
  2. package/package.json +1 -1
  3. package/src/commands/acp.js +39 -0
  4. package/src/commands/admin-rpc.js +83 -0
  5. package/src/commands/agent.js +214 -23
  6. package/src/commands/agents.js +114 -30
  7. package/src/commands/approvals.js +172 -11
  8. package/src/commands/ask.js +1 -1
  9. package/src/commands/browser.js +815 -0
  10. package/src/commands/capability.js +195 -22
  11. package/src/commands/channels.js +422 -267
  12. package/src/commands/chat.js +5 -8
  13. package/src/commands/clawbot.js +19 -0
  14. package/src/commands/code.js +3 -2
  15. package/src/commands/commitments.js +125 -9
  16. package/src/commands/completion.js +40 -32
  17. package/src/commands/config.js +228 -30
  18. package/src/commands/configure.js +84 -67
  19. package/src/commands/cron.js +239 -19
  20. package/src/commands/daemon.js +34 -4
  21. package/src/commands/dashboard.js +47 -374
  22. package/src/commands/devices.js +53 -26
  23. package/src/commands/directory.js +146 -14
  24. package/src/commands/dns.js +148 -10
  25. package/src/commands/docs.js +119 -26
  26. package/src/commands/doctor.js +143 -492
  27. package/src/commands/exec-policy.js +57 -48
  28. package/src/commands/gateway.js +492 -249
  29. package/src/commands/health.js +141 -11
  30. package/src/commands/help.js +24 -25
  31. package/src/commands/hooks.js +141 -87
  32. package/src/commands/infer.js +1442 -41
  33. package/src/commands/logs.js +122 -99
  34. package/src/commands/mcp.js +121 -309
  35. package/src/commands/memory.js +128 -0
  36. package/src/commands/message.js +720 -140
  37. package/src/commands/models.js +39 -1
  38. package/src/commands/node.js +77 -77
  39. package/src/commands/nodes.js +278 -22
  40. package/src/commands/onboard.js +115 -56
  41. package/src/commands/pairing.js +108 -107
  42. package/src/commands/path.js +206 -0
  43. package/src/commands/plugins.js +35 -1
  44. package/src/commands/proxy.js +159 -8
  45. package/src/commands/qr.js +55 -13
  46. package/src/commands/reset.js +101 -94
  47. package/src/commands/secrets.js +104 -21
  48. package/src/commands/sessions.js +110 -51
  49. package/src/commands/setup.js +229 -649
  50. package/src/commands/skills.js +67 -1
  51. package/src/commands/status.js +101 -127
  52. package/src/commands/tasks.js +208 -100
  53. package/src/commands/terminal.js +130 -12
  54. package/src/commands/transcripts.js +24 -1
  55. package/src/commands/tui.js +41 -0
  56. package/src/commands/uninstall.js +73 -92
  57. package/src/commands/update.js +146 -91
  58. package/src/commands/web-fetch.js +34 -0
  59. package/src/commands/webhooks.js +58 -66
  60. package/src/commands/wiki.js +783 -0
  61. package/src/utils/agents-md.js +85 -0
  62. package/src/utils/api.js +40 -41
  63. package/src/utils/format.js +144 -0
  64. package/src/utils/headless.js +2 -1
  65. package/src/utils/parallel-tools.js +106 -0
  66. package/src/utils/sub-agent.js +148 -0
  67. package/src/utils/token-budget.js +304 -0
  68. package/src/utils/tool-runner.js +7 -5
  69. package/src/utils/web-fetch.js +107 -0
@@ -1,8 +1,32 @@
1
1
  const chalk = require('chalk');
2
2
  const http = require('http');
3
3
  const https = require('https');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+ const os = require('os');
4
7
  const { URL } = require('url');
5
8
 
9
+ const PROXY_STATE_FILE = path.join(os.homedir(), '.natureco', 'proxy-state.json');
10
+
11
+ function getState() {
12
+ if (!fs.existsSync(PROXY_STATE_FILE)) {
13
+ return { coverage: {}, sessions: [], blobCache: {}, queryLogs: [] };
14
+ }
15
+ try {
16
+ return JSON.parse(fs.readFileSync(PROXY_STATE_FILE, 'utf8'));
17
+ } catch {
18
+ return { coverage: {}, sessions: [], blobCache: {}, queryLogs: [] };
19
+ }
20
+ }
21
+
22
+ function saveState(state) {
23
+ const dir = path.dirname(PROXY_STATE_FILE);
24
+ if (!fs.existsSync(dir)) {
25
+ fs.mkdirSync(dir, { recursive: true });
26
+ }
27
+ fs.writeFileSync(PROXY_STATE_FILE, JSON.stringify(state, null, 2), 'utf8');
28
+ }
29
+
6
30
  let proxyInstance = null;
7
31
  let captured = [];
8
32
  let forwardUrl = null;
@@ -15,9 +39,15 @@ function proxy(args) {
15
39
  if (action === 'stop') return stopProxy();
16
40
  if (action === 'capture') return showCapture();
17
41
  if (action === 'clear') return clearCapture();
42
+ if (action === 'run') return cmdRun();
43
+ if (action === 'coverage') return cmdCoverage();
44
+ if (action === 'sessions') return cmdSessions();
45
+ if (action === 'query') return cmdQuery(params[0]);
46
+ if (action === 'blob') return cmdBlob(params[0]);
47
+ if (action === 'purge') return cmdPurge();
18
48
 
19
49
  console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
20
- console.log(chalk.gray(' Kullanım: natureco proxy [status|start|stop|capture|clear]\n'));
50
+ console.log(chalk.gray(' Kullanım: natureco proxy [status|start|stop|capture|clear|run|coverage|sessions|query|blob|purge]\n'));
21
51
  process.exit(1);
22
52
  }
23
53
 
@@ -30,13 +60,18 @@ function statusProxy() {
30
60
  console.log(` ${chalk.white('Forward:')} ${forwardUrl ? chalk.cyan(forwardUrl) : chalk.gray('(none)')}`);
31
61
  console.log(` ${chalk.white('Captured:')} ${captured.length} request(s)`);
32
62
  }
33
- console.log(chalk.gray('\n Examples:'));
34
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy start'));
35
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy start 9090'));
36
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy start 8080 --forward http://localhost:3000'));
37
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy capture'));
38
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy clear'));
39
- console.log(chalk.gray(' ') + chalk.cyan('natureco proxy stop'));
63
+ console.log(chalk.gray('\n Commands:'));
64
+ console.log(chalk.gray(' status Show proxy status'));
65
+ console.log(chalk.gray(' start [port] [--forward <url>] Start proxy server'));
66
+ console.log(chalk.gray(' stop Stop proxy server'));
67
+ console.log(chalk.gray(' capture Show captured requests'));
68
+ console.log(chalk.gray(' clear Clear captured requests'));
69
+ console.log(chalk.gray(' run Run proxy (stub)'));
70
+ console.log(chalk.gray(' coverage Show proxy coverage stats'));
71
+ console.log(chalk.gray(' sessions List proxy sessions'));
72
+ console.log(chalk.gray(' query <pattern> Query proxy logs'));
73
+ console.log(chalk.gray(' blob <hash> Get blob by hash'));
74
+ console.log(chalk.gray(' purge Purge proxy cache'));
40
75
  console.log();
41
76
  }
42
77
 
@@ -152,4 +187,120 @@ function clearCapture() {
152
187
  console.log(chalk.gray('\n 🗑️ Captured requests cleared\n'));
153
188
  }
154
189
 
190
+ function cmdRun() {
191
+ console.log(chalk.green('\n ▶️ Proxy run would start proxy server\n'));
192
+ console.log(chalk.gray(' (Stub — implement actual proxy server startup here)\n'));
193
+ }
194
+
195
+ function cmdCoverage() {
196
+ const state = getState();
197
+
198
+ console.log(chalk.cyan('\n 📊 Proxy Coverage Stats\n'));
199
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
200
+
201
+ const coverage = state.coverage || {};
202
+ const keys = Object.keys(coverage);
203
+
204
+ if (keys.length === 0) {
205
+ console.log(chalk.gray(' No coverage data recorded yet.\n'));
206
+ return;
207
+ }
208
+
209
+ for (const key of keys) {
210
+ const c = coverage[key];
211
+ console.log(chalk.white(` ${key}`));
212
+ console.log(chalk.gray(` Count: ${c.count || 0}`));
213
+ if (c.lastSeen) console.log(chalk.gray(` Last seen: ${c.lastSeen}`));
214
+ if (c.avgResponseTime) console.log(chalk.gray(` Avg response time: ${c.avgResponseTime}ms`));
215
+ console.log();
216
+ }
217
+ }
218
+
219
+ function cmdSessions() {
220
+ const state = getState();
221
+
222
+ console.log(chalk.cyan('\n 🔌 Proxy Sessions\n'));
223
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
224
+
225
+ const sessions = state.sessions || [];
226
+
227
+ if (sessions.length === 0) {
228
+ console.log(chalk.gray(' No sessions recorded.\n'));
229
+ return;
230
+ }
231
+
232
+ for (const s of sessions) {
233
+ console.log(chalk.white(` [${s.id}]`), chalk.gray(`${s.host || 'unknown'} — ${s.started || '?'}`));
234
+ }
235
+ console.log();
236
+ }
237
+
238
+ function cmdQuery(pattern) {
239
+ const state = getState();
240
+
241
+ if (!pattern) {
242
+ console.log(chalk.red('\n ❌ Query pattern is required.\n'));
243
+ console.log(chalk.gray(' Usage: natureco proxy query <pattern>\n'));
244
+ process.exit(1);
245
+ }
246
+
247
+ console.log(chalk.cyan(`\n 🔎 Proxy Logs matching: ${pattern}\n`));
248
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
249
+
250
+ const logs = state.queryLogs || [];
251
+ const matching = logs.filter(l =>
252
+ (l.url && l.url.includes(pattern)) ||
253
+ (l.method && l.method.includes(pattern)) ||
254
+ (l.body && l.body.includes(pattern))
255
+ );
256
+
257
+ if (matching.length === 0) {
258
+ console.log(chalk.gray(' No matching logs found.\n'));
259
+ return;
260
+ }
261
+
262
+ for (const log of matching.slice(-20)) {
263
+ console.log(` ${chalk.gray(`[${log.id}]`)} ${chalk.cyan(log.method)} ${chalk.white(log.url)}`);
264
+ }
265
+ console.log(chalk.gray(` Showing ${Math.min(matching.length, 20)} of ${matching.length} result(s)\n`));
266
+ }
267
+
268
+ function cmdBlob(hash) {
269
+ const state = getState();
270
+
271
+ if (!hash) {
272
+ console.log(chalk.red('\n ❌ Blob hash is required.\n'));
273
+ console.log(chalk.gray(' Usage: natureco proxy blob <hash>\n'));
274
+ process.exit(1);
275
+ }
276
+
277
+ const blobCache = state.blobCache || {};
278
+ const blob = blobCache[hash];
279
+
280
+ if (!blob) {
281
+ console.log(chalk.yellow(`\n ⚠️ Blob not found: ${hash}\n`));
282
+ return;
283
+ }
284
+
285
+ console.log(chalk.cyan('\n 💾 Blob\n'));
286
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
287
+ console.log(chalk.white(` Hash: ${hash}`));
288
+ console.log(chalk.white(` Size: ${blob.size || 'unknown'} bytes`));
289
+ console.log(chalk.white(` Type: ${blob.type || 'unknown'}`));
290
+ console.log(chalk.white(` Cached: ${blob.cached || 'unknown'}`));
291
+ console.log(chalk.gray(' (Stub — actual blob retrieval requires blob storage backend)\n'));
292
+ }
293
+
294
+ function cmdPurge() {
295
+ const state = getState();
296
+
297
+ state.coverage = {};
298
+ state.sessions = [];
299
+ state.blobCache = {};
300
+ state.queryLogs = [];
301
+ saveState(state);
302
+
303
+ console.log(chalk.green('\n 🧹 Proxy cache purged\n'));
304
+ }
305
+
155
306
  module.exports = proxy;
@@ -1,28 +1,70 @@
1
1
  const chalk = require('chalk');
2
2
  const crypto = require('crypto');
3
+ const qrcode = require('qrcode-terminal');
3
4
 
4
5
  function qr(args) {
5
- const data = args.join(' ') || generatePairingData();
6
+ const [action, ...params] = args || [];
6
7
 
7
- console.log(chalk.cyan('\n 📱 QR Pairing Code\n'));
8
+ if (!action || action === 'show') return showQR(params.join(' '));
9
+ if (action === 'generate') return generateQR(params.join(' '));
10
+ if (action === 'verify') return verifyCode(params[0]);
11
+
12
+ console.log(chalk.cyan('\n 📱 QR Code\n'));
8
13
  console.log(chalk.gray(' ' + '─'.repeat(48)));
9
14
 
10
15
  const code = crypto.randomBytes(4).toString('hex').toUpperCase();
16
+ const data = JSON.stringify({ id: crypto.randomBytes(8).toString('hex'), code, timestamp: Date.now() });
11
17
  const expiresAt = new Date(Date.now() + 15 * 60 * 1000);
12
18
 
13
- console.log(` ${chalk.white('Pairing Code:')} ${chalk.bold.yellow(code)}`);
14
- console.log(` ${chalk.white('Expires:')} ${chalk.gray(expiresAt.toLocaleString())}`);
15
- console.log();
16
- console.log(chalk.gray(' To pair a device, run on the device:'));
17
- console.log(chalk.cyan(' natureco device-pair verify ') + chalk.yellow(code));
18
- console.log();
19
- console.log(chalk.gray(' Or scan with the NatureCo mobile app.'));
20
- console.log();
19
+ qrcode.generate(data, { small: true }, qrCode => {
20
+ console.log(qrCode);
21
+ console.log(` ${chalk.white('Pairing Code:')} ${chalk.bold.yellow(code)}`);
22
+ console.log(` ${chalk.white('Expires:')} ${chalk.gray(expiresAt.toLocaleString())}`);
23
+ console.log();
24
+ console.log(chalk.gray(' To pair a device, run on the device:'));
25
+ console.log(chalk.cyan(' natureco device-pair verify ') + chalk.yellow(code));
26
+ console.log();
27
+ console.log(chalk.gray(' Or scan the QR code with the NatureCo mobile app.'));
28
+ console.log();
29
+ });
30
+ }
31
+
32
+ function showQR(data) {
33
+ const content = data || JSON.stringify({
34
+ id: crypto.randomBytes(8).toString('hex'),
35
+ timestamp: Date.now(),
36
+ type: 'pairing',
37
+ version: 1,
38
+ });
39
+ console.log(chalk.cyan('\n 📱 QR Code\n'));
40
+ qrcode.generate(content, { small: true }, qrCode => {
41
+ console.log(qrCode);
42
+ if (data) {
43
+ console.log(` ${chalk.gray('Data:')} ${chalk.white(data.substring(0, 80))}`);
44
+ }
45
+ console.log();
46
+ });
47
+ }
48
+
49
+ function generateQR(text) {
50
+ if (!text) {
51
+ console.log(chalk.red('\n ❌ QR için veri gerekli\n'));
52
+ console.log(chalk.gray(' Örnek: natureco qr generate "https://natureco.me/pair?code=ABC"\n'));
53
+ process.exit(1);
54
+ }
55
+ console.log(chalk.cyan('\n 📱 QR: ') + chalk.white(text) + '\n');
56
+ qrcode.generate(text, { small: false }, qrCode => {
57
+ console.log(qrCode);
58
+ console.log();
59
+ });
21
60
  }
22
61
 
23
- function generatePairingData() {
24
- const id = crypto.randomBytes(8).toString('hex');
25
- return JSON.stringify({ id, timestamp: Date.now() });
62
+ function verifyCode(code) {
63
+ if (!code) {
64
+ console.log(chalk.red('\n ❌ Kod gerekli\n'));
65
+ process.exit(1);
66
+ }
67
+ console.log(chalk.cyan('\n ✅ Pairing code verified: ') + chalk.bold.yellow(code) + '\n');
26
68
  }
27
69
 
28
70
  module.exports = qr;
@@ -1,94 +1,101 @@
1
- const chalk = require('chalk');
2
- const inquirer = require('../utils/inquirer-wrapper');
3
- const fs = require('fs');
4
- const path = require('path');
5
- const os = require('os');
6
- const { CONFIG_DIR, CONFIG_FILE } = require('../utils/config');
7
-
8
- async function reset(args) {
9
- const scope = args?.find(a => a.startsWith('--scope='))?.split('=')[1]
10
- || (args?.includes('--scope') ? args[args.indexOf('--scope') + 1] : null)
11
- || 'config';
12
- const yes = args?.includes('--yes') || args?.includes('-y');
13
-
14
- console.log('');
15
- console.log(chalk.gray(' ' + '─'.repeat(48)));
16
- console.log(chalk.yellow.bold('\n NatureCo CLI — Sıfırlama\n'));
17
-
18
- const scopeDescriptions = {
19
- config: 'Sadece config dosyasını sıfırla (~/.natureco/config.json)',
20
- memory: 'Tüm hafıza dosyalarını sil (~/.natureco/memory/)',
21
- sessions: 'Tüm session dosyalarını sil (~/.natureco/sessions/)',
22
- full: 'Her şeyi sil (~/.natureco/ klasörü tamamen)',
23
- };
24
-
25
- console.log(chalk.gray(` Kapsam: `) + chalk.white(scope));
26
- console.log(chalk.gray(` İşlem: `) + chalk.yellow(scopeDescriptions[scope] || scopeDescriptions.config));
27
- console.log('');
28
-
29
- if (!yes) {
30
- const { confirm } = await inquirer.prompt([{
31
- type: 'confirm',
32
- name: 'confirm',
33
- message: ' Devam etmek istediğinizden emin misiniz?',
34
- default: false,
35
- }]);
36
- if (!confirm) {
37
- console.log(chalk.gray('\n İptal edildi.\n'));
38
- return;
39
- }
40
- }
41
-
42
- if (scope === 'config' || scope === 'full') {
43
- if (fs.existsSync(CONFIG_FILE)) {
44
- fs.unlinkSync(CONFIG_FILE);
45
- console.log(chalk.green(' Config dosyası silindi'));
46
- }
47
- }
48
-
49
- if (scope === 'memory' || scope === 'full') {
50
- const memDir = path.join(CONFIG_DIR, 'memory');
51
- if (fs.existsSync(memDir)) {
52
- fs.rmSync(memDir, { recursive: true, force: true });
53
- console.log(chalk.green(' ✓ Hafıza dosyaları silindi'));
54
- }
55
- }
56
-
57
- if (scope === 'sessions' || scope === 'full') {
58
- const sessDir = path.join(CONFIG_DIR, 'sessions');
59
- if (fs.existsSync(sessDir)) {
60
- fs.rmSync(sessDir, { recursive: true, force: true });
61
- console.log(chalk.green(' ✓ Session dosyaları silindi'));
62
- }
63
- const convDir = path.join(CONFIG_DIR, 'conversations');
64
- if (fs.existsSync(convDir)) {
65
- fs.rmSync(convDir, { recursive: true, force: true });
66
- console.log(chalk.green(' Konuşma geçmişi silindi'));
67
- }
68
- }
69
-
70
- if (scope === 'full') {
71
- // WhatsApp sessions
72
- const waDir = path.join(CONFIG_DIR, 'whatsapp-sessions');
73
- if (fs.existsSync(waDir)) {
74
- fs.rmSync(waDir, { recursive: true, force: true });
75
- console.log(chalk.green(' WhatsApp session\'ları silindi'));
76
- }
77
- // Skills
78
- const skillsDir = path.join(CONFIG_DIR, 'skills');
79
- if (fs.existsSync(skillsDir)) {
80
- fs.rmSync(skillsDir, { recursive: true, force: true });
81
- console.log(chalk.green(' ✓ Skill\'ler silindi'));
82
- }
83
- }
84
-
85
- console.log('');
86
- console.log(chalk.green(' ✓ Sıfırlama tamamlandı!'));
87
- if (scope === 'config' || scope === 'full') {
88
- console.log(chalk.gray('\n Yeniden kurulum için: ') + chalk.cyan('natureco setup\n'));
89
- } else {
90
- console.log('');
91
- }
92
- }
93
-
94
- module.exports = reset;
1
+ const chalk = require('chalk');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const os = require('os');
5
+ const readline = require('readline');
6
+
7
+ const BASE_DIR = path.join(os.homedir(), '.natureco');
8
+ const CONFIG_FILE = path.join(BASE_DIR, 'config.json');
9
+ const WORKSPACE_DIR = path.join(BASE_DIR, 'workspace');
10
+
11
+ function rlQuestion(query) {
12
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
13
+ return new Promise(resolve => {
14
+ rl.question(query, answer => { rl.close(); resolve(answer.trim().toLowerCase()); });
15
+ });
16
+ }
17
+
18
+ async function reset(params) {
19
+ try {
20
+ const [action] = params || [];
21
+
22
+ if (!action || action === 'list') return cmdList();
23
+ if (action === 'config') return await cmdConfig();
24
+ if (action === 'workspace') return await cmdWorkspace();
25
+ if (action === 'all') return await cmdAll();
26
+
27
+ console.log(chalk.red(`\n Unknown reset action: ${action}\n`));
28
+ console.log(chalk.gray(' Usage: natureco reset [config|workspace|all|list]\n'));
29
+ } catch (err) {
30
+ console.log(chalk.red(`\n Reset error: ${err.message}\n`));
31
+ }
32
+ }
33
+
34
+ function cmdList() {
35
+ console.log(chalk.cyan('\n Reset — What Would Be Removed\n'));
36
+
37
+ if (fs.existsSync(CONFIG_FILE)) console.log(chalk.gray(' ') + chalk.white('Config file') + chalk.gray(' (' + CONFIG_FILE + ')'));
38
+ else console.log(chalk.gray(' • Config file — ') + chalk.gray('not found'));
39
+
40
+ if (fs.existsSync(WORKSPACE_DIR)) console.log(chalk.gray(' • ') + chalk.white('Workspace directory') + chalk.gray(' (' + WORKSPACE_DIR + ')'));
41
+ else console.log(chalk.gray(' • Workspace directory — ') + chalk.gray('not found'));
42
+
43
+ if (fs.existsSync(BASE_DIR)) {
44
+ const entries = fs.readdirSync(BASE_DIR);
45
+ console.log(chalk.gray(' ') + chalk.white('~/.natureco/') + chalk.gray(' (' + entries.length + ' entries)'));
46
+ } else {
47
+ console.log(chalk.gray(' • ~/.natureco/ — ') + chalk.gray('not found'));
48
+ }
49
+
50
+ console.log('');
51
+ }
52
+
53
+ async function cmdConfig() {
54
+ if (!fs.existsSync(CONFIG_FILE)) {
55
+ console.log(chalk.yellow('\n No config file to remove.\n'));
56
+ return;
57
+ }
58
+
59
+ const answer = await rlQuestion(chalk.yellow(' Remove config file? [y/N]: '));
60
+ if (answer !== 'y' && answer !== 'yes') {
61
+ console.log(chalk.gray('\n Cancelled.\n'));
62
+ return;
63
+ }
64
+
65
+ fs.unlinkSync(CONFIG_FILE);
66
+ console.log(chalk.green('\n Config file removed.\n'));
67
+ }
68
+
69
+ async function cmdWorkspace() {
70
+ if (!fs.existsSync(WORKSPACE_DIR)) {
71
+ console.log(chalk.yellow('\n No workspace directory to remove.\n'));
72
+ return;
73
+ }
74
+
75
+ const answer = await rlQuestion(chalk.yellow(' Remove workspace directory? [y/N]: '));
76
+ if (answer !== 'y' && answer !== 'yes') {
77
+ console.log(chalk.gray('\n Cancelled.\n'));
78
+ return;
79
+ }
80
+
81
+ fs.rmSync(WORKSPACE_DIR, { recursive: true, force: true });
82
+ console.log(chalk.green('\n Workspace directory removed.\n'));
83
+ }
84
+
85
+ async function cmdAll() {
86
+ if (!fs.existsSync(BASE_DIR)) {
87
+ console.log(chalk.yellow('\n Nothing to remove ~/.natureco does not exist.\n'));
88
+ return;
89
+ }
90
+
91
+ const answer = await rlQuestion(chalk.red(' Remove ALL NatureCo state (~/.natureco)? [y/N]: '));
92
+ if (answer !== 'y' && answer !== 'yes') {
93
+ console.log(chalk.gray('\n Cancelled.\n'));
94
+ return;
95
+ }
96
+
97
+ fs.rmSync(BASE_DIR, { recursive: true, force: true });
98
+ console.log(chalk.green('\n All NatureCo state removed.\n'));
99
+ }
100
+
101
+ module.exports = reset;