aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-fs.js')
-rw-r--r--modules/core/module-fs.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js
index f93553a..fd1dfc1 100644
--- a/modules/core/module-fs.js
+++ b/modules/core/module-fs.js
@@ -72,6 +72,22 @@ class FileSystemModule {
if (!capturing && typeof this.terminal.printClickable === 'function') this.terminal.printClickable(filtered);
}
};
+ this.commands['guides'] = (args) => {
+ // v4.6.63: /guides/ was reachable by nobody — the AI writes guides there, and the
+ // only way to find one was to guess its filename (packet §7). One command, newest first.
+ let items = [];
+ try { items = this.terminal.fs.readDir('/guides') || []; } catch (e) { items = []; }
+ const docs = items
+ .filter(f => f && f.type !== 'dir' && /\.(html?|md|txt)$/i.test(f.name))
+ .sort((a, b) => (b.mtime || 0) - (a.mtime || 0));
+ if (!docs.length) {
+ this.terminal.print('No guides in /guides/ yet.', 'info');
+ this.terminal.print(' Guides written by the AI land here — `guides` lists them, `preview <name>` renders HTML, `cat <name>` shows markdown.', 'text-muted');
+ return;
+ }
+ this.terminal.print(`📚 Guides (${docs.length}) — preview <name> for HTML, cat <name> for markdown`, 'header');
+ docs.forEach(f => this.terminal.print(` ${f.name} ${f.size || 0} B`, 'info'));
+ };
this.commands['cat'] = (args) => {
if(!args[0]) return this.terminal.print('Usage: cat <filename>', 'warning');
const content = this.terminal.fs.readFile(args[0]);