typescript-virtual-container 1.5.10 → 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.
- package/README.md +236 -456
- package/dist/.tsbuildinfo +1 -1
- package/dist/Honeypot/index.d.ts +9 -0
- package/dist/Honeypot/index.js +57 -0
- package/dist/SSHMimic/exec.d.ts +4 -0
- package/dist/SSHMimic/exec.js +4 -0
- package/dist/SSHMimic/executor.d.ts +10 -1
- package/dist/SSHMimic/executor.js +18 -8
- package/dist/SSHMimic/hostKey.d.ts +5 -0
- package/dist/SSHMimic/hostKey.js +5 -0
- package/dist/SSHMimic/loginBanner.d.ts +7 -0
- package/dist/SSHMimic/loginBanner.js +4 -0
- package/dist/SSHMimic/loginFormat.d.ts +4 -0
- package/dist/SSHMimic/loginFormat.js +4 -0
- package/dist/SSHMimic/prompt.d.ts +9 -0
- package/dist/SSHMimic/prompt.js +9 -0
- package/dist/SSHMimic/scp.d.ts +18 -0
- package/dist/SSHMimic/scp.js +14 -0
- package/dist/VirtualFileSystem/binaryPack.d.ts +7 -3
- package/dist/VirtualFileSystem/binaryPack.js +32 -10
- package/dist/VirtualFileSystem/index.d.ts +29 -0
- package/dist/VirtualFileSystem/index.js +126 -5
- package/dist/VirtualFileSystem/internalTypes.d.ts +4 -0
- package/dist/VirtualFileSystem/journal.d.ts +10 -4
- package/dist/VirtualFileSystem/journal.js +12 -2
- package/dist/VirtualFileSystem/path.d.ts +23 -1
- package/dist/VirtualFileSystem/path.js +23 -3
- package/dist/VirtualPackageManager/index.js +1 -1
- package/dist/VirtualShell/index.d.ts +3 -0
- package/dist/VirtualShell/index.js +12 -3
- package/dist/VirtualUserManager/index.d.ts +20 -1
- package/dist/VirtualUserManager/index.js +52 -15
- package/dist/commands/bc.d.ts +5 -0
- package/dist/commands/bc.js +5 -0
- package/dist/commands/cat.js +2 -2
- package/dist/commands/chgrp.d.ts +7 -0
- package/dist/commands/chgrp.js +42 -0
- package/dist/commands/chown.d.ts +7 -0
- package/dist/commands/chown.js +79 -0
- package/dist/commands/cp.js +4 -3
- package/dist/commands/dd.d.ts +7 -0
- package/dist/commands/dd.js +60 -0
- package/dist/commands/declare.js +0 -2
- package/dist/commands/expr.d.ts +7 -0
- package/dist/commands/expr.js +63 -0
- package/dist/commands/fun.d.ts +5 -0
- package/dist/commands/fun.js +5 -1
- package/dist/commands/help.d.ts +5 -0
- package/dist/commands/help.js +5 -0
- package/dist/commands/helpers.d.ts +43 -0
- package/dist/commands/helpers.js +61 -0
- package/dist/commands/id.d.ts +5 -0
- package/dist/commands/id.js +5 -0
- package/dist/commands/ip.d.ts +1 -0
- package/dist/commands/ip.js +50 -23
- package/dist/commands/jobs.js +43 -9
- package/dist/commands/kill.d.ts +1 -0
- package/dist/commands/kill.js +13 -5
- package/dist/commands/last.js +1 -1
- package/dist/commands/ln.d.ts +5 -0
- package/dist/commands/ln.js +5 -0
- package/dist/commands/ls.d.ts +5 -0
- package/dist/commands/ls.js +19 -4
- package/dist/commands/lsb-release.js +1 -1
- package/dist/commands/man.d.ts +5 -0
- package/dist/commands/man.js +5 -0
- package/dist/commands/manuals-bundle.js +242 -0
- package/dist/commands/miscutils.d.ts +43 -0
- package/dist/commands/miscutils.js +233 -0
- package/dist/commands/mkdir.js +3 -2
- package/dist/commands/mv.js +4 -3
- package/dist/commands/netcat.d.ts +7 -0
- package/dist/commands/netcat.js +64 -0
- package/dist/commands/nice.d.ts +7 -0
- package/dist/commands/nice.js +22 -0
- package/dist/commands/nohup.d.ts +7 -0
- package/dist/commands/nohup.js +18 -0
- package/dist/commands/ping.d.ts +2 -1
- package/dist/commands/ping.js +46 -8
- package/dist/commands/procUtils.d.ts +13 -0
- package/dist/commands/procUtils.js +72 -0
- package/dist/commands/pwd.d.ts +5 -0
- package/dist/commands/pwd.js +5 -0
- package/dist/commands/python.js +0 -4
- package/dist/commands/read.js +0 -1
- package/dist/commands/registry.d.ts +37 -0
- package/dist/commands/registry.js +73 -0
- package/dist/commands/rm.js +3 -2
- package/dist/commands/runtime.d.ts +47 -1
- package/dist/commands/runtime.js +60 -5
- package/dist/commands/sh.d.ts +5 -0
- package/dist/commands/sh.js +5 -0
- package/dist/commands/stat.js +3 -2
- package/dist/commands/strace.js +0 -1
- package/dist/commands/sysinfo.d.ts +19 -0
- package/dist/commands/sysinfo.js +73 -0
- package/dist/commands/test.d.ts +5 -0
- package/dist/commands/test.js +5 -0
- package/dist/commands/textutils.d.ts +25 -0
- package/dist/commands/textutils.js +171 -0
- package/dist/commands/top.d.ts +7 -0
- package/dist/commands/top.js +54 -0
- package/dist/commands/touch.js +6 -2
- package/dist/commands/tr.d.ts +5 -0
- package/dist/commands/tr.js +5 -0
- package/dist/commands/w.js +1 -1
- package/dist/commands/which.d.ts +5 -0
- package/dist/commands/which.js +5 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +4 -0
- package/dist/modules/VirtualNetworkManager.d.ts +54 -0
- package/dist/modules/VirtualNetworkManager.js +144 -0
- package/dist/modules/linuxRootfs.d.ts +4 -3
- package/dist/modules/linuxRootfs.js +115 -74
- package/dist/modules/neofetch.d.ts +2 -0
- package/dist/modules/neofetch.js +3 -2
- package/dist/modules/pacmanGame.d.ts +2 -0
- package/dist/modules/pacmanGame.js +1 -0
- package/dist/modules/shellInteractive.d.ts +2 -0
- package/dist/modules/shellInteractive.js +2 -0
- package/dist/modules/shellRuntime.d.ts +7 -0
- package/dist/modules/shellRuntime.js +6 -0
- package/dist/modules/webTermRenderer.js +0 -7
- package/dist/types/commands.d.ts +1 -1
- package/dist/types/vfs.d.ts +8 -0
- package/dist/utils/argv.d.ts +22 -3
- package/dist/utils/argv.js +22 -3
- package/dist/utils/perfLogger.d.ts +10 -2
- package/dist/utils/perfLogger.js +7 -14
- package/dist/utils/shellSession.d.ts +35 -0
- package/dist/utils/shellSession.js +35 -0
- package/package.json +3 -2
- package/scripts/postinstall.js +42 -0
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
|
-
- [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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.
|
|
48
|
-
| **Standalone CLI** | `builds/fortune-nyx-v1.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.10-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.
|
|
75
|
+
**`fortune-nyx-v1.6.0-directbash-k6.1.0.mjs` options:**
|
|
93
76
|
|
|
94
77
|
```bash
|
|
95
|
-
node fortune-nyx-v1.
|
|
96
|
-
node fortune-nyx-v1.
|
|
97
|
-
node fortune-nyx-v1.
|
|
98
|
-
node fortune-nyx-v1.
|
|
99
|
-
node fortune-nyx-v1.
|
|
100
|
-
node fortune-nyx-v1.
|
|
101
|
-
node fortune-nyx-v1.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 (
|
|
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
|
|
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 |
|
|
493
|
-
|
|
494
|
-
| `
|
|
495
|
-
| `
|
|
496
|
-
| `
|
|
497
|
-
| `tree [path]` |
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
| `
|
|
505
|
-
| `
|
|
506
|
-
| `
|
|
507
|
-
| `
|
|
508
|
-
| `
|
|
509
|
-
| `
|
|
510
|
-
| `
|
|
511
|
-
| `
|
|
512
|
-
| `
|
|
513
|
-
| `stat <path>` |
|
|
514
|
-
| `
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
|
521
|
-
|
|
522
|
-
| `
|
|
523
|
-
| `
|
|
524
|
-
| `
|
|
525
|
-
| `
|
|
526
|
-
| `
|
|
527
|
-
| `
|
|
528
|
-
| `
|
|
529
|
-
| `
|
|
530
|
-
| `
|
|
531
|
-
| `
|
|
532
|
-
| `
|
|
533
|
-
| `
|
|
534
|
-
| `
|
|
535
|
-
| `
|
|
536
|
-
| `
|
|
537
|
-
| `
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
|
546
|
-
|
|
547
|
-
| `
|
|
548
|
-
| `
|
|
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 |
|
|
555
|
-
|
|
556
|
-
| `
|
|
557
|
-
| `
|
|
558
|
-
| `
|
|
559
|
-
| `
|
|
560
|
-
| `
|
|
561
|
-
| `
|
|
562
|
-
| `
|
|
563
|
-
| `
|
|
564
|
-
| `
|
|
565
|
-
| `
|
|
566
|
-
| `
|
|
567
|
-
| `
|
|
568
|
-
| `
|
|
569
|
-
| `
|
|
570
|
-
| `
|
|
571
|
-
| `
|
|
572
|
-
| `
|
|
573
|
-
| `
|
|
574
|
-
| `
|
|
575
|
-
| `
|
|
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 |
|
|
593
|
-
|
|
594
|
-
| `curl <url>` |
|
|
595
|
-
| `wget <url>` |
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
|
604
|
-
|
|
605
|
-
| `
|
|
606
|
-
| `
|
|
607
|
-
| `
|
|
608
|
-
| `
|
|
609
|
-
| `
|
|
610
|
-
| `
|
|
611
|
-
| `
|
|
612
|
-
| `
|
|
613
|
-
| `
|
|
614
|
-
| `
|
|
615
|
-
| `
|
|
616
|
-
| `
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
|
621
|
-
|
|
622
|
-
| `
|
|
623
|
-
| `
|
|
624
|
-
| `
|
|
625
|
-
| `
|
|
626
|
-
| `
|
|
627
|
-
| `
|
|
628
|
-
| `
|
|
629
|
-
| `
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
|
636
|
-
|
|
637
|
-
| `
|
|
638
|
-
| `
|
|
639
|
-
| `
|
|
640
|
-
| `
|
|
641
|
-
| `
|
|
642
|
-
| `
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
|
647
|
-
|
|
648
|
-
| `
|
|
649
|
-
| `
|
|
650
|
-
| `
|
|
651
|
-
| `
|
|
652
|
-
| `
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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"
|
|
694
|
-
echo "${NAME:-fallback}"
|
|
695
|
-
echo "$
|
|
696
|
-
echo
|
|
697
|
-
echo "${
|
|
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
|
-
|
|
828
|
-
|
|
829
|
-
Interactive shell supports full readline-style key bindings:
|
|
759
|
+
Set `.bashrc` programmatically:
|
|
830
760
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
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
|
|
855
|
-
├──
|
|
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
|
|
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
|
-
│ ├──
|
|
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
|
-
│ └──
|
|
924
|
-
│ └── README.txt created on first login
|
|
925
|
-
├── media/
|
|
926
|
-
├── mnt/
|
|
790
|
+
│ └── root/
|
|
927
791
|
├── opt/
|
|
928
|
-
|
|
929
|
-
├──
|
|
930
|
-
|
|
931
|
-
├──
|
|
932
|
-
|
|
933
|
-
│
|
|
934
|
-
|
|
935
|
-
|
|
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/
|
|
986
|
-
│ ├──
|
|
987
|
-
│ ├──
|
|
988
|
-
│
|
|
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
|
-
|
|
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.
|
|
1257
|
-
- [x] Self-standalone CLI (`fortune-nyx-v1.
|
|
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)
|