typescript-virtual-container 1.5.11 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +236 -456
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/Honeypot/index.d.ts +9 -0
  4. package/dist/Honeypot/index.js +57 -0
  5. package/dist/SSHMimic/exec.d.ts +4 -0
  6. package/dist/SSHMimic/exec.js +4 -0
  7. package/dist/SSHMimic/executor.d.ts +10 -1
  8. package/dist/SSHMimic/executor.js +18 -8
  9. package/dist/SSHMimic/hostKey.d.ts +5 -0
  10. package/dist/SSHMimic/hostKey.js +5 -0
  11. package/dist/SSHMimic/loginBanner.d.ts +7 -0
  12. package/dist/SSHMimic/loginBanner.js +4 -0
  13. package/dist/SSHMimic/loginFormat.d.ts +4 -0
  14. package/dist/SSHMimic/loginFormat.js +4 -0
  15. package/dist/SSHMimic/prompt.d.ts +9 -0
  16. package/dist/SSHMimic/prompt.js +9 -0
  17. package/dist/SSHMimic/scp.d.ts +18 -0
  18. package/dist/SSHMimic/scp.js +14 -0
  19. package/dist/VirtualFileSystem/binaryPack.d.ts +7 -3
  20. package/dist/VirtualFileSystem/binaryPack.js +32 -10
  21. package/dist/VirtualFileSystem/index.d.ts +29 -0
  22. package/dist/VirtualFileSystem/index.js +126 -5
  23. package/dist/VirtualFileSystem/internalTypes.d.ts +4 -0
  24. package/dist/VirtualFileSystem/journal.d.ts +10 -4
  25. package/dist/VirtualFileSystem/journal.js +12 -2
  26. package/dist/VirtualFileSystem/path.d.ts +23 -1
  27. package/dist/VirtualFileSystem/path.js +23 -3
  28. package/dist/VirtualPackageManager/index.js +1 -1
  29. package/dist/VirtualShell/index.d.ts +3 -0
  30. package/dist/VirtualShell/index.js +12 -3
  31. package/dist/VirtualUserManager/index.d.ts +20 -1
  32. package/dist/VirtualUserManager/index.js +52 -15
  33. package/dist/commands/bc.d.ts +5 -0
  34. package/dist/commands/bc.js +5 -0
  35. package/dist/commands/cat.js +2 -2
  36. package/dist/commands/chgrp.d.ts +7 -0
  37. package/dist/commands/chgrp.js +42 -0
  38. package/dist/commands/chown.d.ts +7 -0
  39. package/dist/commands/chown.js +79 -0
  40. package/dist/commands/cp.js +4 -3
  41. package/dist/commands/dd.d.ts +7 -0
  42. package/dist/commands/dd.js +60 -0
  43. package/dist/commands/declare.js +0 -2
  44. package/dist/commands/expr.d.ts +7 -0
  45. package/dist/commands/expr.js +63 -0
  46. package/dist/commands/fun.d.ts +5 -0
  47. package/dist/commands/fun.js +5 -1
  48. package/dist/commands/help.d.ts +5 -0
  49. package/dist/commands/help.js +5 -0
  50. package/dist/commands/helpers.d.ts +43 -0
  51. package/dist/commands/helpers.js +61 -0
  52. package/dist/commands/id.d.ts +5 -0
  53. package/dist/commands/id.js +5 -0
  54. package/dist/commands/ip.d.ts +1 -0
  55. package/dist/commands/ip.js +50 -23
  56. package/dist/commands/jobs.js +43 -9
  57. package/dist/commands/kill.d.ts +1 -0
  58. package/dist/commands/kill.js +13 -5
  59. package/dist/commands/last.js +1 -1
  60. package/dist/commands/ln.d.ts +5 -0
  61. package/dist/commands/ln.js +5 -0
  62. package/dist/commands/ls.d.ts +5 -0
  63. package/dist/commands/ls.js +19 -4
  64. package/dist/commands/lsb-release.js +1 -1
  65. package/dist/commands/man.d.ts +5 -0
  66. package/dist/commands/man.js +5 -0
  67. package/dist/commands/manuals-bundle.js +242 -0
  68. package/dist/commands/miscutils.d.ts +43 -0
  69. package/dist/commands/miscutils.js +233 -0
  70. package/dist/commands/mkdir.js +3 -2
  71. package/dist/commands/mv.js +4 -3
  72. package/dist/commands/netcat.d.ts +7 -0
  73. package/dist/commands/netcat.js +64 -0
  74. package/dist/commands/nice.d.ts +7 -0
  75. package/dist/commands/nice.js +22 -0
  76. package/dist/commands/nohup.d.ts +7 -0
  77. package/dist/commands/nohup.js +18 -0
  78. package/dist/commands/ping.d.ts +2 -1
  79. package/dist/commands/ping.js +46 -8
  80. package/dist/commands/procUtils.d.ts +13 -0
  81. package/dist/commands/procUtils.js +72 -0
  82. package/dist/commands/pwd.d.ts +5 -0
  83. package/dist/commands/pwd.js +5 -0
  84. package/dist/commands/python.js +0 -4
  85. package/dist/commands/read.js +0 -1
  86. package/dist/commands/registry.d.ts +37 -0
  87. package/dist/commands/registry.js +73 -0
  88. package/dist/commands/rm.js +3 -2
  89. package/dist/commands/runtime.d.ts +47 -1
  90. package/dist/commands/runtime.js +60 -5
  91. package/dist/commands/sh.d.ts +5 -0
  92. package/dist/commands/sh.js +5 -0
  93. package/dist/commands/stat.js +3 -2
  94. package/dist/commands/strace.js +0 -1
  95. package/dist/commands/sysinfo.d.ts +19 -0
  96. package/dist/commands/sysinfo.js +73 -0
  97. package/dist/commands/test.d.ts +5 -0
  98. package/dist/commands/test.js +5 -0
  99. package/dist/commands/textutils.d.ts +25 -0
  100. package/dist/commands/textutils.js +171 -0
  101. package/dist/commands/top.d.ts +7 -0
  102. package/dist/commands/top.js +54 -0
  103. package/dist/commands/touch.js +6 -2
  104. package/dist/commands/tr.d.ts +5 -0
  105. package/dist/commands/tr.js +5 -0
  106. package/dist/commands/w.js +1 -1
  107. package/dist/commands/which.d.ts +5 -0
  108. package/dist/commands/which.js +5 -0
  109. package/dist/index.d.ts +10 -2
  110. package/dist/index.js +4 -0
  111. package/dist/modules/VirtualNetworkManager.d.ts +54 -0
  112. package/dist/modules/VirtualNetworkManager.js +144 -0
  113. package/dist/modules/linuxRootfs.d.ts +4 -3
  114. package/dist/modules/linuxRootfs.js +115 -74
  115. package/dist/modules/neofetch.d.ts +2 -0
  116. package/dist/modules/neofetch.js +3 -2
  117. package/dist/modules/pacmanGame.d.ts +2 -0
  118. package/dist/modules/pacmanGame.js +1 -0
  119. package/dist/modules/shellInteractive.d.ts +2 -0
  120. package/dist/modules/shellInteractive.js +2 -0
  121. package/dist/modules/shellRuntime.d.ts +7 -0
  122. package/dist/modules/shellRuntime.js +6 -0
  123. package/dist/modules/webTermRenderer.js +0 -7
  124. package/dist/types/commands.d.ts +1 -1
  125. package/dist/types/vfs.d.ts +8 -0
  126. package/dist/utils/argv.d.ts +22 -3
  127. package/dist/utils/argv.js +22 -3
  128. package/dist/utils/perfLogger.d.ts +10 -2
  129. package/dist/utils/perfLogger.js +7 -14
  130. package/dist/utils/shellSession.d.ts +35 -0
  131. package/dist/utils/shellSession.js +35 -0
  132. package/package.json +1 -1
package/README.md CHANGED
@@ -12,29 +12,12 @@
12
12
 
13
13
  ## Table of Contents
14
14
 
15
- - [Three ways to run](#three-ways-to-run)
16
- - [Get Started](#get-started)
17
- - [Install](#install)
18
- - [Try instantly (zero install)](#try-instantly-zero-install)
19
- - [SSH server](#ssh-server)
20
- - [Web shell (browser)](#web-shell-browser)
21
- - [Programmatic API](#programmatic-api)
22
- - [How It Works](#how-it-works)
23
- - [API Reference](#api-reference)
24
- - [Examples](#examples)
25
- - [Built-in Commands (127)](#built-in-commands-127)
26
- - [Shell Scripting](#shell-scripting)
27
- - [Linux Rootfs & VFS PATH Resolution](#linux-rootfs--vfs-path-resolution)
28
- - [Configuration](#configuration)
29
- - [Performance & Scalability](#performance--scalability)
30
- - [Types & TypeScript](#types--typescript)
31
- - [Troubleshooting](#troubleshooting)
32
- - [FAQ](#faq)
33
- - [Contributing](#contributing)
34
- - [Security](#security)
35
- - [Compatibility](#compatibility)
36
- - [License](#license)
37
- - [Roadmap](#roadmap)
15
+ - [Three ways to run](#three-ways-to-run) · [Get Started](#get-started)
16
+ - [How It Works](#how-it-works) · [Built-in Commands](#built-in-commands-149)
17
+ - [Shell Scripting](#shell-scripting) · [Linux Rootfs](#linux-rootfs--vfs-path-resolution)
18
+ - [Configuration](#configuration) · [Troubleshooting](#troubleshooting)
19
+ - [FAQ](#faq) · [Contributing](#contributing)
20
+ - [License](#license) · [Roadmap](#roadmap)
38
21
 
39
22
  ---
40
23
 
@@ -44,8 +27,8 @@
44
27
  | Mode | Entry point | Use case |
45
28
  |------|-------------|----------|
46
29
  | **SSH/SFTP server** | `VirtualSshServer` / `VirtualSftpServer` | Honeypots, remote testing, training environments |
47
- | **Web shell** | `builds/fortune-nyx-v1.5.11-web.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
48
- | **Standalone CLI** | `builds/fortune-nyx-v1.5.11-directbash-k6.1.0.mjs` (single file) | Local shell, one-liner demos, no install required |
30
+ | **Web shell** | `builds/fortune-nyx-v1.6.0-web.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
31
+ | **Standalone CLI** | `builds/fortune-nyx-v1.6.0-directbash-k6.1.0.mjs` (single file) | Local shell, one-liner demos, no install required |
49
32
  <!-- /BUILD:mode-table -->
50
33
 
51
34
  All three modes share the same core: a pure in-memory VFS, a real shell interpreter, a virtual package manager, and a typed programmatic API.
@@ -66,22 +49,22 @@ npm install typescript-virtual-container
66
49
  <!-- BUILD:curl-start -->
67
50
  #### Interactive local shell — persists VFS in .vfs/ in the current directory
68
51
  ```bash
69
- curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.11-directbash-k6.1.0.mjs -o fortune-nyx-v1.5.11-directbash-k6.1.0.mjs && node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs
52
+ curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.6.0-directbash-k6.1.0.mjs -o fortune-nyx-v1.6.0-directbash-k6.1.0.mjs && node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs
70
53
  ```
71
54
 
72
55
  #### SSH server with built-in SFTP subsystem (scp / sftp on port 2222)
73
56
  ```bash
74
- curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.11-ssh.cjs -o fortune-nyx-v1.5.11-ssh.cjs && node fortune-nyx-v1.5.11-ssh.cjs
57
+ curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.6.0-ssh.cjs -o fortune-nyx-v1.6.0-ssh.cjs && node fortune-nyx-v1.6.0-ssh.cjs
75
58
  ```
76
59
 
77
60
  #### Custom SSH port
78
61
  ```bash
79
- node fortune-nyx-v1.5.11-ssh.cjs --ssh-port=2022
62
+ node fortune-nyx-v1.6.0-ssh.cjs --ssh-port=2022
80
63
  ```
81
64
 
82
65
  #### SSH disabled (handler only, no server started)
83
66
  ```bash
84
- node fortune-nyx-v1.5.11-ssh.cjs --no-ssh
67
+ node fortune-nyx-v1.6.0-ssh.cjs --no-ssh
85
68
  ```
86
69
  <!-- /BUILD:curl-start -->
87
70
 
@@ -89,16 +72,16 @@ node fortune-nyx-v1.5.11-ssh.cjs --no-ssh
89
72
  > The standalone builds are intended for quick demos and testing. For production use, it's recommended to install the package and import the relevant classes directly in your codebase for better performance, stability, and security.
90
73
 
91
74
  <!-- BUILD:selfStandalone-options -->
92
- **`fortune-nyx-v1.5.11-directbash-k6.1.0.mjs` options:**
75
+ **`fortune-nyx-v1.6.0-directbash-k6.1.0.mjs` options:**
93
76
 
94
77
  ```bash
95
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs # boot as root
96
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --user alice # boot as alice (prompts for password if set)
97
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --user=alice # same, inline form
98
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --hostname=my-box # custom hostname
99
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --snapshot=/data/.vfs # custom VFS snapshot path
100
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --help # show all options
101
- node fortune-nyx-v1.5.11-directbash-k6.1.0.mjs --version # print version
78
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs # boot as root
79
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --user alice # boot as alice (prompts for password if set)
80
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --user=alice # same, inline form
81
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --hostname=my-box # custom hostname
82
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --snapshot=/data/.vfs # custom VFS snapshot path
83
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --help # show all options
84
+ node fortune-nyx-v1.6.0-directbash-k6.1.0.mjs --version # print version
102
85
  ```
103
86
  <!-- /BUILD:selfStandalone-options -->
104
87
 
@@ -125,7 +108,7 @@ Two browser bundles are available:
125
108
  <!-- BUILD:web-table -->
126
109
  | Bundle | Format | Entry point | Use case |
127
110
  |--------|--------|-------------|----------|
128
- | `builds/fortune-nyx-v1.5.11-web.min.js` | ESM | `createWebShell()` | Embedded terminals, modern bundlers |
111
+ | `builds/fortune-nyx-v1.6.0-web.min.js` | ESM | `createWebShell()` | Embedded terminals, modern bundlers |
129
112
  <!-- /BUILD:web-table -->
130
113
 
131
114
  Both bundles persist the VFS in **IndexedDB** — state survives page reloads.
@@ -137,11 +120,11 @@ bun run build-all # rebuild everything
137
120
  ```
138
121
 
139
122
  <!-- BUILD:web-options -->
140
- **`fortune-nyx-v1.5.11-web.min.js`** — lightweight shell with IndexedDB VFS:
123
+ **`fortune-nyx-v1.6.0-web.min.js`** — lightweight shell with IndexedDB VFS:
141
124
 
142
125
  ```html
143
126
  <script type="module">
144
- import { createWebShell } from "./builds/fortune-nyx-v1.5.11-web.min.js";
127
+ import { createWebShell } from "./builds/fortune-nyx-v1.6.0-web.min.js";
145
128
 
146
129
  const shell = createWebShell("web-vm", {
147
130
  vfs: { databaseName: "virtual-env-js", storeName: "vfs" },
@@ -153,11 +136,11 @@ bun run build-all # rebuild everything
153
136
  </script>
154
137
  ```
155
138
 
156
- **`fortune-nyx-v1.5.11-web.min.js`** — mirrors the `VirtualShell` programmatic API:
139
+ **`fortune-nyx-v1.6.0-web.min.js`** — mirrors the `VirtualShell` programmatic API:
157
140
 
158
141
  ```html
159
142
  <script type="module">
160
- import { createVirtualShellShim } from "./builds/fortune-nyx-v1.5.11-web.min.js";
143
+ import { createVirtualShellShim } from "./builds/fortune-nyx-v1.6.0-web.min.js";
161
144
 
162
145
  const shell = createVirtualShellShim("web-vm");
163
146
  await shell.ensureInitialized();
@@ -355,35 +338,7 @@ ssh.on("auth:lockout", ({ ip, until }) => console.warn(`${ip} locked until ${unt
355
338
  ssh.clearLockout("192.168.1.100"); // manual override
356
339
  ```
357
340
 
358
- ### Shell Operators and Variables
359
341
 
360
- ```typescript
361
- const client = new SshClient(shell, "root");
362
-
363
- await client.exec("mkdir /tmp/test && echo created || echo failed");
364
- await client.exec("export GREETING=hello && echo $GREETING world");
365
- await client.exec("false; echo exit=$?"); // exit=1
366
-
367
- const r = await client.exec("echo -e 'banana\\napple\\ncherry' | sort");
368
- console.log(r.stdout); // apple\nbanana\ncherry
369
- ```
370
-
371
- ### Shell Scripting
372
-
373
- ```typescript
374
- shell.vfs.writeFile("/usr/local/bin/setup.sh", `
375
- #!/bin/sh
376
- for dir in config logs tmp; do
377
- mkdir /app/$dir
378
- echo "Created /app/$dir"
379
- done
380
- if [ -d /app/config ]; then
381
- echo "Setup complete"
382
- fi
383
- `);
384
- const r = await client.exec("sh /usr/local/bin/setup.sh");
385
- console.log(r.stdout);
386
- ```
387
342
 
388
343
  ### Snapshot-Based Test Fixtures
389
344
 
@@ -435,6 +390,8 @@ console.log(vfs.resolveSymlink("/usr/local/bin/app")); // /opt/myapp/bin/app
435
390
 
436
391
  ### Security Auditing with HoneyPot
437
392
 
393
+ Attach HoneyPot to any set of virtual components to log every event with timestamps, track statistics, and detect anomalies.
394
+
438
395
  ```typescript
439
396
  import { HoneyPot, VirtualShell, VirtualSshServer } from "typescript-virtual-container";
440
397
 
@@ -453,6 +410,18 @@ hp.detectAnomalies().forEach(a =>
453
410
  );
454
411
  ```
455
412
 
413
+ **Tracked events by source:**
414
+
415
+ | Source | Events | Stats |
416
+ |--------|--------|-------|
417
+ | `VirtualShell` | `initialized`, `command`, `session:start`, `shell:freeze`, `shell:thaw` | `commands`, `sessionStarts`, `shellFreezes`, `shellThaws` |
418
+ | `VirtualFileSystem` | `file:read`, `file:write`, `dir:create`, `snapshot:restore`, `snapshot:import`, `mirror:flush`, `mount`, `unmount`, `symlink:create`, `node:remove` | `fileReads`, `fileWrites`, `snapshotsRestored`, `snapshotsImported`, `mounts`, `unmounts`, `symlinksCreated`, `nodesRemoved` |
419
+ | `VirtualUserManager` | `initialized`, `user:add`, `user:delete`, `session:register`, `session:unregister`, `key:add`, `key:remove` | `userCreated`, `userDeleted`, `sessionEnds`, `keysAdded`, `keysRemoved` |
420
+ | `SshMimic` | `start`, `stop`, `auth:success`, `auth:failure`, `auth:lockout`, `client:connect`, `client:disconnect` | `authAttempts`, `authSuccesses`, `authFailures`, `authLockouts`, `clientConnects`, `clientDisconnects` |
421
+ | `SftpMimic` | `start`, `stop`, `auth:success`, `auth:failure`, `client:connect`, `client:disconnect` | `authAttempts`, `authSuccesses`, `authFailures`, `clientConnects`, `clientDisconnects` |
422
+
423
+ **Anomaly detection** — `hp.detectAnomalies()` flags high auth failure rates (>50%), excessive failures (>10), high command volume (>1000), and high write volume (>500).
424
+
456
425
  ### Concurrent Clients
457
426
 
458
427
  ```typescript
@@ -466,202 +435,185 @@ const [r1, r2] = await Promise.all([
466
435
  ]);
467
436
  ```
468
437
 
469
- ### .bashrc
470
-
471
- ```typescript
472
- shell.vfs.writeFile("/home/root/.bashrc", `
473
- export EDITOR=nano
474
- export PATH="/usr/local/bin:/usr/bin:/bin"
475
- alias ll="ls -l"
476
- echo "Welcome back, root!"
477
- `.trim());
478
- // On interactive SSH login, .bashrc is sourced automatically.
479
- ```
480
-
481
438
  </details>
482
439
 
483
440
  ---
484
441
 
485
442
  <details>
486
- <summary><strong>Built-in Commands (127)</strong></summary>
443
+ <summary><strong>Built-in Commands (149)</strong></summary>
487
444
 
488
- Type `help` in the shell for a grouped, colorized listing. Type `help <command>` for detailed usage. Type `man <command>` for full manual pages — all 127 commands are documented.
445
+ Type `help` in the shell for a grouped, colorized listing. Type `help <command>` for detailed usage. Type `man <command>` for full manual pages — all 149 commands are documented.
489
446
 
490
447
  ### Navigation
491
448
 
492
- | Command | Flags | Description |
493
- |---------|-------|-------------|
494
- | `cd <path>` | | Change directory |
495
- | `ls [path]` | `-l` `-a` | List directory (`-a` shows dotfiles) |
496
- | `pwd` | | Print working directory |
497
- | `tree [path]` | | ASCII directory tree |
498
-
499
- ### Files & Filesystem
500
-
501
- | Command | Flags | Description |
502
- |---------|-------|-------------|
503
- | `cat <path...>` | `-n` `-b` | Concatenate and print; `-n` numbers lines, `-b` numbers non-blank |
504
- | `chmod <mode> <file>` | | Octal (`755`) or symbolic (`+x`, `u+x`, `go-w`, `a=rx`) |
505
- | `cp <src> <dest>` | `-r` | Copy file or directory |
506
- | `find [path]` | `-name` `-iname` `-type` `-maxdepth` `-mindepth` `-exec` `-not` `-o` `-a` `-empty` `-size` | Search for files |
507
- | `ln <target> <link>` | `-s` | Hard or symbolic link |
508
- | `readlink <path>` | `-f` | Print resolved path of symbolic link |
509
- | `mkdir <path>` | `-p` | Create directory |
510
- | `mv <src> <dest>` | | Move or rename |
511
- | `nano <path>` | | Interactive text editor |
512
- | `rm <path>` | `-r` | Remove file or directory |
513
- | `stat <path>` | `-c <format>` | Display file status (inode, size, mode, timestamps) |
514
- | `touch <path>` | | Create or update file |
515
-
516
- ### Text Processing
517
-
518
- | Command | Flags | Description |
519
- |---------|-------|-------------|
520
- | `awk [-F <sep>] '<prog>'` | `-v var=val` | Pattern scanning — NR/NF, `BEGIN`/`END`, field assign, `gsub`/`sub`/`substr`/`split`/`length`, `printf` |
521
- | `base64` | `-d` | Encode/decode base64 |
522
- | `cut` | `-d` `-f` | Remove sections from lines |
523
- | `diff <f1> <f2>` | | Compare files line by line |
524
- | `grep <pattern> [files]` | `-i` `-v` `-n` `-r` | Search file content |
525
- | `head [files]` | `-n <N>` | First N lines |
526
- | `sed -e 's/pat/rep/[g]'` | `-n` `-i` `-e` | Stream editor — `s///[gI]`, `d`, `p`, `=`, `q`, line/regex/range addresses |
527
- | `sort [files]` | `-r` `-n` `-u` | Sort lines |
528
- | `tail [files]` | `-n <N>` | Last N lines |
529
- | `tee [files]` | `-a` | Read stdin, write to stdout and files |
530
- | `tr <set1> [set2]` | `-d` | Translate or delete characters |
531
- | `uniq` | `-c` `-d` `-u` | Filter repeated lines |
532
- | `basename <path> [suffix]` | `-a` `-s` | Strip directory and suffix from path |
533
- | `dirname <path>` | | Strip last component from path |
534
- | `file <path...>` | | Determine file type (magic bytes) |
535
- | `wc [files]` | `-l` `-w` `-c` | Word/line/byte count |
536
- | `xargs [cmd]` | | Build and execute commands from stdin |
537
- | `tac [files]` | | Concatenate files in reverse line order |
538
- | `nl [file]` | `-b` `-n` | Number lines of files |
539
- | `paste [files]` | `-d` | Merge lines of files side by side |
540
- | `shuf [file]` | `-n` `-i` | Generate random permutations of input |
541
- | `column [file]` | `-t` `-s` | Columnate lists; `-t` table mode |
542
-
543
- ### Archive & Compression
544
-
545
- | Command | Flags | Description |
546
- |---------|-------|-------------|
547
- | `gzip <file>` / `gunzip <file>` | `-k` `-d` | Compress / decompress (real gzip, browser-native) |
548
- | `bzip2 <file>` / `bunzip2 <file>` | `-k` `-d` | Compress / decompress bzip2 (VFS round-trip) |
549
- | `zip [-r] <archive> <files>` / `unzip <archive>` | `-l` `-d <dir>` | Real PKZIP + DEFLATE (interoperable) |
550
- | `tar <archive> [files]` | `-czf` `-xzf` `-tf` `-v` | Archive utility — real POSIX ustar binary format (interoperable) |
449
+ | Command | Description |
450
+ |---------|-------------|
451
+ | `pwd` | Print working directory |
452
+ | `cd <path>` | Change directory |
453
+ | `ls [path]` | List directory |
454
+ | `tree [path]` | ASCII directory tree |
455
+ | `help` | Full list: type `help` in the shell |
456
+
457
+ ### Files
458
+
459
+ | Command | Description |
460
+ |---------|-------------|
461
+ | `cat <path...>` | Concatenate and print |
462
+ | `touch <path>` | Create or update file |
463
+ | `rm <path>` | Remove file or directory |
464
+ | `mkdir <path>` | Create directory |
465
+ | `cp <src> <dest>` | Copy file or directory |
466
+ | `mv <src> <dest>` | Move or rename |
467
+ | `chmod <mode> <file>` | Change file mode |
468
+ | `ln <target> <link>` | Hard or symbolic link |
469
+ | `find [path]` | Search for files |
470
+ | `stat <path>` | Display file status |
471
+ | `dd` | Convert and copy a file |
472
+ | `realpath <path>` | Print resolved absolute path |
473
+ | `help` | Full list: type `help` in the shell |
474
+
475
+ ### Text
476
+
477
+ | Command | Description |
478
+ |---------|-------------|
479
+ | `grep <pattern> [files]` | Search file content |
480
+ | `sed -e 's/pat/rep/'` | Stream editor |
481
+ | `awk '<prog>'` | Pattern scanning and processing |
482
+ | `sort [files]` | Sort lines |
483
+ | `uniq` | Filter repeated lines |
484
+ | `wc [files]` | Word/line/byte count |
485
+ | `head [files]` | First N lines |
486
+ | `tail [files]` | Last N lines |
487
+ | `diff <f1> <f2>` | Compare files |
488
+ | `tee [files]` | Read stdin, write to stdout and files |
489
+ | `md5sum <file>` | Compute MD5 checksum |
490
+ | `sha256sum <file>` | Compute SHA-256 checksum |
491
+ | `fold <file>` | Wrap lines to specified width |
492
+ | `expand <file>` | Convert tabs to spaces |
493
+ | `fmt <file>` | Simple text formatter |
494
+ | `help` | Full list: type `help` in the shell |
495
+
496
+ ### Archives
497
+
498
+ | Command | Description |
499
+ |---------|-------------|
500
+ | `tar <archive> [files]` | Archive utility (POSIX ustar) |
501
+ | `gzip <file>` / `gunzip <file>` | Compress / decompress |
502
+ | `zip [-r] <archive> <files>` / `unzip <archive>` | PKZIP + DEFLATE archive |
503
+ | `bzip2 <file>` / `bunzip2 <file>` | Bzip2 compress / decompress |
504
+ | `base64` | Encode/decode base64 |
505
+ | `help` | Full list: type `help` in the shell |
551
506
 
552
507
  ### System
553
508
 
554
- | Command | Flags | Description |
555
- |---------|-------|-------------|
556
- | `date` | `+format` | Current date and time |
557
- | `df` | `-h` | Filesystem disk space |
558
- | `du [path]` | `-h` `-s` | Estimate file space |
559
- | `free` | `-h` `-m` `-g` | Memory usage (real host data) |
560
- | `groups [user]` | | Group memberships |
561
- | `hostname` | | Print hostname |
562
- | `htop` | | System monitor (mock) |
563
- | `id [user]` | | User identity (uid/gid/groups) |
564
- | `dmesg` | `-n` | Print kernel ring buffer messages |
565
- | `ip <object>` | `addr` `route` `link` `neigh` | Modern network interface/routing tool |
566
- | `kill [-9] <pid>` | | Send signal (mock) |
567
- | `last [user]` | | Show login history |
568
- | `lsb_release` | `-a` `-i` `-d` `-r` `-c` | Distribution info |
569
- | `neofetch` | | System info (real package count and uptime) |
570
- | `node` | `--version` `-e` `-p` | Virtual JS runtime; **requires `apt install nodejs`** |
571
- | `npm` | `--version` `list` `version` | Node.js package manager (install/run stubbed); **requires `apt install npm`** |
572
- | `npx` | `--version` | Node.js package runner (stubbed); **requires `apt install npm`** |
573
- | `ping [-c <n>] <host>` | | ICMP ECHO_REQUEST (mock) |
574
- | `ps` | `-a` `-u` `-x` `aux` | Process status |
575
- | `python3` | `--version` `-c` `-V` | Virtual Python 3 interpreter; alias `python`; **requires `apt install python3`** |
576
- | `sleep <seconds>` | | Delay execution |
577
- | `uname` | `-a` `-r` `-m` | System information |
578
- | `bc` | | Arithmetic calculator (integer; `+` `-` `*` `/` `%` `**` `()`) |
579
- | `lsof` | `-i` | List open files (simulated) |
580
- | `strace <cmd>` | `-e` `-o` | Trace system calls (stub with realistic output) |
581
- | `uptime` | `-p` `-s` | Running time |
582
- | `w` | | Who is logged on and what they are doing |
583
- | `who` | | Active sessions |
584
- | `whoami` | | Current user |
585
- | `nproc` | `--all` | Print number of processing units (returns 4) |
586
- | `mktemp` | `-d` | Create a temporary file or directory in `/tmp` |
587
- | `timeout <n> <cmd>` | | Run command with time limit (simulated) |
588
- | `wait [job...]` | | Wait for background jobs (no-op; jobs are fire-and-forget) |
509
+ | Command | Description |
510
+ |---------|-------------|
511
+ | `whoami` | Current user |
512
+ | `id [user]` | User identity (uid/gid/groups) |
513
+ | `uname` | System information |
514
+ | `hostname` | Print hostname |
515
+ | `ps` | Process status |
516
+ | `kill [-9] <pid>` | Send signal (mock) |
517
+ | `df` | Filesystem disk space |
518
+ | `du [path]` | Estimate file space |
519
+ | `free` | Memory usage (real host data) |
520
+ | `uptime` | Running time |
521
+ | `lsof` | List open files (simulated) |
522
+ | `strace <cmd>` | Trace system calls (stub) |
523
+ | `lscpu` | CPU architecture info |
524
+ | `lspci` | PCI device listing |
525
+ | `nice <cmd>` | Run with adjusted priority |
526
+ | `nohup <cmd>` | Run immune to hangups |
527
+ | `pgrep <pattern>` | Search processes by name |
528
+ | `pkill <pattern>` | Kill processes by name |
529
+ | `top` | Real-time process monitor (mock) |
530
+ | `help` | Full list: type `help` in the shell |
589
531
 
590
532
  ### Network
591
533
 
592
- | Command | Flags | Description |
593
- |---------|-------|-------------|
594
- | `curl <url>` | `-o` `-X` `-d` `-H` `-s` `-I` `-L` `-v` | HTTP client (pure `fetch()`) |
595
- | `wget <url>` | `-O` `-P` `-q` | File downloader (pure `fetch()`) |
596
-
597
- ### Shell & Scripting
598
-
599
- | Command | Flags | Description |
600
- |---------|-------|-------------|
601
- | `alias [name=value]` | | Define or display aliases |
602
- | `clear` | | Clear terminal screen |
603
- | `declare [name=value]` | `-i` `-r` `-x` | Declare variables; aliases `local`, `typeset` |
604
- | `echo <text>` | `-n` `-e` | Display text; `-e` interprets `\n` `\t` `\r` `\\` |
605
- | `env` | | Print session environment |
606
- | `exit [code]` | | Exit session |
607
- | `export NAME=VALUE` | | Set shell variable |
608
- | `false` | | Return exit code 1 |
609
- | `help [command]` | | List commands or show command usage |
610
- | `history [n]` | | Command history |
611
- | `jobs` | | List active jobs |
612
- | `bg [%n]` | | Resume job in background |
613
- | `fg [%n]` | | Resume job in foreground |
614
- | `man <command>` | | Command reference manual |
615
- | `printf <fmt> [args...]` | | Format and print (`%s` `%d` `%f` `%x` `\n` `\t`) |
616
- | `read [-r] <var...>` | `-r` `-p` | Read stdin into variable(s) |
617
- | `return [n]` | | Return from shell function |
618
- | `set [VAR=val]` | `-e` `-x` `+e` `+x` | Display or set shell variables; `-e` exit on error, `-x` trace execution |
619
- | `sh` | `-c <script>` `[file]` | Execute shell script — `if`/`for`/`while`/`until`/`case`/functions, arrays `arr=(a b c)`, `$((expr))`, single-quote-safe |
620
- | `perl` | `-e` `-p` `-n` | One-liner interpreter (`print`/`say`, `s///`, `-p`/`-n` loop) |
621
- | `shift [n]` | | Shift positional parameters |
622
- | `source <file>` | | Execute file in current env; alias `.` |
623
- | `test <expr>` / `[ <expr> ]` | | POSIX conditional: `-f` `-d` `-e` `-z` `-n` `-x` `-s` `=` `!=` `-eq` `-lt` `-gt` `-le` `-ge` `!` `-a` `-o` |
624
- | `trap [action] [signal]` | | Signal handlers; supports `EXIT` |
625
- | `stty` | `-a` `size` | Print/change terminal line settings |
626
- | `tput <cap>` | `cols` `lines` `setaf` `bold` `sgr0` | Query terminfo / output terminal escape sequences |
627
- | `true` | | Return exit code 0 |
628
- | `type <command>` | | Describe command interpretation |
629
- | `unalias <name>` | `-a` | Remove aliases |
630
- | `unset <VAR>` | | Remove shell variable |
631
- | `which <command>` | | Locate command in `$PATH` |
632
-
633
- ### Misc & Fun
634
-
635
- | Command | Flags | Description |
636
- |---------|-------|-------------|
637
- | `cmatrix` | | Matrix-style falling characters |
638
- | `cowsay [msg]` | | ASCII cow saying something |
639
- | `cowthink [msg]` | | ASCII cow thinking |
640
- | `fortune` | | Print a random adage |
641
- | `sl` | | Steam locomotive (cure for mistyping `ls`) |
642
- | `yes [string]` | | Repeatedly output string until killed |
643
-
644
- ### Package Management
645
-
646
- | Command | Flags | Description |
647
- |---------|-------|-------------|
648
- | `apt <cmd> [pkg...]` | | `install`, `remove`, `purge`, `update`, `upgrade`, `search`, `show`, `list` |
649
- | `apt-get` | | Alias for `apt` |
650
- | `apt-cache <cmd>` | | `search`, `show`, `policy` |
651
- | `dpkg` | `-l` `-s` `-L` `-r` `-P` | Low-level package tool |
652
- | `dpkg-query` | `-W` `-l` | Show installed package info |
653
-
654
- ### Users & Permissions
655
-
656
- | Command | Flags | Description |
657
- |---------|-------|-------------|
658
- | `adduser <name> <pass>` | | Create user (root only) |
659
- | `deluser <name>` | | Delete user (root only) |
660
- | `passwd [user]` | | Change password |
661
- | `su [user]` | | Switch user |
662
- | `sudo <cmd>` | `-i` | Run as root |
663
-
664
- **ℹ️ All 127 built-in commands include complete JSDoc documentation** with `@category` and `@params` tags. See [src/commands/](https://github.com/itsrealfortune/typescript-virtual-container/tree/main/src/commands) for source code and inline documentation.
534
+ | Command | Description |
535
+ |---------|-------------|
536
+ | `curl <url>` | HTTP client (pure `fetch()`) |
537
+ | `wget <url>` | File downloader (pure `fetch()`) |
538
+ | `ip <object>` | Network interface/routing tool |
539
+ | `ping [-c <n>] <host>` | ICMP ECHO_REQUEST (mock) |
540
+ | `nc <host> <port>` | TCP netcat (mock) |
541
+ | `help` | Full list: type `help` in the shell |
542
+
543
+ ### Session
544
+
545
+ | Command | Description |
546
+ |---------|-------------|
547
+ | `ssh <user>@<host>` | SSH client (mock) |
548
+ | `sftp <user>@<host>` | SFTP client (mock) |
549
+ | `nano <path>` | Interactive text editor |
550
+ | `su [user]` | Switch user |
551
+ | `sudo <cmd>` | Run as root |
552
+ | `passwd [user]` | Change password |
553
+ | `adduser <name> <pass>` | Create user (root only) |
554
+ | `deluser <name>` | Delete user (root only) |
555
+ | `last [user]` | Show login history |
556
+ | `w` | Who is logged on and what they are doing |
557
+ | `who` | Active sessions |
558
+ | `help` | Full list: type `help` in the shell |
559
+
560
+ ### Package
561
+
562
+ | Command | Description |
563
+ |---------|-------------|
564
+ | `apt <cmd> [pkg...]` | Package manager |
565
+ | `dpkg` | Low-level package tool |
566
+ | `npm` | Node.js package manager |
567
+ | `npx` | Node.js package runner |
568
+ | `node` | Virtual JS runtime |
569
+ | `perl` | One-liner interpreter |
570
+ | `python3` | Virtual Python 3 interpreter |
571
+ | `help` | Full list: type `help` in the shell |
572
+
573
+ ### Shell
574
+
575
+ | Command | Description |
576
+ |---------|-------------|
577
+ | `sh` | Execute shell script |
578
+ | `echo <text>` | Display text |
579
+ | `printf <fmt> [args...]` | Format and print |
580
+ | `read [-r] <var...>` | Read stdin into variable(s) |
581
+ | `source <file>` | Execute file in current env |
582
+ | `export NAME=VALUE` | Set shell variable |
583
+ | `set [VAR=val]` | Display or set shell variables |
584
+ | `unset <VAR>` | Remove shell variable |
585
+ | `alias [name=value]` | Define or display aliases |
586
+ | `type <command>` | Describe command interpretation |
587
+ | `test <expr>` / `[ <expr> ]` | POSIX conditional |
588
+ | `expr <expr>` | Evaluate expression |
589
+ | `declare [name=value]` | Declare variables |
590
+ | `exit [code]` | Exit session |
591
+ | `shift [n]` | Shift positional parameters |
592
+ | `return [n]` | Return from shell function |
593
+ | `trap [action] [signal]` | Signal handlers |
594
+ | `true` / `false` | Return exit code 0 / 1 |
595
+ | `sleep <seconds>` | Delay execution |
596
+ | `timeout <n> <cmd>` | Run command with time limit |
597
+ | `wait [job...]` | Wait for background jobs (no-op) |
598
+ | `history [n]` | Command history |
599
+ | `help` | Full list: type `help` in the shell |
600
+
601
+ ### Fun
602
+
603
+ | Command | Description |
604
+ |---------|-------------|
605
+ | `neofetch` | System info display |
606
+ | `cowsay [msg]` | ASCII cow saying something |
607
+ | `fortune` | Print a random adage |
608
+ | `cmatrix` | Matrix-style falling characters |
609
+ | `sl` | Steam locomotive |
610
+ | `yes [string]` | Repeatedly output string |
611
+ | `bc` | Arithmetic calculator |
612
+ | `seq` | Print sequence of numbers |
613
+ | `pacman` | Pacman game (mock) |
614
+ | `help` | Full list: type `help` in the shell |
615
+
616
+ **ℹ️ All 149 built-in commands include complete JSDoc documentation** with `@category` and `@params` tags. See [src/commands/](https://github.com/itsrealfortune/typescript-virtual-container/tree/main/src/commands) for source code and inline documentation.
665
617
 
666
618
  Custom commands: `shell.addCommand(name, params, callback)`.
667
619
 
@@ -690,32 +642,13 @@ cat /tmp/out.txt >> /tmp/log.txt # append
690
642
 
691
643
  ```bash
692
644
  export NAME=world
693
- echo "Hello $NAME" # Hello world
694
- echo "${NAME:-fallback}" # world (or fallback if unset)
695
- echo "${UNSET:-default}" # default
696
- echo "${NAME:+alternate}" # alternate (only if NAME is set)
697
- echo "${UNSET:=assigned}" # assigns and returns "assigned"
698
- echo "${#NAME}" # 5 (string length)
699
- echo "${NAME:2}" # rld (substring from offset 2)
700
- echo "${NAME:1:3}" # orl (substring offset 1, length 3)
701
- echo "${NAME/o/0}" # w0rld (replace first)
702
- echo "${NAME//l/L}" # worLd (replace all)
703
- echo "${PATH##*/}" # strip longest prefix match
704
- echo "${FILE%.txt}" # strip shortest suffix match
705
- echo "$?" # last exit code
706
- echo "$RANDOM" # random integer 0–32767
707
- echo "$LINENO" # current line number
708
- echo ~ # /home/<user> (tilde expansion)
709
-
710
- # Arrays
711
- arr=(alpha beta gamma)
712
- echo "${arr[0]}" # alpha
713
- echo "${arr[@]}" # alpha beta gamma
714
- echo "${#arr[@]}" # 3
645
+ echo "Hello $NAME" # basic variable
646
+ echo "${NAME:-fallback}" # default if unset
647
+ echo "$(whoami)" # command substitution
648
+ echo $((2 + 3)) # arithmetic expansion
649
+ echo "${HOME}" # curly brace delimited
715
650
  ```
716
651
 
717
- > **Single-quote isolation** — `$VAR` and `$((...))` are never expanded inside `'...'`.
718
-
719
652
  ### Arithmetic
720
653
 
721
654
  ```bash
@@ -752,7 +685,6 @@ while [ $COUNT -lt 3 ]; do
752
685
  COUNT=$((COUNT + 1))
753
686
  done
754
687
 
755
- COUNT=5
756
688
  until [ $COUNT -eq 0 ]; do
757
689
  echo "Countdown: $COUNT"
758
690
  COUNT=$((COUNT - 1))
@@ -824,19 +756,15 @@ alias ll="ls -l"
824
756
  echo "Welcome, $USER!"
825
757
  ```
826
758
 
827
- ### Line Editing
828
-
829
- Interactive shell supports full readline-style key bindings:
759
+ Set `.bashrc` programmatically:
830
760
 
831
- | Key | Action |
832
- |-----|--------|
833
- | `←` / `→` | Move cursor left / right |
834
- | `Home` / `Ctrl+A` | Jump to start of line |
835
- | `End` / `Ctrl+E` | Jump to end of line |
836
- | `Ctrl+K` | Kill to end of line |
837
- | `Ctrl+U` | Kill to start of line |
838
- | `Ctrl+W` | Kill word backward |
839
- | `!!` | Expand to last command |
761
+ ```typescript
762
+ shell.vfs.writeFile("/home/root/.bashrc", `
763
+ export EDITOR=nano
764
+ alias ll="ls -l"
765
+ echo "Welcome back, root!"
766
+ `.trim());
767
+ ```
840
768
 
841
769
  </details>
842
770
 
@@ -851,180 +779,32 @@ On every `VirtualShell` init, a realistic Linux hierarchy is bootstrapped idempo
851
779
 
852
780
  ```
853
781
  /
854
- ├── bin -> /usr/bin (symlink, Debian-style)
855
- ├── sbin -> /usr/sbin (symlink, Debian-style)
856
- ├── lib/ (ELF stub)
857
- │ ├── modules/
858
- │ └── x86_64-linux-gnu/
859
- ├── lib64/
860
- │ └── ld-linux-x86-64.so.2 (stub, 0o755)
861
- ├── initrd.img -> /boot/initrd.img-<kernel>
862
- ├── initrd.img.old -> /boot/initrd.img-<kernel>
863
- ├── vmlinuz -> /boot/vmlinuz-<kernel>
864
- ├── vmlinuz.old -> /boot/vmlinuz-<kernel>
865
- ├── lost+found/ (mode 0o700, ext4 fsck dir)
866
-
782
+ ├── bin/
783
+ ├── [47 stubs: sh, bash, python3, ...]
867
784
  ├── boot/
868
- │ ├── grub/
869
- │ │ └── grub.cfg virtual bootloader config
870
- │ ├── vmlinuz-<kernel> kernel stub
871
- │ ├── initrd.img-<kernel> initrd stub
872
- │ ├── System.map-<kernel>
873
- │ └── config-<kernel>
874
-
875
785
  ├── dev/
876
- │ ├── null / zero / full (0o666)
877
- │ ├── random / urandom (0o444)
878
- │ ├── mem (0o640)
879
- │ ├── console / tty / tty0 / tty1 / ttyS0
880
- │ ├── sda / sda1 / sda2 block device stubs
881
- │ ├── loop0-loop7 + loop-control
882
- │ ├── stdin / stdout / stderr
883
- │ ├── pts/
884
- │ └── shm/
885
-
786
+ │ ├── null, zero, random, urandom, tty, ...
886
787
  ├── etc/
887
- │ ├── apt/
888
- │ │ ├── sources.list
889
- │ │ ├── sources.list.d/
890
- │ │ ├── trusted.gpg.d/
891
- │ │ ├── keyrings/
892
- │ │ └── apt.conf.d/70debconf
893
- │ ├── cron.d/ + cron.daily/ + cron.hourly/ + cron.weekly/ + cron.monthly/
894
- │ ├── default/locale
895
- │ ├── init.d/
896
- │ ├── ld.so.conf + ld.so.conf.d/x86_64-linux-gnu.conf + fakeroot.conf
897
- │ ├── netplan/01-netcfg.yaml
898
- │ ├── network/interfaces lo + eth0 (DHCP)
899
- │ ├── pam.d/ common-auth|account|password|session · sshd · login · sudo
900
- │ ├── security/limits.conf + access.conf
901
- │ ├── sudoers (0o440) + sudoers.d/README
902
- │ ├── systemd/system/ + systemd/network/ + systemd/system.conf
903
- │ ├── debian_version nyx/stable
904
- │ ├── fstab UUID stubs + tmpfs entries
905
- │ ├── group synced from VirtualUserManager
906
- │ ├── hostname
907
- │ ├── hosts 127.0.0.1 + ::1 + VM hostname
908
- │ ├── issue + issue.net login banner
909
- │ ├── locale.conf + locale.gen LANG=en_US.UTF-8
910
- │ ├── localtime / timezone UTC
911
- │ ├── login.defs UID_MIN=1000 SHA512
912
- │ ├── lsb-release Fortune GNU/Linux + ShellProperties
913
- │ ├── motd uses ShellProperties
914
- │ ├── nsswitch.conf
915
- │ ├── os-release NAME="Fortune GNU/Linux" + ShellProperties
916
- │ ├── passwd synced from VirtualUserManager
917
- │ ├── profile PATH + PS1 defaults
918
- │ ├── resolv.conf 1.1.1.1 + 8.8.8.8
919
- │ ├── shadow (mode 0o640, fake hashes)
920
- │ └── shells /bin/sh /bin/bash /usr/bin/bash
921
-
788
+ │ ├── passwd, shadow, group, sudoers, hostname, ...
922
789
  ├── home/
923
- │ └── <user>/
924
- │ └── README.txt created on first login
925
- ├── media/
926
- ├── mnt/
790
+ │ └── root/
927
791
  ├── opt/
928
- │ └── rclone/
929
- ├── srv/
930
-
931
- ├── proc/ kernel simulation engine (refreshed on demand)
932
- ├── boot/log + version kernel boot sequence
933
- ├── net/dev + if_inet6 + tcp + tcp6
934
- ├── sys/kernel/ hostname, ostype, osrelease, pid_max,
935
- │ │ threads-max, randomize_va_space, dmesg_restrict
936
- │ ├── sys/net/ipv4/ip_forward
937
- │ ├── sys/vm/swappiness + overcommit_memory
938
- │ ├── self/mounts mirrors most recent session's /proc/<pid>/
939
- │ ├── 1/ init (cmdline, comm, stat, status, environ, fd/, fdinfo/)
940
- │ ├── <pid>/ one subtree per active session (TTY-derived PID)
941
- │ ├── cmdline kernel boot args
942
- │ ├── cpuinfo real host CPU passthrough
943
- │ ├── filesystems
944
- │ ├── hostname
945
- │ ├── loadavg computed dynamically
946
- │ ├── meminfo real host memory (Total/Free/Available/Buffers/Cached/Swap)
947
- │ ├── mounts
948
- │ ├── partitions
949
- │ ├── swaps
950
- │ ├── uptime computed from shellStartTime
951
- │ └── version Linux <kernel> (fortune@build)
952
-
953
- ├── root/ (mode 0o700)
954
- │ ├── .ssh/ (mode 0o700)
955
- │ ├── .config/pip/pip.conf break-system-packages = true
956
- │ ├── .local/share/
957
- │ ├── .bash_logout
958
- │ ├── .bashrc colored PS1, PATH, ll/la/l aliases
959
- │ └── .profile
960
-
961
- ├── run/ (systemd tmpfs runtime)
962
- │ ├── lock/
963
- │ ├── systemd/
964
- │ ├── user/
965
- │ └── utmp
966
-
967
- ├── sys/ sysfs graph — deterministic, seeded from hostname (fnv1a)
968
- │ ├── class/net/
969
- │ ├── devices/virtual/dmi/id/
970
- │ │ ├── bios_vendor / bios_version / bios_date
971
- │ │ ├── sys_vendor / product_name / product_family / product_version
972
- │ │ ├── product_uuid / product_serial
973
- │ │ ├── chassis_type / chassis_vendor / chassis_version
974
- │ │ ├── board_name
975
- │ │ └── modalias
976
- │ └── kernel/
977
- │ ├── hostname
978
- │ ├── osrelease
979
- │ └── ostype
980
-
981
- ├── tmp/ (mode 0o1777, sticky)
982
- │ └── node-compile-cache/
983
-
792
+ ├── proc/
793
+ ├── (dynamic — uptime, meminfo, cpuinfo, stat, ...)
794
+ ├── root/
795
+ ├── run/
796
+ ├── sbin/
797
+ └── init
798
+ ├── sys/
799
+ ├── tmp/
984
800
  ├── usr/
985
- │ ├── bin/ stubs for all built-in commands (exec builtin <name>)
986
- │ ├── sbin/
987
- │ ├── lib/
988
- │ ├── x86_64-linux-gnu/
989
- │ │ ├── python3/dist-packages/
990
- │ │ ├── python3.12/
991
- │ │ └── jvm/java-21-openjdk-amd64/
992
- │ ├── local/bin|lib|share|include|sbin/
993
- │ └── share/
994
- │ ├── doc/
995
- │ ├── man/man1|man5|man8/
996
- │ ├── ca-certificates/
997
- │ ├── common-licenses/
998
- │ └── zoneinfo/
999
-
801
+ │ ├── bin/
802
+ │ ├── lib/python3.12/
803
+ │ ├── share/
804
+ └── src/
1000
805
  └── var/
1001
- ├── cache/
1002
- │ ├── apt/archives/partial/
1003
- │ ├── debconf/
1004
- │ ├── fontconfig/
1005
- │ ├── ldconfig/
1006
- │ └── PackageKit/
1007
- ├── lib/
1008
- │ ├── apt/lists/partial/
1009
- │ ├── dpkg/
1010
- │ │ ├── info/
1011
- │ │ ├── updates/
1012
- │ │ ├── alternatives/
1013
- │ │ ├── available
1014
- │ │ └── status managed by VirtualPackageManager
1015
- │ ├── misc/
1016
- │ └── systemd/
1017
806
  ├── log/
1018
- │ ├── apt/history.log + term.log
1019
- │ ├── auth.log
1020
- │ ├── dpkg.log
1021
- │ ├── journal/
1022
- │ ├── kern.log
1023
- │ ├── private/
1024
- │ └── syslog
1025
- ├── run -> /run (legacy symlink)
1026
- ├── spool/cron/
1027
- └── tmp/
807
+ └── lib/apt/
1028
808
  ```
1029
809
 
1030
810
  ```typescript
@@ -1253,8 +1033,8 @@ Open:
1253
1033
  - [x] Snapshot diff tooling — `diffSnapshots`, `formatDiff`, `assertDiff`
1254
1034
  - [x] `node`/`python3`/`npm`/`npx` — package-gated virtual REPL stubs
1255
1035
  <!-- BUILD:changelog -->
1256
- - [x] Web shell bundles (`fortune-nyx-v1.5.11-web.min.js`) — fully browser-native with IndexedDB VFS
1257
- - [x] Self-standalone CLI (`fortune-nyx-v1.5.11-directbash-k6.1.0.mjs`) — single-file interactive shell, per-user history, tab completion
1036
+ - [x] Web shell bundles (`fortune-nyx-v1.6.0-web.min.js`) — fully browser-native with IndexedDB VFS
1037
+ - [x] Self-standalone CLI (`fortune-nyx-v1.6.0-directbash-k6.1.0.mjs`) — single-file interactive shell, per-user history, tab completion
1258
1038
  <!-- /BUILD:changelog -->
1259
1039
  - [x] 127+ `man` pages — all built-in commands documented via `man <cmd>`
1260
1040
  - [x] Background job support — trailing `&` fires commands async; `:(){ :|:& };:` fork-bomb safely blocked by `MAX_CALL_DEPTH` guard; shell function names now accept any non-whitespace identifier (POSIX-compliant)