typescript-virtual-container 1.2.5 → 1.2.7

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 (248) hide show
  1. package/README.md +387 -193
  2. package/benchmark-results.txt +21 -21
  3. package/biome.json +1 -1
  4. package/bun.lock +15 -41
  5. package/dist/SSHMimic/exec.js +2 -2
  6. package/dist/SSHMimic/executor.d.ts +6 -7
  7. package/dist/SSHMimic/executor.d.ts.map +1 -1
  8. package/dist/SSHMimic/executor.js +77 -60
  9. package/dist/SSHMimic/index.d.ts.map +1 -1
  10. package/dist/SSHMimic/index.js +6 -20
  11. package/dist/SSHMimic/sftp.d.ts.map +1 -1
  12. package/dist/SSHMimic/sftp.js +14 -0
  13. package/dist/VirtualFileSystem/index.d.ts.map +1 -1
  14. package/dist/VirtualFileSystem/index.js +13 -36
  15. package/dist/VirtualShell/shell.d.ts.map +1 -1
  16. package/dist/VirtualShell/shell.js +19 -2
  17. package/dist/VirtualShell/shellParser.d.ts +20 -2
  18. package/dist/VirtualShell/shellParser.d.ts.map +1 -1
  19. package/dist/VirtualShell/shellParser.js +229 -120
  20. package/dist/VirtualUserManager/index.d.ts.map +1 -1
  21. package/dist/commands/adduser.d.ts.map +1 -1
  22. package/dist/commands/adduser.js +2 -0
  23. package/dist/commands/awk.d.ts +3 -0
  24. package/dist/commands/awk.d.ts.map +1 -0
  25. package/dist/commands/awk.js +29 -0
  26. package/dist/commands/base64.d.ts +3 -0
  27. package/dist/commands/base64.d.ts.map +1 -0
  28. package/dist/commands/base64.js +20 -0
  29. package/dist/commands/cat.d.ts.map +1 -1
  30. package/dist/commands/cat.js +2 -0
  31. package/dist/commands/cd.d.ts.map +1 -1
  32. package/dist/commands/cd.js +2 -0
  33. package/dist/commands/chmod.d.ts.map +1 -1
  34. package/dist/commands/chmod.js +2 -0
  35. package/dist/commands/clear.d.ts.map +1 -1
  36. package/dist/commands/clear.js +4 -1
  37. package/dist/commands/cp.d.ts.map +1 -1
  38. package/dist/commands/cp.js +2 -0
  39. package/dist/commands/curl.d.ts.map +1 -1
  40. package/dist/commands/curl.js +2 -0
  41. package/dist/commands/cut.d.ts +3 -0
  42. package/dist/commands/cut.d.ts.map +1 -0
  43. package/dist/commands/cut.js +27 -0
  44. package/dist/commands/date.d.ts +3 -0
  45. package/dist/commands/date.d.ts.map +1 -0
  46. package/dist/commands/date.js +22 -0
  47. package/dist/commands/deluser.d.ts.map +1 -1
  48. package/dist/commands/deluser.js +2 -0
  49. package/dist/commands/df.d.ts +3 -0
  50. package/dist/commands/df.d.ts.map +1 -0
  51. package/dist/commands/df.js +16 -0
  52. package/dist/commands/diff.d.ts +3 -0
  53. package/dist/commands/diff.d.ts.map +1 -0
  54. package/dist/commands/diff.js +40 -0
  55. package/dist/commands/du.d.ts +3 -0
  56. package/dist/commands/du.d.ts.map +1 -0
  57. package/dist/commands/du.js +39 -0
  58. package/dist/commands/echo.d.ts.map +1 -1
  59. package/dist/commands/echo.js +2 -0
  60. package/dist/commands/env.d.ts +1 -0
  61. package/dist/commands/env.d.ts.map +1 -1
  62. package/dist/commands/env.js +6 -14
  63. package/dist/commands/export.d.ts.map +1 -1
  64. package/dist/commands/export.js +11 -21
  65. package/dist/commands/find.d.ts.map +1 -1
  66. package/dist/commands/find.js +2 -0
  67. package/dist/commands/grep.d.ts.map +1 -1
  68. package/dist/commands/grep.js +4 -7
  69. package/dist/commands/groups.d.ts +3 -0
  70. package/dist/commands/groups.d.ts.map +1 -0
  71. package/dist/commands/groups.js +12 -0
  72. package/dist/commands/gzip.d.ts +4 -0
  73. package/dist/commands/gzip.d.ts.map +1 -0
  74. package/dist/commands/gzip.js +40 -0
  75. package/dist/commands/head.d.ts.map +1 -1
  76. package/dist/commands/head.js +2 -0
  77. package/dist/commands/help.d.ts +1 -1
  78. package/dist/commands/help.d.ts.map +1 -1
  79. package/dist/commands/help.js +66 -3
  80. package/dist/commands/hostname.d.ts.map +1 -1
  81. package/dist/commands/hostname.js +2 -0
  82. package/dist/commands/htop.d.ts.map +1 -1
  83. package/dist/commands/htop.js +2 -0
  84. package/dist/commands/id.d.ts +3 -0
  85. package/dist/commands/id.d.ts.map +1 -0
  86. package/dist/commands/id.js +14 -0
  87. package/dist/commands/index.d.ts +5 -2
  88. package/dist/commands/index.d.ts.map +1 -1
  89. package/dist/commands/index.js +89 -62
  90. package/dist/commands/kill.d.ts +3 -0
  91. package/dist/commands/kill.d.ts.map +1 -0
  92. package/dist/commands/kill.js +13 -0
  93. package/dist/commands/ln.d.ts.map +1 -1
  94. package/dist/commands/ln.js +2 -0
  95. package/dist/commands/ls.d.ts.map +1 -1
  96. package/dist/commands/ls.js +2 -0
  97. package/dist/commands/mkdir.d.ts.map +1 -1
  98. package/dist/commands/mkdir.js +2 -0
  99. package/dist/commands/mv.d.ts.map +1 -1
  100. package/dist/commands/mv.js +2 -0
  101. package/dist/commands/nano.d.ts.map +1 -1
  102. package/dist/commands/nano.js +2 -0
  103. package/dist/commands/neofetch.d.ts.map +1 -1
  104. package/dist/commands/neofetch.js +2 -0
  105. package/dist/commands/passwd.d.ts.map +1 -1
  106. package/dist/commands/passwd.js +2 -0
  107. package/dist/commands/ping.d.ts +3 -0
  108. package/dist/commands/ping.d.ts.map +1 -0
  109. package/dist/commands/ping.js +18 -0
  110. package/dist/commands/ps.d.ts +3 -0
  111. package/dist/commands/ps.d.ts.map +1 -0
  112. package/dist/commands/ps.js +17 -0
  113. package/dist/commands/pwd.d.ts.map +1 -1
  114. package/dist/commands/pwd.js +2 -0
  115. package/dist/commands/rm.d.ts.map +1 -1
  116. package/dist/commands/rm.js +2 -0
  117. package/dist/commands/sed.d.ts +3 -0
  118. package/dist/commands/sed.d.ts.map +1 -0
  119. package/dist/commands/sed.js +47 -0
  120. package/dist/commands/set.d.ts +3 -0
  121. package/dist/commands/set.d.ts.map +1 -1
  122. package/dist/commands/set.js +19 -46
  123. package/dist/commands/sh.d.ts +0 -1
  124. package/dist/commands/sh.d.ts.map +1 -1
  125. package/dist/commands/sh.js +229 -35
  126. package/dist/commands/sleep.d.ts +3 -0
  127. package/dist/commands/sleep.d.ts.map +1 -0
  128. package/dist/commands/sleep.js +13 -0
  129. package/dist/commands/sort.d.ts +3 -0
  130. package/dist/commands/sort.d.ts.map +1 -0
  131. package/dist/commands/sort.js +37 -0
  132. package/dist/commands/su.d.ts.map +1 -1
  133. package/dist/commands/su.js +2 -0
  134. package/dist/commands/sudo.d.ts.map +1 -1
  135. package/dist/commands/sudo.js +2 -0
  136. package/dist/commands/tail.d.ts.map +1 -1
  137. package/dist/commands/tail.js +2 -0
  138. package/dist/commands/tar.d.ts +3 -0
  139. package/dist/commands/tar.d.ts.map +1 -0
  140. package/dist/commands/tar.js +64 -0
  141. package/dist/commands/tee.d.ts +3 -0
  142. package/dist/commands/tee.d.ts.map +1 -0
  143. package/dist/commands/tee.js +29 -0
  144. package/dist/commands/touch.d.ts.map +1 -1
  145. package/dist/commands/touch.js +2 -0
  146. package/dist/commands/tr.d.ts +3 -0
  147. package/dist/commands/tr.d.ts.map +1 -0
  148. package/dist/commands/tr.js +24 -0
  149. package/dist/commands/tree.d.ts.map +1 -1
  150. package/dist/commands/tree.js +2 -0
  151. package/dist/commands/uname.d.ts +3 -0
  152. package/dist/commands/uname.d.ts.map +1 -0
  153. package/dist/commands/uname.js +21 -0
  154. package/dist/commands/uniq.d.ts +3 -0
  155. package/dist/commands/uniq.d.ts.map +1 -0
  156. package/dist/commands/uniq.js +33 -0
  157. package/dist/commands/unset.d.ts.map +1 -1
  158. package/dist/commands/unset.js +6 -10
  159. package/dist/commands/wc.d.ts.map +1 -1
  160. package/dist/commands/wc.js +2 -0
  161. package/dist/commands/wget.d.ts.map +1 -1
  162. package/dist/commands/wget.js +2 -0
  163. package/dist/commands/who.d.ts.map +1 -1
  164. package/dist/commands/who.js +2 -0
  165. package/dist/commands/whoami.d.ts.map +1 -1
  166. package/dist/commands/whoami.js +2 -0
  167. package/dist/commands/xargs.d.ts +3 -0
  168. package/dist/commands/xargs.d.ts.map +1 -0
  169. package/dist/commands/xargs.js +16 -0
  170. package/dist/types/commands.d.ts +13 -0
  171. package/dist/types/commands.d.ts.map +1 -1
  172. package/dist/types/pipeline.d.ts +20 -0
  173. package/dist/types/pipeline.d.ts.map +1 -1
  174. package/package.json +3 -3
  175. package/src/SSHMimic/exec.ts +2 -2
  176. package/src/SSHMimic/executor.ts +95 -98
  177. package/src/SSHMimic/index.ts +15 -49
  178. package/src/SSHMimic/sftp.ts +15 -0
  179. package/src/VirtualFileSystem/index.ts +27 -75
  180. package/src/VirtualShell/shell.ts +19 -2
  181. package/src/VirtualShell/shellParser.ts +202 -168
  182. package/src/VirtualUserManager/index.ts +2 -7
  183. package/src/commands/adduser.ts +2 -0
  184. package/src/commands/awk.ts +30 -0
  185. package/src/commands/base64.ts +18 -0
  186. package/src/commands/cat.ts +2 -0
  187. package/src/commands/cd.ts +2 -0
  188. package/src/commands/chmod.ts +2 -0
  189. package/src/commands/clear.ts +4 -1
  190. package/src/commands/cp.ts +2 -0
  191. package/src/commands/curl.ts +2 -0
  192. package/src/commands/cut.ts +29 -0
  193. package/src/commands/date.ts +24 -0
  194. package/src/commands/deluser.ts +2 -0
  195. package/src/commands/df.ts +18 -0
  196. package/src/commands/diff.ts +29 -0
  197. package/src/commands/du.ts +39 -0
  198. package/src/commands/echo.ts +2 -0
  199. package/src/commands/env.ts +7 -16
  200. package/src/commands/export.ts +11 -24
  201. package/src/commands/find.ts +2 -0
  202. package/src/commands/grep.ts +4 -7
  203. package/src/commands/groups.ts +14 -0
  204. package/src/commands/gzip.ts +31 -0
  205. package/src/commands/head.ts +2 -0
  206. package/src/commands/help.ts +72 -3
  207. package/src/commands/hostname.ts +2 -0
  208. package/src/commands/htop.ts +2 -0
  209. package/src/commands/id.ts +16 -0
  210. package/src/commands/index.ts +98 -99
  211. package/src/commands/kill.ts +14 -0
  212. package/src/commands/ln.ts +2 -0
  213. package/src/commands/ls.ts +2 -0
  214. package/src/commands/mkdir.ts +2 -0
  215. package/src/commands/mv.ts +2 -0
  216. package/src/commands/nano.ts +2 -0
  217. package/src/commands/neofetch.ts +2 -0
  218. package/src/commands/passwd.ts +2 -0
  219. package/src/commands/ping.ts +20 -0
  220. package/src/commands/ps.ts +19 -0
  221. package/src/commands/pwd.ts +2 -0
  222. package/src/commands/rm.ts +2 -0
  223. package/src/commands/sed.ts +45 -0
  224. package/src/commands/set.ts +19 -50
  225. package/src/commands/sh.ts +193 -43
  226. package/src/commands/sleep.ts +14 -0
  227. package/src/commands/sort.ts +37 -0
  228. package/src/commands/su.ts +2 -0
  229. package/src/commands/sudo.ts +2 -0
  230. package/src/commands/tail.ts +2 -0
  231. package/src/commands/tar.ts +58 -0
  232. package/src/commands/tee.ts +25 -0
  233. package/src/commands/touch.ts +2 -0
  234. package/src/commands/tr.ts +24 -0
  235. package/src/commands/tree.ts +2 -0
  236. package/src/commands/uname.ts +20 -0
  237. package/src/commands/uniq.ts +28 -0
  238. package/src/commands/unset.ts +5 -12
  239. package/src/commands/wc.ts +2 -0
  240. package/src/commands/wget.ts +2 -0
  241. package/src/commands/who.ts +2 -0
  242. package/src/commands/whoami.ts +2 -0
  243. package/src/commands/xargs.ts +17 -0
  244. package/src/types/commands.ts +14 -0
  245. package/src/types/pipeline.ts +23 -0
  246. package/standalone.js +92 -64
  247. package/standalone.js.map +4 -4
  248. package/tests/users.test.ts +5 -34
@@ -1,7 +1,70 @@
1
- export function createHelpCommand(getNames) {
1
+ import { getCommandModulesPublic } from "./index";
2
+ const CATEGORY_ORDER = ["navigation", "files", "text", "archive", "system", "network", "shell", "users", "misc"];
3
+ const CATEGORY_LABELS = {
4
+ navigation: "Navigation",
5
+ files: "Files & Filesystem",
6
+ text: "Text Processing",
7
+ archive: "Archive & Compression",
8
+ system: "System",
9
+ network: "Network",
10
+ shell: "Shell",
11
+ users: "Users & Permissions",
12
+ misc: "Miscellaneous",
13
+ };
14
+ function padRight(s, n) {
15
+ return s.length >= n ? s : s + " ".repeat(n - s.length);
16
+ }
17
+ export function createHelpCommand(_getNames) {
2
18
  return {
3
19
  name: "help",
4
- params: [],
5
- run: () => ({ stdout: `Builtins: ${getNames().join(" ")}`, exitCode: 0 }),
20
+ description: "Display this help message",
21
+ category: "shell",
22
+ params: ["[command]"],
23
+ run: ({ args }) => {
24
+ const modules = getCommandModulesPublic();
25
+ // help <command>
26
+ if (args[0]) {
27
+ const mod = modules.find((m) => m.name === args[0] || m.aliases?.includes(args[0]));
28
+ if (!mod)
29
+ return { stderr: `help: no help for '${args[0]}'`, exitCode: 1 };
30
+ const aliases = mod.aliases?.length ? ` aliases: ${mod.aliases.join(", ")}\n` : "";
31
+ const params = mod.params.map((p) => ` ${mod.name} ${p}`).join("\n");
32
+ return {
33
+ stdout: [
34
+ `\x1b[1m${mod.name}\x1b[0m — ${mod.description ?? "no description"}`,
35
+ aliases,
36
+ "Usage:",
37
+ params || ` ${mod.name}`,
38
+ ].filter(Boolean).join("\n"),
39
+ exitCode: 0,
40
+ };
41
+ }
42
+ // Full help — grouped by category
43
+ const grouped = {};
44
+ for (const mod of modules) {
45
+ const cat = mod.category ?? "misc";
46
+ if (!grouped[cat])
47
+ grouped[cat] = [];
48
+ grouped[cat].push(mod);
49
+ }
50
+ const lines = [];
51
+ lines.push("\x1b[1mAvailable commands\x1b[0m");
52
+ lines.push("");
53
+ const cats = [
54
+ ...CATEGORY_ORDER.filter((c) => grouped[c]),
55
+ ...Object.keys(grouped).filter((c) => !CATEGORY_ORDER.includes(c)),
56
+ ];
57
+ for (const cat of cats) {
58
+ const mods = grouped[cat];
59
+ if (!mods || mods.length === 0)
60
+ continue;
61
+ lines.push(`\x1b[33m${CATEGORY_LABELS[cat] ?? cat}\x1b[0m`);
62
+ const sorted = [...mods].sort((a, b) => a.name.localeCompare(b.name));
63
+ for (const mod of sorted) {
64
+ lines.push(` \x1b[36m${padRight(mod.name, 14)}\x1b[0m ${mod.description ?? ""}`);
65
+ }
66
+ }
67
+ return { stdout: lines.join("\n"), exitCode: 0 };
68
+ },
6
69
  };
7
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"hostname.d.ts","sourceRoot":"","sources":["../../src/commands/hostname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,eAAe,EAAE,WAI7B,CAAC"}
1
+ {"version":3,"file":"hostname.d.ts","sourceRoot":"","sources":["../../src/commands/hostname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,eAAe,EAAE,WAM7B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export const hostnameCommand = {
2
2
  name: "hostname",
3
+ description: "Print hostname",
4
+ category: "system",
3
5
  params: [],
4
6
  run: ({ hostname }) => ({ stdout: hostname, exitCode: 0 }),
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"htop.d.ts","sourceRoot":"","sources":["../../src/commands/htop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAUzB,CAAC"}
1
+ {"version":3,"file":"htop.d.ts","sourceRoot":"","sources":["../../src/commands/htop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAYzB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export const htopCommand = {
2
2
  name: "htop",
3
+ description: "System monitor",
4
+ category: "system",
3
5
  params: [],
4
6
  run: ({ mode }) => {
5
7
  if (mode === "exec") {
@@ -0,0 +1,3 @@
1
+ import type { ShellModule } from "../types/commands";
2
+ export declare const idCommand: ShellModule;
3
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/commands/id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,SAAS,EAAE,WAavB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const idCommand = {
2
+ name: "id",
3
+ description: "Print user identity",
4
+ category: "system",
5
+ params: ["[user]"],
6
+ run: ({ authUser, shell, args }) => {
7
+ const target = args[0] ?? authUser;
8
+ const uid = target === "root" ? 0 : 1000;
9
+ const gid = uid;
10
+ const isSudo = shell.users.isSudoer(target);
11
+ const groups = isSudo ? `${gid}(${target}),0(root)` : `${gid}(${target})`;
12
+ return { stdout: `uid=${uid}(${target}) gid=${gid}(${target}) groups=${groups}`, exitCode: 0 };
13
+ },
14
+ };
@@ -1,8 +1,11 @@
1
+ /** biome-ignore-all lint/style/useNamingConvention: ENV VARIABLES */
1
2
  import type { VirtualShell } from "../VirtualShell";
2
- import type { CommandContext, CommandMode, CommandResult, ShellModule } from "../types/commands";
3
+ import type { CommandContext, CommandMode, CommandResult, ShellEnv, ShellModule } from "../types/commands";
3
4
  export declare function registerCommand(module: ShellModule): void;
4
5
  export declare function createCustomCommand(name: string, params: string[], run: (ctx: CommandContext) => CommandResult | Promise<CommandResult>): ShellModule;
5
6
  export declare function getCommandNames(): string[];
7
+ export declare function getCommandModulesPublic(): ShellModule[];
6
8
  export declare function resolveModule(name: string): ShellModule | undefined;
7
- export declare function runCommand(rawInput: string, authUser: string, hostname: string, mode: CommandMode, cwd: string, shell: VirtualShell, stdin?: string): Promise<CommandResult>;
9
+ export declare function makeDefaultEnv(authUser: string, hostname: string): ShellEnv;
10
+ export declare function runCommand(rawInput: string, authUser: string, hostname: string, mode: CommandMode, cwd: string, shell: VirtualShell, stdin?: string, env?: ShellEnv): Promise<CommandResult>;
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,MAAM,mBAAmB,CAAC;AA0G3B,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAgBzD;AAED,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,EAChB,GAAG,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,GAClE,WAAW,CAEb;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAG1C;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAGnE;AAgDD,wBAAsB,UAAU,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,KAAK,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CAqDxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,QAAQ,EACR,WAAW,EACX,MAAM,mBAAmB,CAAC;AA8G3B,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAYzD;AAED,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,EAChB,GAAG,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,GAClE,WAAW,CAEb;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAG1C;AAED,wBAAgB,uBAAuB,IAAI,WAAW,EAAE,CAEvD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAGnE;AA8BD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAc3E;AAED,wBAAsB,UAAU,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,aAAa,CAAC,CA+CxB"}
@@ -1,21 +1,32 @@
1
1
  import { adduserCommand } from "./adduser";
2
+ import { awkCommand } from "./awk";
3
+ import { base64Command } from "./base64";
2
4
  import { catCommand } from "./cat";
3
5
  import { cdCommand } from "./cd";
4
6
  import { chmodCommand } from "./chmod";
5
7
  import { clearCommand } from "./clear";
6
8
  import { cpCommand } from "./cp";
7
9
  import { curlCommand } from "./curl";
10
+ import { cutCommand } from "./cut";
11
+ import { dateCommand } from "./date";
8
12
  import { deluserCommand } from "./deluser";
13
+ import { dfCommand } from "./df";
14
+ import { diffCommand } from "./diff";
15
+ import { duCommand } from "./du";
9
16
  import { echoCommand } from "./echo";
10
17
  import { envCommand } from "./env";
11
18
  import { exitCommand } from "./exit";
12
19
  import { exportCommand } from "./export";
13
20
  import { findCommand } from "./find";
14
21
  import { grepCommand } from "./grep";
22
+ import { groupsCommand } from "./groups";
23
+ import { gunzipCommand, gzipCommand } from "./gzip";
15
24
  import { headCommand } from "./head";
16
25
  import { createHelpCommand } from "./help";
17
26
  import { hostnameCommand } from "./hostname";
18
27
  import { htopCommand } from "./htop";
28
+ import { idCommand } from "./id";
29
+ import { killCommand } from "./kill";
19
30
  import { lnCommand } from "./ln";
20
31
  import { lsCommand } from "./ls";
21
32
  import { mkdirCommand } from "./mkdir";
@@ -23,71 +34,68 @@ import { mvCommand } from "./mv";
23
34
  import { nanoCommand } from "./nano";
24
35
  import { neofetchCommand } from "./neofetch";
25
36
  import { passwdCommand } from "./passwd";
37
+ import { pingCommand } from "./ping";
38
+ import { psCommand } from "./ps";
26
39
  import { pwdCommand } from "./pwd";
27
40
  import { rmCommand } from "./rm";
41
+ import { sedCommand } from "./sed";
28
42
  import { setCommand } from "./set";
29
43
  import { shCommand } from "./sh";
44
+ import { sleepCommand } from "./sleep";
45
+ import { sortCommand } from "./sort";
30
46
  import { suCommand } from "./su";
31
47
  import { sudoCommand } from "./sudo";
32
48
  import { tailCommand } from "./tail";
49
+ import { tarCommand } from "./tar";
50
+ import { teeCommand } from "./tee";
33
51
  import { touchCommand } from "./touch";
52
+ import { trCommand } from "./tr";
34
53
  import { treeCommand } from "./tree";
54
+ import { unameCommand } from "./uname";
55
+ import { uniqCommand } from "./uniq";
35
56
  import { unsetCommand } from "./unset";
36
57
  import { wcCommand } from "./wc";
37
58
  import { wgetCommand } from "./wget";
38
59
  import { whoCommand } from "./who";
39
60
  import { whoamiCommand } from "./whoami";
61
+ import { xargsCommand } from "./xargs";
40
62
  const BASE_COMMANDS = [
41
- pwdCommand,
42
- whoamiCommand,
43
- whoCommand,
44
- hostnameCommand,
45
- lsCommand,
46
- cdCommand,
47
- catCommand,
48
- echoCommand,
49
- mkdirCommand,
50
- touchCommand,
51
- rmCommand,
52
- treeCommand,
53
- nanoCommand,
63
+ // Navigation
64
+ pwdCommand, cdCommand, lsCommand, treeCommand,
65
+ // Files
66
+ catCommand, touchCommand, rmCommand, mkdirCommand, cpCommand, mvCommand, lnCommand,
67
+ chmodCommand, findCommand,
68
+ // Text processing
69
+ grepCommand, sedCommand, awkCommand, sortCommand, uniqCommand, wcCommand,
70
+ headCommand, tailCommand, cutCommand, trCommand, teeCommand, xargsCommand,
71
+ diffCommand,
72
+ // Archives
73
+ tarCommand, gzipCommand, gunzipCommand, base64Command,
74
+ // System info
75
+ whoamiCommand, whoCommand, hostnameCommand, idCommand, groupsCommand, unameCommand,
76
+ psCommand, killCommand, dfCommand, duCommand, dateCommand, sleepCommand, pingCommand,
77
+ // Shell
78
+ echoCommand, envCommand, exportCommand, setCommand, unsetCommand, shCommand,
79
+ clearCommand, exitCommand,
80
+ // Editors
81
+ nanoCommand, htopCommand,
82
+ // Network
83
+ curlCommand, wgetCommand,
84
+ // Users
85
+ adduserCommand, passwdCommand, deluserCommand, sudoCommand, suCommand,
86
+ // Misc
54
87
  neofetchCommand,
55
- htopCommand,
56
- adduserCommand,
57
- passwdCommand,
58
- deluserCommand,
59
- sudoCommand,
60
- suCommand,
61
- curlCommand,
62
- envCommand,
63
- wgetCommand,
64
- grepCommand,
65
- exportCommand,
66
- setCommand,
67
- unsetCommand,
68
- shCommand,
69
- clearCommand,
70
- exitCommand,
71
- cpCommand,
72
- mvCommand,
73
- lnCommand,
74
- findCommand,
75
- wcCommand,
76
- headCommand,
77
- tailCommand,
78
- chmodCommand,
79
88
  ];
80
89
  const customCommands = [];
81
- const helpCommand = createHelpCommand(() => getCommandModules().map((cmd) => cmd.name));
82
90
  const commandRegistry = new Map();
83
91
  let cachedCommandNames = null;
92
+ const helpCommand = createHelpCommand(() => getCommandModules().map((cmd) => cmd.name));
84
93
  function buildCache() {
85
94
  commandRegistry.clear();
86
95
  for (const mod of getCommandModules()) {
87
96
  commandRegistry.set(mod.name, mod);
88
- for (const alias of mod.aliases ?? []) {
97
+ for (const alias of mod.aliases ?? [])
89
98
  commandRegistry.set(alias, mod);
90
- }
91
99
  }
92
100
  cachedCommandNames = Array.from(commandRegistry.keys()).sort();
93
101
  }
@@ -98,11 +106,11 @@ export function registerCommand(module) {
98
106
  const normalized = {
99
107
  ...module,
100
108
  name: module.name.trim().toLowerCase(),
101
- aliases: module.aliases?.map((alias) => alias.trim().toLowerCase()),
109
+ aliases: module.aliases?.map((a) => a.trim().toLowerCase()),
102
110
  };
103
111
  const names = [normalized.name, ...(normalized.aliases ?? [])];
104
- if (names.some((name) => name.length === 0 || /\s/.test(name))) {
105
- throw new Error("Command names and aliases must be non-empty and contain no spaces");
112
+ if (names.some((n) => n.length === 0 || /\s/.test(n))) {
113
+ throw new Error("Command names must be non-empty and contain no spaces");
106
114
  }
107
115
  customCommands.push(normalized);
108
116
  buildCache();
@@ -115,6 +123,9 @@ export function getCommandNames() {
115
123
  buildCache();
116
124
  return cachedCommandNames;
117
125
  }
126
+ export function getCommandModulesPublic() {
127
+ return getCommandModules();
128
+ }
118
129
  export function resolveModule(name) {
119
130
  if (!cachedCommandNames)
120
131
  buildCache();
@@ -125,7 +136,7 @@ function splitArgsRespectingQuotes(input) {
125
136
  let current = "";
126
137
  let inQuotes = false;
127
138
  let quoteChar = "";
128
- for (let i = 0; i < input.length; i += 1) {
139
+ for (let i = 0; i < input.length; i++) {
129
140
  const ch = input[i] || "";
130
141
  const prev = i > 0 ? input[i - 1] : "";
131
142
  if ((ch === '"' || ch === "'") && prev !== "\\") {
@@ -155,35 +166,51 @@ function splitArgsRespectingQuotes(input) {
155
166
  }
156
167
  function parseInput(rawInput) {
157
168
  const parts = splitArgsRespectingQuotes(rawInput.trim());
169
+ return { commandName: parts[0]?.toLowerCase() ?? "", args: parts.slice(1) };
170
+ }
171
+ export function makeDefaultEnv(authUser, hostname) {
158
172
  return {
159
- commandName: parts[0]?.toLowerCase() ?? "",
160
- args: parts.slice(1),
173
+ vars: {
174
+ PATH: "/usr/local/bin:/usr/bin:/bin",
175
+ HOME: `/home/${authUser}`,
176
+ USER: authUser,
177
+ LOGNAME: authUser,
178
+ SHELL: "/bin/sh",
179
+ TERM: "xterm-256color",
180
+ HOSTNAME: hostname,
181
+ PS1: "\\u@\\h:\\w\\$ ",
182
+ },
183
+ lastExitCode: 0,
161
184
  };
162
185
  }
163
- export async function runCommand(rawInput, authUser, hostname, mode, cwd, shell, stdin) {
186
+ export async function runCommand(rawInput, authUser, hostname, mode, cwd, shell, stdin, env) {
164
187
  const trimmed = rawInput.trim();
165
188
  if (trimmed.length === 0)
166
189
  return { exitCode: 0 };
167
- if (trimmed.includes("|") || trimmed.includes(">") || trimmed.includes("<")) {
168
- const { parseShellPipeline } = await import("../VirtualShell/shellParser");
169
- const { executePipeline } = await import("../SSHMimic/executor");
170
- const pipeline = parseShellPipeline(trimmed);
171
- if (!pipeline.isValid) {
172
- return { stderr: pipeline.error || "Syntax error", exitCode: 1 };
173
- }
190
+ const shellEnv = env ?? makeDefaultEnv(authUser, hostname);
191
+ // Detect shell operators
192
+ if (/(?<![|&])[|](?![|])/.test(trimmed) ||
193
+ trimmed.includes(">") ||
194
+ trimmed.includes("<") ||
195
+ trimmed.includes("&&") ||
196
+ trimmed.includes("||") ||
197
+ trimmed.includes(";")) {
198
+ const { parseScript } = await import("../VirtualShell/shellParser");
199
+ const { executeStatements } = await import("../SSHMimic/executor");
200
+ const script = parseScript(trimmed);
201
+ if (!script.isValid)
202
+ return { stderr: script.error || "Syntax error", exitCode: 1 };
174
203
  try {
175
- return await executePipeline(pipeline, authUser, hostname, mode, cwd, shell);
204
+ return await executeStatements(script.statements, authUser, hostname, mode, cwd, shell, shellEnv);
176
205
  }
177
206
  catch (error) {
178
- const message = error instanceof Error ? error.message : "Pipeline execution failed";
179
- return { stderr: message, exitCode: 1 };
207
+ return { stderr: error instanceof Error ? error.message : "Execution failed", exitCode: 1 };
180
208
  }
181
209
  }
182
210
  const { commandName, args } = parseInput(trimmed);
183
211
  const mod = resolveModule(commandName);
184
- if (!mod) {
185
- return { stderr: `Command '${trimmed}' not found`, exitCode: 127 };
186
- }
212
+ if (!mod)
213
+ return { stderr: `${commandName}: command not found`, exitCode: 127 };
187
214
  try {
188
215
  return await mod.run({
189
216
  authUser,
@@ -195,10 +222,10 @@ export async function runCommand(rawInput, authUser, hostname, mode, cwd, shell,
195
222
  stdin,
196
223
  cwd,
197
224
  shell,
225
+ env: shellEnv,
198
226
  });
199
227
  }
200
228
  catch (error) {
201
- const message = error instanceof Error ? error.message : "Command failed";
202
- return { stderr: message, exitCode: 1 };
229
+ return { stderr: error instanceof Error ? error.message : "Command failed", exitCode: 1 };
203
230
  }
204
231
  }
@@ -0,0 +1,3 @@
1
+ import type { ShellModule } from "../types/commands";
2
+ export declare const killCommand: ShellModule;
3
+ //# sourceMappingURL=kill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kill.d.ts","sourceRoot":"","sources":["../../src/commands/kill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAWzB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const killCommand = {
2
+ name: "kill",
3
+ description: "Send signal to process",
4
+ category: "system",
5
+ params: ["[-9] <pid>"],
6
+ run: ({ args }) => {
7
+ const pid = args.find((a) => !a.startsWith("-"));
8
+ if (!pid)
9
+ return { stderr: "kill: no pid specified", exitCode: 1 };
10
+ // In virtual env, we just acknowledge the kill
11
+ return { stdout: ``, exitCode: 0 };
12
+ },
13
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ln.d.ts","sourceRoot":"","sources":["../../src/commands/ln.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,SAAS,EAAE,WA0CvB,CAAC"}
1
+ {"version":3,"file":"ln.d.ts","sourceRoot":"","sources":["../../src/commands/ln.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,SAAS,EAAE,WA4CvB,CAAC"}
@@ -2,6 +2,8 @@ import { ifFlag } from "./command-helpers";
2
2
  import { assertPathAccess, resolvePath } from "./helpers";
3
3
  export const lnCommand = {
4
4
  name: "ln",
5
+ description: "Create links",
6
+ category: "files",
5
7
  params: ["[-s] <target> <link_name>"],
6
8
  run: ({ authUser, shell, cwd, args }) => {
7
9
  const symbolic = ifFlag(args, ["-s", "--symbolic"]);
@@ -1 +1 @@
1
- {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../src/commands/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4BrD,eAAO,MAAM,SAAS,EAAE,WAuBvB,CAAC"}
1
+ {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../src/commands/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4BrD,eAAO,MAAM,SAAS,EAAE,WAyBvB,CAAC"}
@@ -23,6 +23,8 @@ function formatDate(date) {
23
23
  }
24
24
  export const lsCommand = {
25
25
  name: "ls",
26
+ description: "List directory contents",
27
+ category: "navigation",
26
28
  params: ["[path]"],
27
29
  run: ({ authUser, shell, cwd, args }) => {
28
30
  const longFormat = ifFlag(args, ["-l", "--long"]);
@@ -1 +1 @@
1
- {"version":3,"file":"mkdir.d.ts","sourceRoot":"","sources":["../../src/commands/mkdir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,YAAY,EAAE,WAmB1B,CAAC"}
1
+ {"version":3,"file":"mkdir.d.ts","sourceRoot":"","sources":["../../src/commands/mkdir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,YAAY,EAAE,WAqB1B,CAAC"}
@@ -2,6 +2,8 @@ import { getArg } from "./command-helpers";
2
2
  import { assertPathAccess, resolvePath } from "./helpers";
3
3
  export const mkdirCommand = {
4
4
  name: "mkdir",
5
+ description: "Make directories",
6
+ category: "files",
5
7
  params: ["<dir>"],
6
8
  run: ({ authUser, shell, cwd, args }) => {
7
9
  if (args.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"mv.d.ts","sourceRoot":"","sources":["../../src/commands/mv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,SAAS,EAAE,WAuCvB,CAAC"}
1
+ {"version":3,"file":"mv.d.ts","sourceRoot":"","sources":["../../src/commands/mv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,SAAS,EAAE,WAyCvB,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { assertPathAccess, resolvePath } from "./helpers";
2
2
  export const mvCommand = {
3
3
  name: "mv",
4
+ description: "Move or rename files",
5
+ category: "files",
4
6
  params: ["<source> <dest>"],
5
7
  run: ({ authUser, shell, cwd, args }) => {
6
8
  const positionals = args.filter((a) => !a.startsWith("-"));
@@ -1 +1 @@
1
- {"version":3,"file":"nano.d.ts","sourceRoot":"","sources":["../../src/commands/nano.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,WAAW,EAAE,WA0BzB,CAAC"}
1
+ {"version":3,"file":"nano.d.ts","sourceRoot":"","sources":["../../src/commands/nano.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,eAAO,MAAM,WAAW,EAAE,WA4BzB,CAAC"}
@@ -2,6 +2,8 @@ import * as path from "node:path";
2
2
  import { assertPathAccess, resolvePath } from "./helpers";
3
3
  export const nanoCommand = {
4
4
  name: "nano",
5
+ description: "Text editor",
6
+ category: "shell",
5
7
  params: ["<file>"],
6
8
  run: ({ authUser, shell, cwd, args }) => {
7
9
  const fileArg = args[0];
@@ -1 +1 @@
1
- {"version":3,"file":"neofetch.d.ts","sourceRoot":"","sources":["../../src/commands/neofetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,eAAe,EAAE,WA+B7B,CAAC"}
1
+ {"version":3,"file":"neofetch.d.ts","sourceRoot":"","sources":["../../src/commands/neofetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,eAAe,EAAE,WAiC7B,CAAC"}
@@ -3,6 +3,8 @@ import { ifFlag } from "./command-helpers";
3
3
  import { getAllEnvVars } from "./set";
4
4
  export const neofetchCommand = {
5
5
  name: "neofetch",
6
+ description: "System info display",
7
+ category: "misc",
6
8
  params: ["[--off]"],
7
9
  run: ({ args, authUser, hostname, shell }) => {
8
10
  const env = getAllEnvVars(authUser);
@@ -1 +1 @@
1
- {"version":3,"file":"passwd.d.ts","sourceRoot":"","sources":["../../src/commands/passwd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,WAsB3B,CAAC"}
1
+ {"version":3,"file":"passwd.d.ts","sourceRoot":"","sources":["../../src/commands/passwd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,aAAa,EAAE,WAwB3B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export const passwdCommand = {
2
2
  name: "passwd",
3
+ description: "Change user password",
4
+ category: "users",
3
5
  params: ["<username> <password>"],
4
6
  run: async ({ authUser, args, shell }) => {
5
7
  const [username, password] = args;
@@ -0,0 +1,3 @@
1
+ import type { ShellModule } from "../types/commands";
2
+ export declare const pingCommand: ShellModule;
3
+ //# sourceMappingURL=ping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/commands/ping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAiBzB,CAAC"}
@@ -0,0 +1,18 @@
1
+ export const pingCommand = {
2
+ name: "ping",
3
+ description: "Send ICMP ECHO_REQUEST (mock)",
4
+ category: "network",
5
+ params: ["[-c <count>] <host>"],
6
+ run: ({ args }) => {
7
+ const host = args.find((a) => !a.startsWith("-")) ?? "localhost";
8
+ const count = 4;
9
+ const lines = [`PING ${host}: 56 data bytes`];
10
+ for (let i = 0; i < count; i++) {
11
+ const ms = (Math.random() * 10 + 1).toFixed(3);
12
+ lines.push(`64 bytes from ${host}: icmp_seq=${i} ttl=64 time=${ms} ms`);
13
+ }
14
+ lines.push(`--- ${host} ping statistics ---`);
15
+ lines.push(`${count} packets transmitted, ${count} received, 0% packet loss`);
16
+ return { stdout: lines.join("\n"), exitCode: 0 };
17
+ },
18
+ };
@@ -0,0 +1,3 @@
1
+ import type { ShellModule } from "../types/commands";
2
+ export declare const psCommand: ShellModule;
3
+ //# sourceMappingURL=ps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ps.d.ts","sourceRoot":"","sources":["../../src/commands/ps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,SAAS,EAAE,WAgBvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const psCommand = {
2
+ name: "ps",
3
+ description: "Report process status",
4
+ category: "system",
5
+ params: ["[-a] [-u] [-x]"],
6
+ run: ({ authUser, shell }) => {
7
+ const sessions = shell.users.listActiveSessions();
8
+ const lines = [" PID TTY TIME CMD"];
9
+ let pid = 1000;
10
+ for (const s of sessions) {
11
+ lines.push(`${String(pid).padStart(5)} ${s.tty.padEnd(12)} 00:00:00 ${s.username === authUser ? "bash" : `bash (${s.username})`}`);
12
+ pid++;
13
+ }
14
+ lines.push(`${String(pid).padStart(5)} pts/0 00:00:00 ps`);
15
+ return { stdout: lines.join("\n"), exitCode: 0 };
16
+ },
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"pwd.d.ts","sourceRoot":"","sources":["../../src/commands/pwd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAC"}
1
+ {"version":3,"file":"pwd.d.ts","sourceRoot":"","sources":["../../src/commands/pwd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,WAMxB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export const pwdCommand = {
2
2
  name: "pwd",
3
+ description: "Print working directory",
4
+ category: "navigation",
3
5
  params: [],
4
6
  run: ({ cwd }) => ({ stdout: cwd, exitCode: 0 }),
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../src/commands/rm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,SAAS,EAAE,WA8BvB,CAAC"}
1
+ {"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../src/commands/rm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,SAAS,EAAE,WAgCvB,CAAC"}
@@ -2,6 +2,8 @@ import { getArg, ifFlag } from "./command-helpers";
2
2
  import { assertPathAccess, resolvePath } from "./helpers";
3
3
  export const rmCommand = {
4
4
  name: "rm",
5
+ description: "Remove files or directories",
6
+ category: "files",
5
7
  params: ["[-r|-rf] <path>"],
6
8
  run: ({ authUser, shell, cwd, args }) => {
7
9
  if (args.length === 0) {
@@ -0,0 +1,3 @@
1
+ import type { ShellModule } from "../types/commands";
2
+ export declare const sedCommand: ShellModule;
3
+ //# sourceMappingURL=sed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sed.d.ts","sourceRoot":"","sources":["../../src/commands/sed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,UAAU,EAAE,WAwCxB,CAAC"}