buninu 0.2.5 → 0.3.1

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 (122) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +100 -2
  3. package/apps/bunmsh/CHANGELOG.md +262 -0
  4. package/apps/bunmsh/LICENSE +21 -0
  5. package/apps/bunmsh/LICENSE-MKSH +295 -0
  6. package/apps/bunmsh/PORTING.md +192 -0
  7. package/apps/bunmsh/README.md +801 -0
  8. package/apps/bunmsh/bunmsh +7 -0
  9. package/apps/bunmsh/bunshell.md +61 -0
  10. package/apps/bunmsh/help/README.md +1945 -0
  11. package/apps/bunmsh/help/alias.md +22 -0
  12. package/apps/bunmsh/help/basename.md +38 -0
  13. package/apps/bunmsh/help/builtin.md +25 -0
  14. package/apps/bunmsh/help/bun.md +27 -0
  15. package/apps/bunmsh/help/bunmsh.md +47 -0
  16. package/apps/bunmsh/help/cat.md +31 -0
  17. package/apps/bunmsh/help/catfancy.md +35 -0
  18. package/apps/bunmsh/help/cd.md +22 -0
  19. package/apps/bunmsh/help/chmod.md +27 -0
  20. package/apps/bunmsh/help/clear.md +21 -0
  21. package/apps/bunmsh/help/colon.md +22 -0
  22. package/apps/bunmsh/help/command.md +27 -0
  23. package/apps/bunmsh/help/cp.md +28 -0
  24. package/apps/bunmsh/help/cut.md +25 -0
  25. package/apps/bunmsh/help/date.md +25 -0
  26. package/apps/bunmsh/help/dirname.md +25 -0
  27. package/apps/bunmsh/help/echo.md +25 -0
  28. package/apps/bunmsh/help/env.md +27 -0
  29. package/apps/bunmsh/help/eval.md +22 -0
  30. package/apps/bunmsh/help/exec.md +22 -0
  31. package/apps/bunmsh/help/exit.md +21 -0
  32. package/apps/bunmsh/help/export.md +22 -0
  33. package/apps/bunmsh/help/false.md +22 -0
  34. package/apps/bunmsh/help/find.md +33 -0
  35. package/apps/bunmsh/help/getopts.md +28 -0
  36. package/apps/bunmsh/help/grep.md +34 -0
  37. package/apps/bunmsh/help/head.md +27 -0
  38. package/apps/bunmsh/help/kill.md +27 -0
  39. package/apps/bunmsh/help/ln.md +28 -0
  40. package/apps/bunmsh/help/ls.md +37 -0
  41. package/apps/bunmsh/help/lsbun.md +29 -0
  42. package/apps/bunmsh/help/lsfancy.md +37 -0
  43. package/apps/bunmsh/help/md5sum.md +21 -0
  44. package/apps/bunmsh/help/mkdir.md +27 -0
  45. package/apps/bunmsh/help/mktemp.md +26 -0
  46. package/apps/bunmsh/help/mv.md +26 -0
  47. package/apps/bunmsh/help/print.md +30 -0
  48. package/apps/bunmsh/help/printf.md +25 -0
  49. package/apps/bunmsh/help/pwd.md +21 -0
  50. package/apps/bunmsh/help/read.md +27 -0
  51. package/apps/bunmsh/help/readonly.md +27 -0
  52. package/apps/bunmsh/help/realpath.md +21 -0
  53. package/apps/bunmsh/help/rm.md +33 -0
  54. package/apps/bunmsh/help/rmdir.md +27 -0
  55. package/apps/bunmsh/help/sed.md +29 -0
  56. package/apps/bunmsh/help/seq.md +29 -0
  57. package/apps/bunmsh/help/serve.md +50 -0
  58. package/apps/bunmsh/help/set.md +26 -0
  59. package/apps/bunmsh/help/sha256sum.md +21 -0
  60. package/apps/bunmsh/help/shift.md +23 -0
  61. package/apps/bunmsh/help/sleep.md +25 -0
  62. package/apps/bunmsh/help/sort.md +29 -0
  63. package/apps/bunmsh/help/source.md +23 -0
  64. package/apps/bunmsh/help/tab.md +30 -0
  65. package/apps/bunmsh/help/tac.md +29 -0
  66. package/apps/bunmsh/help/tail.md +27 -0
  67. package/apps/bunmsh/help/tee.md +25 -0
  68. package/apps/bunmsh/help/test.md +30 -0
  69. package/apps/bunmsh/help/time.md +29 -0
  70. package/apps/bunmsh/help/touch.md +26 -0
  71. package/apps/bunmsh/help/tr.md +26 -0
  72. package/apps/bunmsh/help/true.md +22 -0
  73. package/apps/bunmsh/help/type.md +21 -0
  74. package/apps/bunmsh/help/umask.md +22 -0
  75. package/apps/bunmsh/help/unalias.md +28 -0
  76. package/apps/bunmsh/help/uname.md +31 -0
  77. package/apps/bunmsh/help/unset.md +28 -0
  78. package/apps/bunmsh/help/wc.md +27 -0
  79. package/apps/bunmsh/help/whence.md +26 -0
  80. package/apps/bunmsh/help/which.md +41 -0
  81. package/apps/bunmsh/help/yes.md +23 -0
  82. package/apps/bunmsh/package.json +26 -0
  83. package/apps/bunmsh/serve.js +468 -0
  84. package/apps/bunmsh/single-exe/README.md +402 -0
  85. package/apps/bunmsh/single-exe/assetsHelper.js +371 -0
  86. package/apps/bunmsh/single-exe/assetsLoader.mjs +85 -0
  87. package/apps/bunmsh/single-exe/assetsPacker.js +218 -0
  88. package/apps/bunmsh/single-exe/compiled.js +527 -0
  89. package/apps/bunmsh/single-exe/entry.mjs +17 -0
  90. package/apps/bunmsh/src/cat-fancy.js +117 -0
  91. package/apps/bunmsh/src/cat-operands.js +31 -0
  92. package/apps/bunmsh/src/completion.js +247 -0
  93. package/apps/bunmsh/src/environment.js +61 -0
  94. package/apps/bunmsh/src/fancy-ls.js +186 -0
  95. package/apps/bunmsh/src/find.js +119 -0
  96. package/apps/bunmsh/src/history.js +198 -0
  97. package/apps/bunmsh/src/main.js +776 -0
  98. package/apps/bunmsh/src/mouse.js +103 -0
  99. package/apps/bunmsh/src/shell.js +3557 -0
  100. package/apps/bunmsh/test/catfancy.test.js +102 -0
  101. package/apps/bunmsh/test/reference-source.sh +1 -0
  102. package/apps/bunmsh/test/reference.test.js +677 -0
  103. package/apps/bunmsh/test/serve/README.md +3 -0
  104. package/apps/bunmsh/test/serve/bad.json +1 -0
  105. package/apps/bunmsh/test/serve/data.json +1 -0
  106. package/apps/bunmsh/test/serve/data.json5 +1 -0
  107. package/apps/bunmsh/test/serve/data.jsonc +2 -0
  108. package/apps/bunmsh/test/serve/data.jsonl +2 -0
  109. package/apps/bunmsh/test/serve/data.ndjson +1 -0
  110. package/apps/bunmsh/test/serve/data.toml +3 -0
  111. package/apps/bunmsh/test/serve/data.ts +15 -0
  112. package/apps/bunmsh/test/serve/data.xml +1 -0
  113. package/apps/bunmsh/test/serve/data.yaml +3 -0
  114. package/apps/bunmsh/test/serve/data.yml +1 -0
  115. package/apps/bunmsh/test/serve.test.js +241 -0
  116. package/apps/bunmsh/test/shell.test.js +1778 -0
  117. package/apps/bunmsh/test/t.sh +12 -0
  118. package/apps/native-bridge/native-bridge.js +45 -0
  119. package/apps/xdg-open/xdg-open.js +74 -2
  120. package/bin/init.js +11 -3
  121. package/demo-server.js +64 -0
  122. package/package.json +4 -2
@@ -0,0 +1,34 @@
1
+ ## grep
2
+
3
+ Search text with basic, extended, fixed, recursive, and color modes.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ grep [OPTIONS] PATTERN [FILE ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-E`: Extended regular expressions.
14
+ - `-F`: Fixed-string matching.
15
+ - `-i`: Ignore case.
16
+ - `-q`: Quiet; return status only.
17
+ - `-v`: Invert matches.
18
+ - `-n`: Prefix line numbers.
19
+ - `-o`: Print only matched text.
20
+ - `-r`: Recurse into directories.
21
+ - `-x`: Match whole lines.
22
+ - `--color=always|auto|never`: Control match color; `--colour` is also accepted.
23
+
24
+ ### Example
25
+
26
+ ```sh
27
+ printf 'alpha\nbeta\n' | grep beta
28
+ ```
29
+
30
+ Output:
31
+
32
+ ```text
33
+ beta
34
+ ```
@@ -0,0 +1,27 @@
1
+ ## head
2
+
3
+ Write the first lines or bytes of input.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ head [-n N | -N | -c N | -cN] [FILE ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-n N`, `-N`: Write the first N lines.
14
+ - `-c N`, `-cN`: Write the first N bytes.
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ printf 'one\ntwo\nthree\n' | head -n 2
20
+ ```
21
+
22
+ Output:
23
+
24
+ ```text
25
+ one
26
+ two
27
+ ```
@@ -0,0 +1,27 @@
1
+ ## kill
2
+
3
+ Send a signal to processes.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ kill [-SIGNAL] PID ...
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-SIGNAL`: Select a signal by name or number; the default is SIGTERM.
14
+ - `-0`: Check whether a process can be signalled without sending a signal.
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ kill -0 $$
20
+ echo $?
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ 0
27
+ ```
@@ -0,0 +1,28 @@
1
+ ## ln
2
+
3
+ Create hard or symbolic links.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ ln [-sfT] TARGET LINK
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-s`: Create a symbolic link.
14
+ - `-f`: Replace an existing destination.
15
+ - `-T`: Treat the destination as a normal path, not a directory.
16
+
17
+ ### Example
18
+
19
+ ```sh
20
+ ln -s target.txt link.txt
21
+ readlink link.txt
22
+ ```
23
+
24
+ Output:
25
+
26
+ ```text
27
+ target.txt
28
+ ```
@@ -0,0 +1,37 @@
1
+ ## ls
2
+
3
+ Use the lsfancy emoji and terminal-width-aware listing.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ ls [-aAdlhRtrS1F] [PATH ...]
9
+ ```
10
+
11
+ Because `-h` means human-readable sizes, use `--help` to display this page.
12
+
13
+ ### Options and forms
14
+
15
+ - `-a`: Include `.` and `..` plus hidden entries.
16
+ - `-A`: Include hidden entries except `.` and `..`.
17
+ - `-d`: List directories themselves rather than their contents.
18
+ - `-l`: Use long format.
19
+ - `-h`: Show human-readable sizes; use `--help` for this page.
20
+ - `-R`: Recurse into directories.
21
+ - `-t`: Sort by modification time.
22
+ - `-r`: Reverse the result order.
23
+ - `-S`: Sort by size.
24
+ - `-1`: Print one entry per line.
25
+ - `-F`: Append classify suffixes such as `/`, `@`, and `*`.
26
+
27
+ ### Example
28
+
29
+ ```sh
30
+ builtin ls -l README.md
31
+ ```
32
+
33
+ Output:
34
+
35
+ ```text
36
+ -rw-r--r-- 32221 2026-08-28 17:55 📄 README.md
37
+ ```
@@ -0,0 +1,29 @@
1
+ ## lsbun
2
+
3
+ Invoke Bun Shell's original ls implementation.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ lsbun [OPTIONS] [PATH ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-a`: Include all entries.
14
+ - `-A`: Include hidden entries except `.` and `..`.
15
+ - `-d`: List directories themselves.
16
+ - `-l`: Use long format.
17
+ - `-R`: Recurse into directories.
18
+
19
+ ### Example
20
+
21
+ ```sh
22
+ builtin lsbun README.md
23
+ ```
24
+
25
+ Output:
26
+
27
+ ```text
28
+ README.md
29
+ ```
@@ -0,0 +1,37 @@
1
+ ## lsfancy
2
+
3
+ List files with icons, columns, metadata, sorting, and recursion.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ lsfancy [-aAdlhRtrS1F] [PATH ...]
9
+ ```
10
+
11
+ Because `-h` means human-readable sizes, use `--help` to display this page.
12
+
13
+ ### Options and forms
14
+
15
+ - `-a`: Include `.` and `..` plus hidden entries.
16
+ - `-A`: Include hidden entries except `.` and `..`.
17
+ - `-d`: List directories themselves rather than their contents.
18
+ - `-l`: Use long format, including symlink targets.
19
+ - `-h`: Show human-readable sizes; use `--help` for this page.
20
+ - `-R`: Recurse into directories.
21
+ - `-t`: Sort by modification time.
22
+ - `-r`: Reverse the result order.
23
+ - `-S`: Sort by size.
24
+ - `-1`: Print one entry per line.
25
+ - `-F`: Append `/` for directories, `@` for links, `*` for executables, `=` for sockets, or `|` for FIFOs.
26
+
27
+ ### Example
28
+
29
+ ```sh
30
+ builtin lsfancy -1 README.md
31
+ ```
32
+
33
+ Output:
34
+
35
+ ```text
36
+ 📄 README.md
37
+ ```
@@ -0,0 +1,21 @@
1
+ ## md5sum
2
+
3
+ Print MD5 hashes.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ md5sum [FILE ...]
9
+ ```
10
+
11
+ ### Example
12
+
13
+ ```sh
14
+ printf hello | md5sum
15
+ ```
16
+
17
+ Output:
18
+
19
+ ```text
20
+ 5d41402abc4b2a76b9719d911017c592 -
21
+ ```
@@ -0,0 +1,27 @@
1
+ ## mkdir
2
+
3
+ Create directories with Bun Shell's fallback.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ mkdir [-pv] [--parents] DIRECTORY ...
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-p`, `--parents`: Create missing parent directories and accept existing directories.
14
+ - `-v`, `--vebose`: Request verbose output (`--vebose` is Bun Shell's currently accepted spelling).
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ mkdir -p build/output
20
+ builtin test -d build/output; echo $?
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ 0
27
+ ```
@@ -0,0 +1,26 @@
1
+ ## mktemp
2
+
3
+ Create a temporary file or directory; TEMPLATE ends in XXXXXX.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ mktemp [-d] TEMPLATE
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-d`: Create a directory instead of a file.
14
+ - The template must end in exactly six `X` characters.
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ mktemp sample.XXXXXX
20
+ ```
21
+
22
+ Output:
23
+
24
+ ```text
25
+ sample.a1B2c3
26
+ ```
@@ -0,0 +1,26 @@
1
+ ## mv
2
+
3
+ Move files with Bun Shell's fallback.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ mv [OPTIONS] SOURCE ... DESTINATION
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-f`, `-h`, `-i`, `-n`, `-v`: Currently accepted by Bun Shell but do not change behaviour; `-i` and `-n` do not prevent overwriting.
14
+
15
+ ### Example
16
+
17
+ ```sh
18
+ mv old.txt new.txt
19
+ basename new.txt
20
+ ```
21
+
22
+ Output:
23
+
24
+ ```text
25
+ new.txt
26
+ ```
@@ -0,0 +1,30 @@
1
+ ## print
2
+
3
+ Write arguments with mksh-style print semantics.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ print [-rRnNl] [-uFD] [--] [ARG ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-r`, `-R`: Do not interpret backslash escapes.
14
+ - `-n`: Omit the terminator.
15
+ - `-l`: Separate arguments with newlines.
16
+ - `-N`: Separate and terminate arguments with NUL bytes.
17
+ - `-uFD`: Write to file descriptor 1 or 2; other descriptors are not implemented.
18
+ - `--`: Stop option parsing.
19
+
20
+ ### Example
21
+
22
+ ```sh
23
+ print hello world
24
+ ```
25
+
26
+ Output:
27
+
28
+ ```text
29
+ hello world
30
+ ```
@@ -0,0 +1,25 @@
1
+ ## printf
2
+
3
+ Format and write arguments.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ printf FORMAT [ARG ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - Supported conversions are `%s`, `%d`, `%i`, `%%`, and optional numeric field widths; backslash escapes are also interpreted.
14
+
15
+ ### Example
16
+
17
+ ```sh
18
+ printf '%s=%d\n' answer 42
19
+ ```
20
+
21
+ Output:
22
+
23
+ ```text
24
+ answer=42
25
+ ```
@@ -0,0 +1,21 @@
1
+ ## pwd
2
+
3
+ Print the active directory.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ pwd
9
+ ```
10
+
11
+ ### Example
12
+
13
+ ```sh
14
+ pwd
15
+ ```
16
+
17
+ Output:
18
+
19
+ ```text
20
+ /data/data/com.termux/files/home
21
+ ```
@@ -0,0 +1,27 @@
1
+ ## read
2
+
3
+ Read a line into shell variables.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ read [-r] NAME ...
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-r`: Preserve backslashes instead of treating them as escapes.
14
+ - `--`: Stop option parsing. With no names, assign to `REPLY`.
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ printf 'one two\n' | read first second
20
+ echo "$first/$second"
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ one/two
27
+ ```
@@ -0,0 +1,27 @@
1
+ ## readonly
2
+
3
+ Define variables that cannot be changed.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ readonly [-p] [--] [NAME[=VALUE] ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-p`: Print readonly definitions.
14
+ - `--`: Stop option parsing.
15
+
16
+ ### Example
17
+
18
+ ```sh
19
+ readonly NAME=value
20
+ echo "$NAME"
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ value
27
+ ```
@@ -0,0 +1,21 @@
1
+ ## realpath
2
+
3
+ Print canonical absolute paths.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ realpath PATH ...
9
+ ```
10
+
11
+ ### Example
12
+
13
+ ```sh
14
+ realpath .
15
+ ```
16
+
17
+ Output:
18
+
19
+ ```text
20
+ /data/data/com.termux/files/home/bunmsh
21
+ ```
@@ -0,0 +1,33 @@
1
+ ## rm
2
+
3
+ Remove files and directories with Bun Shell's fallback.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ rm [OPTIONS] FILE ...
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-f`: Ignore missing operands.
14
+ - `-r`, `-R`, `--recursive`: Remove directories recursively.
15
+ - `-v`, `--verbose`: Request verbose output.
16
+ - `-d`, `--dir`: Remove empty directories.
17
+ - `-i`, `--interactive=always`: Prompt for each removal.
18
+ - `-I`, `--interactive=once`: Prompt once.
19
+ - `--interactive=never`: Never prompt.
20
+ - `--preserve-root`, `--no-preserve-root`: Accepted but currently have no effect.
21
+
22
+ ### Example
23
+
24
+ ```sh
25
+ rm unwanted.txt
26
+ builtin test -e unwanted.txt; echo $?
27
+ ```
28
+
29
+ Output:
30
+
31
+ ```text
32
+ 1
33
+ ```
@@ -0,0 +1,27 @@
1
+ ## rmdir
2
+
3
+ Remove empty directories.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ rmdir [-p | --parents] DIRECTORY ...
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-p`, `--parents`: Remove empty parent directories after each operand.
14
+
15
+ ### Example
16
+
17
+ ```sh
18
+ mkdir empty
19
+ rmdir empty
20
+ builtin test -d empty; echo $?
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ 1
27
+ ```
@@ -0,0 +1,29 @@
1
+ ## sed
2
+
3
+ Apply supported print and substitution expressions.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ sed [-nEr] [-e SCRIPT] [-i] [SCRIPT] [FILE ...]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-n`: Suppress automatic output.
14
+ - `-e SCRIPT`, `-eSCRIPT`: Add a script.
15
+ - `-E`, `-r`: Use extended regular expressions.
16
+ - `-i`: Edit files in place.
17
+ - Supported commands include numeric `p` and `s///` with `g` and `p` flags.
18
+
19
+ ### Example
20
+
21
+ ```sh
22
+ printf 'hello world\n' | sed 's/world/bunmsh/'
23
+ ```
24
+
25
+ Output:
26
+
27
+ ```text
28
+ hello bunmsh
29
+ ```
@@ -0,0 +1,29 @@
1
+ ## seq
2
+
3
+ Print a numeric sequence.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ seq [OPTIONS] [FIRST [INCREMENT]] LAST
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `-s TEXT`, `--separator TEXT`: Set the separator.
14
+ - `-t TEXT`, `--terminator TEXT`: Set the terminator.
15
+ - `-w`, `--fixed-width`: Accepted, but currently does not pad values.
16
+
17
+ ### Example
18
+
19
+ ```sh
20
+ seq 3
21
+ ```
22
+
23
+ Output:
24
+
25
+ ```text
26
+ 1
27
+ 2
28
+ 3
29
+ ```
@@ -0,0 +1,50 @@
1
+ ## serve
2
+
3
+ Start the bunmsh HTTP file server.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ serve [--auto-open] [--minapk-webview] [--random-url] [DIRECTORY]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `--auto-open` / `--auto-open=off` / `--auto-open=/path`: Open the serving
14
+ URL after startup, or explicitly disable it, or open a specific path under
15
+ it instead of the root. Looks for `xdg-open` on PATH first regardless of
16
+ platform; falls back to `open` on macOS or `cmd /c start` on Windows only
17
+ when `xdg-open` isn't found. Bare `--auto-open` turns it on; `=off`, `=no`,
18
+ `=false`, or `=` (empty) turns it off, overriding an environment default
19
+ that turned it on; a value starting with `/` (e.g. `--auto-open=/index.html`)
20
+ turns it on and opens that path relative to the served URL instead of the
21
+ root — resolved after any `--random-url` prefix, so the secret prefix is
22
+ still there and the URL still works. The `o` control on stdin (see below)
23
+ opens the same target this flag configured.
24
+ - `--minapk-webview` / `--minapk-webview=N` / `--minapk-webview=off`: Pass
25
+ `MINAPK_WEBVIEW` to the spawned opener. Bare `--minapk-webview` passes `1`;
26
+ `=N` passes the literal digit string `N`; `=off`, `=no`, `=false`, or `=`
27
+ (empty) means don't pass it at all. Not passed by default.
28
+ - `--random-url` / `--random-url=off`: Serve beneath a high-entropy random URL
29
+ prefix (requests without it get `404`), or explicitly disable it. Same
30
+ bare/`=off`/`=no`/`=false`/`=` rules as `--auto-open`.
31
+ - `SERVE_AUTO_OPEN`, `SERVE_MINAPK_WEBVIEW`, and `SERVE_RANDOM_URL` set the
32
+ defaults before CLI flags are applied (accepting `1`, `true`, `yes`, or
33
+ `on`; a digit string for `SERVE_MINAPK_WEBVIEW`; a `/`-led path for
34
+ `SERVE_AUTO_OPEN`); every flag defaults to off/not-passed. A CLI flag
35
+ always overrides its environment default, including turning off something
36
+ the environment turned on.
37
+ - `--` stops option parsing. The optional operand selects the served directory.
38
+
39
+ ### Example
40
+
41
+ ```sh
42
+ serve --random-url public
43
+ ```
44
+
45
+ Output:
46
+
47
+ ```text
48
+ Serving /home/user/public
49
+ http://localhost:3000/AaBIdviNcACxwZF2x3VW0QAaBIdviNcAGsAviNI5B59AAaBIdviNcAKsuNiSJkMrdQAaBIdviNcAOoVDLS5ydB9Q/
50
+ ```
@@ -0,0 +1,26 @@
1
+ ## set
2
+
3
+ Print variables or replace positional parameters.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ set [-- [ARG ...]]
9
+ ```
10
+
11
+ ### Options and forms
12
+
13
+ - `--`: Replace positional parameters with the remaining arguments. With no arguments, print variables.
14
+
15
+ ### Example
16
+
17
+ ```sh
18
+ set -- alpha beta
19
+ echo "$1/$2"
20
+ ```
21
+
22
+ Output:
23
+
24
+ ```text
25
+ alpha/beta
26
+ ```