Files
bare-operating-system/packages/bare-os-seeder/kernel/share/man/man.json
T
2026-04-04 01:20:57 -04:00

2 lines
365 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"schemaVersion":1,"generatedAt":"2026-04-04T05:20:10.811Z","pages":[{"name":"arch","section":1,"title":"print machine hardware name","synopsis":["arch"],"description":"Prints PROCESSOR_ARCHITECTURE or BARE_OS_ARCH (session stub).","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["arch","bare-os","coreutils"],"examples":[{"caption":"basic","code":"arch"}],"listCategory":"coreutils"},{"name":"awk","section":1,"title":"pattern scanning and processing language","synopsis":["awk [OPTION]... [OPERAND]..."],"description":"Pattern-directed scanning and processing. Engine in lib/awk-engine.js; not full POSIX awk.","options":[],"keywords":["awk","pattern","field","script"],"seeAlso":[{"name":"sed","section":1},{"name":"grep","section":1}],"bareOsNotes":"See handbook ch.9 for divergence from Issue 7.","examples":[{"caption":"print column 1","code":"awk '{print $1}' file.txt"},{"caption":"field separator","code":"awk -F: '{print $1}' /etc/passwd"},{"caption":"sum numbers in first column","code":"awk '{s+=$1} END{print s}' nums.txt"},{"caption":"lines matching /re/","code":"awk '/error/{print NR\": \"$0}' log.txt"}],"listCategory":"coreutils"},{"name":"base32","section":1,"title":"encode or decode base32","synopsis":["base32 [-d] [FILE]"],"description":"RFC 4648 Base32; decode emits raw bytes when stdout supports binary.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["base32","bare-os","coreutils"],"examples":[{"caption":"basic","code":"base32"}],"listCategory":"coreutils"},{"name":"base64","section":1,"title":"encode or decode base64","synopsis":["base64 [OPTION]... [FILE]","base64 -d [OPTION]... [FILE]"],"description":"Encodes binary input to Base64, or decodes Base64 to raw bytes. Default reads stdin or FILE; decode output uses raw writes when available (process.stdout.write or ctx.bareOsBinWrite).","options":[{"flag":"-d, --decode","meaning":"Decode incoming Base64"},{"flag":"-w COLS, --wrap","meaning":"Wrap encoded lines at COLS (0 = no wrap)"},{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["base64","bare-os","coreutils"],"examples":[{"caption":"encode a file","code":"base64 < binary.bin > text.b64"},{"caption":"decode","code":"base64 -d text.b64 > out.bin"}],"listCategory":"coreutils"},{"name":"basename","section":1,"title":"strip directory and suffix from pathnames","synopsis":["basename [OPTION]... [OPERAND]..."],"description":"Prints the last path component. Supports multiple paths with -a, suffix removal with -s or a second operand.","options":[{"flag":"-a, --multiple","meaning":"Treat every operand as a path"},{"flag":"-s SUFFIX, --suffix","meaning":"Remove trailing SUFFIX from basename"}],"keywords":["basename","bare-os","coreutils"],"examples":[{"caption":"strip directory","code":"basename /home/user/docs/readme.md"},{"caption":"strip suffix","code":"basename -s .md /path/readme.md"},{"caption":"several paths","code":"basename -a /a/x /b/y"}],"listCategory":"coreutils"},{"name":"basenc","section":1,"title":"encode or decode with alphabet","synopsis":["basenc --base16 [-d] [FILE]"],"description":"Hex (base16) encode/decode only; other alphabets not implemented.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["basenc","bare-os","coreutils"],"examples":[{"caption":"basic","code":"basenc"}],"listCategory":"coreutils"},{"name":"cat","section":1,"title":"concatenate and print files","synopsis":["cat [OPTION]... [OPERAND]..."],"description":"Concatenates operands to stdout. With no operands, reads **`bareStdin(ctx)`**. Operand **`-`** is stdin. When **`process.stdout.write`** exists (host), output uses it so trailing newlines are not altered; otherwise **`ctx.console.log`** is used per chunk.","options":[{"flag":"-n","meaning":"Number all lines (width 6, tab after number)."},{"flag":"-b","meaning":"Number non-empty lines only (implies not **`-n`**)."},{"flag":"-A","meaning":"Equivalent to **`-vET`** (show ends, tabs, and non-printing)."},{"flag":"-e","meaning":"Like **`-vE`**."},{"flag":"-t","meaning":"Like **`-vT`**."},{"flag":"-E","meaning":"Show **$** before each newline."},{"flag":"-T","meaning":"Show tabs as **^I**."},{"flag":"-v","meaning":"Show non-printing characters (**^** / **M-** style)."}],"keywords":["cat","bare-os","coreutils"],"examples":[{"caption":"stdout several files","code":"cat a.txt b.txt"},{"caption":"numbered lines","code":"cat -n file.txt"},{"caption":"stdin explicitly","code":"cat - f.txt"}],"listCategory":"coreutils"},{"name":"chgrp","section":1,"title":"change file group ownership","synopsis":["chgrp [-h] GROUP FILE..."],"description":"Sets the group id (and optional group name) in Hyperdrive metadata on writable paths. GROUP may be a numeric gid or the name root, guest, nobody, or the current session GROUP.","options":[{"flag":"-h, --help","meaning":"Print usage and exit"}],"keywords":["chgrp","bare-os","coreutils","metadata"],"diagnostics":["chgrp: invalid group","chgrp: not supported by this VFS","chgrp: unsupported option"],"bareOsNotes":"Same writable scope as chmod; gid is stored for display and permission checks, not a real multi-user group database.","examples":[{"caption":"set group by numeric gid","code":"chgrp 1000 ~/data/file"},{"caption":"set group to current session group name","code":"chgrp guest ~/tmp/file"}],"listCategory":"coreutils"},{"name":"chmod","section":1,"title":"change file mode bits","synopsis":["chmod MODE FILE...","MODE is octal (e.g. 644) or symbolic (e.g. u+rw)"],"description":"Sets file mode bits on the VFS. Supports POSIX-style symbolic modes (u/g/o/a, +/-/=, rwxX) and octal modes.","options":[],"keywords":["chmod","mode","permission","octal","symbolic"],"diagnostics":["chmod: No such file","chmod: invalid mode"],"bareOsNotes":"Applies to Hyperdrive metadata; not a host inode.","examples":[{"caption":"octal","code":"chmod 644 ~/.profile"},{"caption":"recursive-ish (run find + chmod per file)","code":"find . -type f -name \"*.sh\" -print"},{"caption":"symbolic user bits","code":"chmod u+x script.sh"},{"caption":"all read, owner write","code":"chmod a+r,u+w shared.txt"}],"listCategory":"coreutils"},{"name":"chown","section":1,"title":"change file owner and group","synopsis":["chown [-h] OWNER[:GROUP] FILE...","chown [-h] :GROUP FILE..."],"description":"Updates uid/gid and optional user/group names in Hyperdrive metadata on writable paths (personal drive, /tmp, etc.). Not a multi-user host kernel: OWNER and GROUP are limited to numeric ids and the names root, guest, nobody, or the current session USER/GROUP.","options":[{"flag":"-h, --help","meaning":"Print usage and exit"}],"keywords":["chown","bare-os","coreutils","metadata"],"diagnostics":["chown: invalid owner or group","chown: not supported by this VFS","chown: unsupported option"],"bareOsNotes":"Requires vfs.chown. Identity is still single-session; use login/logout for Ed25519-backed identity, not arbitrary POSIX users.","examples":[{"caption":"set numeric owner and group on a file under $HOME","code":"chown 1000:1000 ~/notes.txt"},{"caption":"change group only (leading colon), keep owner","code":"chown :guest ~/shared.txt"}],"listCategory":"coreutils"},{"name":"cksum","section":1,"title":"write file checksums and sizes","synopsis":["cksum [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of write file checksums and sizes. Full behavior is defined in packages/bare-os-coreutils/src/cksum.js.","options":[],"keywords":["cksum","bare-os","coreutils"],"examples":[{"caption":"checksum file","code":"cksum iso.img"},{"caption":"verify pipeline","code":"cat f | cksum"}],"listCategory":"coreutils"},{"name":"clear","section":1,"title":"clear the terminal screen","synopsis":["clear [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of clear the terminal screen. Full behavior is defined in packages/bare-os-coreutils/src/clear.js.","options":[],"keywords":["clear","bare-os","coreutils"],"examples":[{"caption":"wipe screen","code":"clear"}],"listCategory":"coreutils"},{"name":"comm","section":1,"title":"compare two sorted files line by line","synopsis":["comm [-123] FILE1 FILE2"],"description":"Three columns: lines only in FILE1, only in FILE2, both. Suppress with -1, -2, -3.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["comm","bare-os","coreutils"],"examples":[{"caption":"basic","code":"comm"}],"listCategory":"coreutils"},{"name":"cmp","section":1,"title":"compare two files","synopsis":["cmp [-s] FILE1 FILE2"],"description":"Byte-wise comparison of two regular files. Exit 0 if identical, 1 if different, 2 on error. -s suppresses output.","options":[{"flag":"-s, --silent","meaning":"No output; only set exit status"}],"keywords":["cmp","bare-os","coreutils"],"examples":[{"caption":"basic","code":"cmp a.txt b.txt"}],"listCategory":"coreutils"},{"name":"cp","section":1,"title":"copy files","synopsis":["cp [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of copy files. Full behavior is defined in packages/bare-os-coreutils/src/cp.js.","options":[],"keywords":["cp","bare-os","coreutils"],"examples":[{"caption":"copy file","code":"cp src.txt dest.txt"},{"caption":"into directory","code":"cp a b c ~/backup/"},{"caption":"preserve implied (if implemented)","code":"cp -R proj proj.bak"}],"listCategory":"coreutils"},{"name":"crontab","section":1,"title":"user crontab manipulation","synopsis":["crontab [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of user crontab manipulation. Full behavior is defined in packages/bare-os-coreutils/src/crontab.js.","options":[],"keywords":["crontab","bare-os","coreutils"],"examples":[{"caption":"list jobs","code":"crontab -l"},{"caption":"install from file","code":"crontab ~/.crontab"},{"caption":"remove all","code":"crontab -r"}],"listCategory":"coreutils"},{"name":"curl","section":1,"title":"transfer a URL (Fetch-based client, not libcurl)","synopsis":["curl [options] URL...","curl uses Fetch in the booter (Node fetch or bare-fetch on bare-http1/bare-https), not libcurl."],"description":"HTTP/HTTPS client delegated from the booter. Subset of curl(1) flags; networking is WHATWG Fetch, not https://curl.se libcurl. A minimal `/bin/curl` script exists on the system drive for PATH discovery; the booter delegates to the real implementation before that script runs. See options and exitStatus; ../bare-os-booter/CLI_PARITY.md lists gaps vs full curl.","options":[{"flag":"-X, --request METHOD","meaning":"HTTP method"},{"flag":"-H, --header LINE","meaning":"Request header (repeatable)"},{"flag":"-A, --user-agent STRING","meaning":"Set User-Agent (default curl/VERSION-style string; last -A or -H User-Agent on the command line wins)"},{"flag":"-d, --data / --data-* / --json","meaning":"Request body (POST by default when present)"},{"flag":"-o, --output FILE","meaning":"Write response to VFS path; multiple URLs append .0, .1, …"},{"flag":"-O, --remote-name","meaning":"Write each URL to a local name from the URL path (basename); cannot combine with -o"},{"flag":"-T, --upload-file PATH","meaning":"PUT file body from VFS"},{"flag":"-I, --head","meaning":"HEAD request; with -L, uses HEAD then GET after redirects (curl semantics; see bareOsNotes)"},{"flag":"-i, --include","meaning":"Include response headers in output (non-HEAD)"},{"flag":"-L, --location","meaning":"Follow redirects (GET/POST use fetch follow; -I -L uses manual hops)"},{"flag":"-f, --fail","meaning":"Exit 22 on HTTP 4xx/5xx"},{"flag":"-s, --silent","meaning":"No progress/error to stderr (unless -S)"},{"flag":"-S, --show-error","meaning":"With -s, still show errors on stderr"},{"flag":"-v, --verbose","meaning":"Trace request/response headers to stderr"},{"flag":"-u, --user USER[:PASS]","meaning":"HTTP Basic Authorization"},{"flag":"-m, --max-time SECONDS","meaning":"Abort whole request after SECONDS (AbortSignal). With --connect-timeout, the effective deadline is the minimum of the two when both are set."},{"flag":"--connect-timeout SECONDS","meaning":"Abort deadline from connect phase (same AbortSignal stack as -m); combined with -m as min(max-time, connect-timeout)"},{"flag":"-b, --cookie STRING | FILE","meaning":"Send Cookie header: name=value or load a Netscape cookie file from the VFS (requires ctx.vfs)"},{"flag":"-c, --cookie-jar FILE","meaning":"Read/write JSON cookie jar on the VFS (default ~/.config/bare-os/curl/cookies.json); Set-Cookie responses update the jar"},{"flag":"--cacert FILE","meaning":"PEM CA bundle from the VFS for TLS (Node undici Agent or init.bareOsCurlTls when ctx.httpFetch is set)"},{"flag":"-k, --insecure","meaning":"Skip TLS certificate verification (TLS intent passed to the host fetch implementation)"},{"flag":"-J, --remote-header-name","meaning":"With -O, use Content-Disposition filename when safe (no .. or absolute paths)"},{"flag":"-w, --write-out FORMAT","meaning":"%{http_code}, %{url_effective}, %{size_download}, %{num_redirects} (num_redirects counts 3xx hops only for -I -L)"},{"flag":"-V, --version / -h, --help","meaning":"Version string and short usage"}],"environment":["BARE_OS_DNS_ALLOWLIST — optional comma/whitespace-separated HTTP(S) host allowlist; *.suffix wildcards when entry starts with *."],"keywords":["curl","http","https","fetch","download"],"bareOsNotes":"Not libcurl; implementation is packages/bare-os-booter/lib/curl-cli.js over global fetch (bare-fetch on Pear/Bare via bare-os-ensure-bare-fetch.js). Default User-Agent matches curl/VERSION form. Options and URLs may be interleaved. Host-style URLs without a scheme get http://; protocol-relative //host gets https://. Allowed URL schemes after normalization: http(s), data:, file://. For -I -L, HEAD is sent first; after a redirect, GET is used on the next URL (bare-fetch with redirect: follow keeps HEAD on every hop, so this path is manual). %{num_redirects} in -w reflects that manual redirect count only when -I and -L are both set. See packages/bare-os-booter/CLI_PARITY.md.","exitStatus":["0 — success","1 — no fetch implementation","2 — bad usage or unknown option","7 — network or fetch failure","22 — HTTP error with -f","26 — cannot read upload file (-T)"],"seeAlso":[{"name":"git","section":1},{"name":"jq","section":1},{"name":"wget","section":1}],"listCategory":"coreutils"},{"name":"cut","section":1,"title":"cut out selected fields of each line","synopsis":["cut [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of cut out selected fields of each line. Full behavior is defined in packages/bare-os-coreutils/src/cut.js.","options":[],"keywords":["cut","bare-os","coreutils"],"examples":[{"caption":"fields by delimiter","code":"cut -d: -f1,3 /etc/passwd"},{"caption":"characters","code":"cut -c1-16 file.txt"}],"listCategory":"coreutils"},{"name":"date","section":1,"title":"display or set date and time","synopsis":["date [OPTION]... [OPERAND]..."],"description":"Prints the current date and time, or formats it with a leading +FORMAT string (subset of strftime: %Y %m %d %H %M %S %s %z %a %b %%). Setting the clock is not supported.","options":[{"flag":"-u, --utc","meaning":"Use UTC for default output and +FORMAT"},{"flag":"+FORMAT","meaning":"strftime-like format (see description)"}],"keywords":["date","bare-os","coreutils"],"examples":[{"caption":"RFC-ish output","code":"date"},{"caption":"epoch seconds","code":"date +%s"}],"listCategory":"coreutils"},{"name":"df","section":1,"title":"report file system disk space usage","synopsis":["df [-h] [FILE]"],"description":"Synthetic Hyperdrive free space; not real block devices.","options":[{"flag":"-h, --human-readable","meaning":"Print sizes in powers of 1024 (K, M, …)"},{"flag":"--help","meaning":"Print usage"}],"keywords":["df","bare-os","coreutils"],"examples":[{"caption":"basic","code":"df"}],"listCategory":"coreutils"},{"name":"dir","section":1,"title":"list directory contents","synopsis":["dir [OPTION]... [FILE]..."],"description":"Delegates to ls -C.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["dir","bare-os","coreutils"],"examples":[{"caption":"basic","code":"dir"}],"listCategory":"coreutils"},{"name":"dirname","section":1,"title":"return directory portion of a pathname","synopsis":["dirname [OPTION]... [OPERAND]..."],"description":"Prints the directory portion of each path. -z emits NUL-terminated records (host stdout).","options":[{"flag":"-z, --zero","meaning":"Separate outputs with NUL (requires process.stdout.write)"}],"keywords":["dirname","bare-os","coreutils"],"examples":[{"caption":"parent path","code":"dirname /a/b/c.txt"},{"caption":"compose with basename","code":"p=/x/y/z; echo $(dirname $p)/$(basename $p)"}],"listCategory":"coreutils"},{"name":"dircolors","section":1,"title":"print LS_COLORS from dircolors database","synopsis":["dircolors [-b] [FILE]","dircolors -p"],"description":"With -p, prints the default GNU-like dircolors database. Otherwise reads FILE (or the default database), applies TERM blocks, and outputs LS_COLORS. With -b, prints Bourne-shell export commands.","options":[{"flag":"-b, --sh","meaning":"Print LS_COLORS=… and export LS_COLORS"},{"flag":"-p, --print-database","meaning":"Print default database text"}],"keywords":["dircolors","LS_COLORS","ls","color"],"bareOsNotes":"Subset of GNU dircolors; FILE is read via VFS.","examples":[{"caption":"default database","code":"dircolors -p"},{"caption":"eval in shell","code":"eval \"$(dircolors -b ~/.dir_colors)\""}],"listCategory":"coreutils"},{"name":"du","section":1,"title":"estimate file space usage","synopsis":["du [OPTION]... [OPERAND]..."],"description":"Prints disk usage totals per path: POSIX-ish block counts by default, or human-readable byte totals with -h.","options":[{"flag":"-k","meaning":"1024-byte blocks"},{"flag":"-h, --human-readable","meaning":"IEC-style sizes (K, M, …) from byte totals"},{"flag":"-s, --summarize","meaning":"One line per operand (default behavior here)"}],"keywords":["du","bare-os","coreutils"],"examples":[{"caption":"sizes under cwd","code":"du ."},{"caption":"human-readable","code":"du -h ~"}],"listCategory":"coreutils"},{"name":"edit","section":1,"title":"terminal file editor with syntax highlighting","synopsis":["edit [file]","edit -h|--help"],"description":"Full-screen TUI editor (nano-style) for the Bare OS shell. Uses the session TTY (ctx.replStdin / replStdout), suspends the fish readline layer while active, and reads/writes paths via the VFS. Syntax highlighting is best-effort for JavaScript/TypeScript, JSON, shell, Markdown, and plain text. Files larger than 2,000,000 characters are rejected. The shell alias nano invokes edit.","options":[{"flag":"-h, --help","meaning":"Print usage and exit."}],"keywords":["edit","nano","editor","tty","syntax"],"bareOsNotes":"Requires an interactive TTY (stdin.isTTY). Uses ctx.suspendReplForSubprocess / resumeReplAfterSubprocess around raw mode.","examples":[{"caption":"edit a file","code":"edit README.md"},{"caption":"same via alias","code":"nano foo.js"}],"listCategory":"coreutils"},{"name":"echo","section":1,"title":"write arguments to standard output","synopsis":["echo [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of write arguments to standard output. Full behavior is defined in packages/bare-os-coreutils/src/echo.js.","options":[],"keywords":["echo","bare-os","coreutils"],"examples":[{"caption":"literal","code":"echo hello world"},{"caption":"no newline (if -n supported)","code":"echo -n OK"}],"listCategory":"coreutils"},{"name":"env","section":1,"title":"set the environment for command invocation","synopsis":["env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]"],"description":"Without **COMMAND**, prints the environment sorted by name. With **`-i`** / **`--ignore-environment`**, the environment for the utility starts empty (plus any **`NAME=value`** assignments before the utility). The utility runs via **`ctx.runBinCommand`**. While the utility runs, **`ctx.vfs.env`** (and **`ctx.env`** when present) are temporarily replaced and restored afterward so the parent session is unchanged.","options":[{"flag":"-i, --ignore-environment","meaning":"Start with an empty environment before applying assignments."}],"keywords":["env","bare-os","coreutils"],"examples":[{"caption":"print environment","code":"env"},{"caption":"minimal env and run","code":"env -i PATH=/bin printf '%s' ok"},{"caption":"override for one command","code":"env VAR=value mycmd"}],"listCategory":"coreutils"},{"name":"exit","section":1,"title":"exit the shell or booter session","synopsis":["exit [status]"],"description":"When run as /bin/exit, requests the booter to end the session via ctx.requestBooterExit. Status defaults to 0.","options":[],"keywords":["exit","bare-os","coreutils"],"bareOsNotes":"Also available as a shell builtin with different wiring.","examples":[{"caption":"leave session with status","code":"exit 0"},{"caption":"from script","code":"/bin/exit 42"}],"listCategory":"coreutils"},{"name":"expand","section":1,"title":"convert tabs to spaces","synopsis":["expand [-t N] [FILE]..."],"description":"Uniform tab width (default 8).","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["expand","bare-os","coreutils"],"examples":[{"caption":"basic","code":"expand"}],"listCategory":"coreutils"},{"name":"expr","section":1,"title":"evaluate expressions","synopsis":["expr EXPRESSION"],"description":"Integer + - * / %, comparisons, string = and !=.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["expr","bare-os","coreutils"],"examples":[{"caption":"basic","code":"expr"}],"listCategory":"coreutils"},{"name":"factor","section":1,"title":"factor numbers","synopsis":["factor [NUMBER]..."],"description":"Prime factors by trial division; safe integers only.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["factor","bare-os","coreutils"],"examples":[{"caption":"basic","code":"factor"}],"listCategory":"coreutils"},{"name":"false","section":1,"title":"return false value","synopsis":["false [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return false value. Full behavior is defined in packages/bare-os-coreutils/src/false.js.","options":[],"keywords":["false","bare-os","coreutils"],"examples":[{"caption":"force failure in pipeline tests","code":"false; echo $?"}],"listCategory":"coreutils"},{"name":"find","section":1,"title":"find files","synopsis":["find [PATH...] [EXPRESSION]"],"description":"Walks a directory tree with predicates including -maxdepth, -mindepth, -name, -iname, -path, -regex (full path, JS RegExp), -type, -empty, -mtime, -newer, -prune, -delete (gated by BARE_OS_FIND_DELETE), -exec/-ok … \\; (requires ctx.runBinCommand; BARE_OS_FIND_EXEC_MAX, default 64; -ok needs BARE_OS_FIND_OK=1), and -print0. Not full POSIX find grammar.","options":[{"flag":"-name / -iname","meaning":"Base name glob match (case-sensitive / case-insensitive)"},{"flag":"-regex PAT","meaning":"Full path must match JavaScript RegExp PAT"},{"flag":"-exec / -ok","meaning":"Run a utility with {} replaced by path; terminate with ;"},{"flag":"-print0","meaning":"Separate paths with NUL (requires host stdout)"},{"flag":"-type f|d|l","meaning":"Restrict to file, directory, or symlink"}],"keywords":["find","directory","walk","search"],"bareOsNotes":"Expression syntax is a simplified subset.","examples":[{"caption":"files by name glob","code":"find . -name \"*.js\""},{"caption":"directories only","code":"find . -type d"},{"caption":"max depth","code":"find . -maxdepth 2 -type f"},{"caption":"skip top directory level (GNU-like -mindepth 2)","code":"find . -mindepth 2 -type f"},{"caption":"case-insensitive name","code":"find . -iname \"*.TXT\""}],"listCategory":"coreutils"},{"name":"fmt","section":1,"title":"simple text formatter","synopsis":["fmt [-w WIDTH] [FILE]..."],"description":"Reflow paragraphs (blank-line separated).","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["fmt","bare-os","coreutils"],"examples":[{"caption":"basic","code":"fmt"}],"listCategory":"coreutils"},{"name":"fold","section":1,"title":"wrap each input line","synopsis":["fold [-w WIDTH] [FILE]..."],"description":"Fixed-width wrap without word break.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["fold","bare-os","coreutils"],"examples":[{"caption":"basic","code":"fold"}],"listCategory":"coreutils"},{"name":"getconf","section":1,"title":"get configuration values","synopsis":["getconf [-a] system_var"],"description":"Prints a fixed subset of POSIX-style limit names and values for Bare OS. There is no host sysconf path; constants match the documented JavaScript/VFS environment.","options":[{"flag":"-a","meaning":"Write every known variable (each name on one line, value on the next)"}],"keywords":["getconf","limits","PATH_MAX","POSIX","bare-os","coreutils"],"environment":["BARE_OS_YES_MAX_LINES — max lines yes prints (host passthrough overrides default)","BARE_OS_SHUF_MAX_LINES — max lines shuf holds in memory","BARE_OS_SPLIT_MAX_FILES — max output files split may create","BARE_OS_FIND_EXEC_MAX — max find -exec/-ok invocations per run (also in table)"],"bareOsNotes":"Subset only; unknown names fail with exit status 1. See src/getconf.js for the name table. BARE_OS_NPROC overrides /bin/nproc when passed from the host (see docs/reference/environment-and-posix-appendix.md §14).","examples":[{"caption":"path length limit","code":"getconf PATH_MAX"},{"caption":"list known names and values","code":"getconf -a"}],"listCategory":"coreutils"},{"name":"git-pear","section":1,"title":"Git-in-Pear hints","synopsis":["git-pear help"],"description":"Prints short documentation for git+pear remotes (gip-transport / gip-remote). See packages/bare-os-coreutils/src/git-pear.js.","options":[],"keywords":["git","pear","gip","bare-os"],"examples":[{"caption":"help","code":"git-pear help"}],"listCategory":"coreutils"},{"name":"grep","section":1,"title":"pattern matching utility","synopsis":["grep [-E|-F] [-i] [-v] [-w] [-n] [-c] [-l] [-q] [-s] [-H|-h] [-e pat] ... [-f file] ... [pattern] [file...]"],"description":"Searches input or files for lines matching a pattern. Uses JavaScript RegExp unless -F (fixed string). Not bit-identical to GNU grep.","options":[{"flag":"-E","meaning":"Extended regex (accepted; patterns use JS RegExp)"},{"flag":"-F","meaning":"Fixed string match"},{"flag":"-r, --recursive","meaning":"Recurse into directories (skips **`.git`**; max depth 64); with no file args, searches **`.`**"},{"flag":"-i","meaning":"Ignore case"},{"flag":"-v","meaning":"Invert match"},{"flag":"-w","meaning":"Match whole words (regex: \\b…\\b; fixed: non-alphanumeric boundaries)"},{"flag":"-n","meaning":"Prefix lines with line number"},{"flag":"-c","meaning":"Count matching lines only"},{"flag":"-l","meaning":"List files with matches"},{"flag":"-q","meaning":"Quiet (exit status only)"},{"flag":"-s","meaning":"Suppress error messages"},{"flag":"-H / -h","meaning":"Force / suppress filename prefix"},{"flag":"-e pat","meaning":"Specify pattern"},{"flag":"-f file","meaning":"Read patterns from file"},{"flag":"-A / -B / -C N","meaning":"Print after / before / both context lines around matches"},{"flag":"--color=never|always|auto","meaning":"Highlight matches (default never; auto uses TTY and respects NO_COLOR)"}],"keywords":["grep","search","regex","pattern","filter"],"seeAlso":[{"name":"sed","section":1},{"name":"awk","section":1}],"bareOsNotes":"UTF-16 strings and JS regex differ from strict POSIX/GNU.","examples":[{"caption":"recursive feel (grep each file)","code":"grep -n error *.log"},{"caption":"case insensitive","code":"grep -i todo NOTES.md"},{"caption":"invert (lines without)","code":"grep -v '^#' config"},{"caption":"fixed string (no regex)","code":"grep -F \"v1.0\" CHANGES"},{"caption":"count matches","code":"grep -c FAIL build.log"},{"caption":"only filenames","code":"grep -l main *.js"},{"caption":"multiple patterns","code":"grep -e foo -e bar file.txt"}],"listCategory":"coreutils"},{"name":"groups","section":1,"title":"print group names","synopsis":["groups [USER]"],"description":"Prints supplemental groups from env or primary GROUP.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["groups","bare-os","coreutils"],"examples":[{"caption":"basic","code":"groups"}],"listCategory":"coreutils"},{"name":"head","section":1,"title":"copy the first part of files","synopsis":["head [OPTION]... [OPERAND]..."],"description":"Prints the first part of each file. Supports -n for line count and -c for a byte count (UTF-8 byte-oriented).","options":[{"flag":"-n, --lines=NUM","meaning":"Print the first NUM lines (default 10)"},{"flag":"-c, --bytes=NUM","meaning":"Print the first NUM bytes"},{"flag":"-NUM","meaning":"Shorthand for -n NUM (e.g. head -5 file)"}],"keywords":["head","bare-os","coreutils"],"seeAlso":[{"name":"tail","section":1}],"examples":[{"caption":"first 10 lines","code":"head /etc/os-release"},{"caption":"first N lines","code":"head -n 50 big.log"},{"caption":"first bytes","code":"head -c 80 data.bin"},{"caption":"stdin","code":"cat long.txt | head"}],"listCategory":"coreutils"},{"name":"hdms","section":1,"title":"Hyperswarm distributed map store","synopsis":["hdms [OPTION]... [OPERAND]..."],"description":"Invokes ctx.runHdms when the booter provides HDMS integration; otherwise prints unavailable.","options":[],"keywords":["hdms","hyperswarm","map"],"bareOsNotes":"Optional booter capability.","examples":[{"caption":"when booter wires HDMS","code":"hdms ls /mnt"},{"caption":"otherwise","code":"# prints unavailable without ctx.runHdms"}],"listCategory":"coreutils"},{"name":"help","section":1,"title":"Bare OS help summary","synopsis":["help"],"description":"Prints a one-screen summary of shell builtins and /bin command names. Use man for long-form documentation.","options":[],"keywords":["help","summary","builtins","commands"],"seeAlso":[{"name":"man","section":1},{"name":"bare-os-shell","section":1}],"examples":[{"caption":"quick index","code":"help"},{"caption":"then deep dive","code":"man grep"}],"listCategory":"coreutils"},{"name":"hostid","section":1,"title":"print numeric host identifier","synopsis":["hostid"],"description":"Eight hex digits from HOSTID env or session hash.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["hostid","bare-os","coreutils"],"examples":[{"caption":"basic","code":"hostid"}],"listCategory":"coreutils"},{"name":"hostname","section":1,"title":"set or print hostname","synopsis":["hostname [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of set or print hostname. Full behavior is defined in packages/bare-os-coreutils/src/hostname.js.","options":[],"keywords":["hostname","bare-os","coreutils"],"examples":[{"caption":"show host","code":"hostname"}],"listCategory":"coreutils"},{"name":"id","section":1,"title":"return user identity","synopsis":["id [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return user identity. Full behavior is defined in packages/bare-os-coreutils/src/id.js.","options":[],"keywords":["id","bare-os","coreutils"],"examples":[{"caption":"who am I numerically","code":"id"}],"listCategory":"coreutils"},{"name":"install","section":1,"title":"copy files and set attributes","synopsis":["install [-m MODE] SOURCE DEST"],"description":"Copy one file; optional chmod.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["install","bare-os","coreutils"],"examples":[{"caption":"basic","code":"install"}],"listCategory":"coreutils"},{"name":"join","section":1,"title":"join lines of two files on a common field","synopsis":["join [-t CHAR] [-1 N] [-2 N] FILE1 FILE2"],"description":"Relational join on sorted files.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["join","bare-os","coreutils"],"examples":[{"caption":"basic","code":"join"}],"listCategory":"coreutils"},{"name":"jq","section":1,"title":"command-line JSON processor (jq language subset)","synopsis":["jq [-n] [-R] [-s] [-c] [-r] [-e] [-f file] filter [file...]","jq reads JSON (concatenated values or NDJSON-style streams) from files or stdin."],"description":"Runs a jq filter program against JSON values. The engine is vendored jqjs (pure JavaScript), not the C implementation at https://github.com/jqlang/jq — language coverage and edge cases differ.","options":[{"flag":"-n, --null-input","meaning":"Use null as the sole input (ignore file/stdin for input)"},{"flag":"-R, --raw-input","meaning":"Treat each line as a string instead of JSON"},{"flag":"-s, --slurp","meaning":"Read all inputs into one array; run the filter once"},{"flag":"-c, --compact-output","meaning":"Compact JSON on output"},{"flag":"-r, --raw-output","meaning":"Print strings without JSON quotes"},{"flag":"-e, --exit-status","meaning":"Set exit status from outputs (no output → 4; last false/null → 1)"},{"flag":"-f, --from-file","meaning":"Read filter program from file"}],"keywords":["jq","json","query","filter","jqjs"],"seeAlso":[{"name":"grep","section":1},{"name":"awk","section":1}],"bareOsNotes":"Engine: lib/jq-engine.js from @sscots/jqjs (mwh/jqjs). Missing vs C jq: try/catch, user-defined functions, recurse, many builtins, modules, full Unicode. See upstream jqjs README for the feature matrix.","examples":[{"caption":"pretty-print","code":"jq . data.json"},{"caption":"field","code":"jq .version package.json"},{"caption":"slurp array","code":"jq -s 'map(.x) | add' parts.jsonl"},{"caption":"compact","code":"jq -c '.[] | select(.ok)' items.json"}],"listCategory":"coreutils"},{"name":"ln","section":1,"title":"link files","synopsis":["ln [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of link files. Full behavior is defined in packages/bare-os-coreutils/src/ln.js.","options":[],"keywords":["ln","bare-os","coreutils"],"examples":[{"caption":"symlink","code":"ln -s target name"},{"caption":"hard link (if supported)","code":"ln file linkname"}],"listCategory":"coreutils"},{"name":"login","section":1,"title":"begin a session on the system","synopsis":["login [OPTION]... [OPERAND]..."],"description":"When invoked from /bin, behavior aligns with session identity hooks (see booter). Prefer the shell builtin for passphrase entry.","options":[],"keywords":["login","identity","passphrase"],"seeAlso":[{"name":"logout","section":1}],"examples":[{"caption":"unlock existing identity","code":"login my passphrase words here"},{"caption":"register new","code":"login --new first time passphrase"}],"listCategory":"coreutils"},{"name":"logout","section":1,"title":"end session (save vault)","synopsis":["logout [OPTION]... [OPERAND]..."],"description":"Ends session; may persist vault depending on booter and flags.","options":[],"keywords":["logout","session"],"seeAlso":[{"name":"login","section":1}],"examples":[{"caption":"end session","code":"logout"},{"caption":"save vault hint","code":"logout --save"}],"listCategory":"coreutils"},{"name":"logname","section":1,"title":"return the user's login name","synopsis":["logname [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return the user's login name. Full behavior is defined in packages/bare-os-coreutils/src/logname.js.","options":[],"keywords":["logname","bare-os","coreutils"],"examples":[{"caption":"login name","code":"logname"}],"listCategory":"coreutils"},{"name":"ls","section":1,"title":"list directory contents","synopsis":["ls [-1al] [--color[=never|auto|always]] [--format=single-column] [FILE...]"],"description":"Lists directory contents. Long format shows mode, links, owner, group, size, mtime, and symlink targets. With color (default auto on a TTY), directories, symlinks, executables, and permission bits are highlighted. When stdout is captured by the shell (pipeline or **>** redirect), short format lists **one name per line** (GNU-like), so tools such as **grep** and **sort** see one entry per line.","options":[{"flag":"-a","meaning":"Include names starting with ."},{"flag":"-l","meaning":"Long listing"},{"flag":"-1, --format=single-column, --format=vertical","meaning":"One name per line (short format); same layout when stdout is piped or redirected"},{"flag":"--color[=never|auto|always]","meaning":"ANSI colors: never, auto (TTY only), or always; plain --color is auto"}],"environment":["NO_COLOR — disable color even when a TTY or --color=always"],"keywords":["ls","list","directory","dir"],"bareOsNotes":"Hides .bareos_empty marker like other tools.","examples":[{"caption":"long + hidden","code":"ls -la ~"},{"caption":"one per line","code":"ls -1 /bin | head"},{"caption":"multiple paths","code":"ls /bin /etc"}],"listCategory":"coreutils"},{"name":"man","section":1,"title":"display on-line manual pages","synopsis":["man [-k keyword] [-f name] [-l] [-w] [[section] name]","man reads /share/man/man.json on the system drive."],"description":"Displays manual pages from the merged JSON database. Section 1: /bin and git/shell pages. Section 7: handbook (man handbook) and developer guide (man devguide), merged at build from handbook/*.md and developer-guide/*.md.","options":[{"flag":"-k, --apropos","meaning":"Search keywords and titles (substring)"},{"flag":"-f, --whatis","meaning":"One-line description for exact name"},{"flag":"-l, --list","meaning":"List pages grouped by category (/bin, git/shell, handbook, developer guide), then alphabetically"},{"flag":"-w, --where, --path","meaning":"Print logical path to the manual database (/share/man/man.json)"}],"keywords":["man","manual","help","documentation","apropos","whatis","cheat","examples"],"environment":["MANWIDTH — wrap width (default 72, min 40)","NO_COLOR — disable bold headings on TTY","PAGER=bare-slice — insert section breaks in long pages (optional MAN_SLICE lines per chunk, default 24)"],"seeAlso":[{"name":"help","section":1},{"name":"bare-os-handbook","section":7},{"name":"bare-os-developer-guide","section":7}],"bareOsNotes":"No troff; no embedded DB fallback in v1.","examples":[{"caption":"open page","code":"man sed"},{"caption":"handbook TOC (section 7)","code":"man handbook"},{"caption":"handbook chapter by section","code":"man 7 handbook-01-introduction"},{"caption":"apropos","code":"man -k copy"},{"caption":"whatis","code":"man -f grep"},{"caption":"all pages","code":"man -l"},{"caption":"narrow terminal","code":"MANWIDTH=64 man awk"}],"listCategory":"coreutils"},{"name":"md5sum","section":1,"title":"compute MD5 checksums","synopsis":["md5sum [FILE]..."],"description":"Bundled MD5 (not Web Crypto); GNU-style output lines.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["md5sum","bare-os","coreutils"],"examples":[{"caption":"basic","code":"md5sum"}],"listCategory":"coreutils"},{"name":"mkdir","section":1,"title":"make directories","synopsis":["mkdir [OPTION]... DIRECTORY..."],"description":"Creates directories using the VFS marker convention. **`-m MODE`** sets permission bits (octal) on **`.bareos_empty`**; **`lstat`** on the directory reports **`S_IFDIR`** with those bits (execute bits are implied for user/group/other when the corresponding read bit is set, so traversal still works).","options":[{"flag":"-p, --parents","meaning":"Create parent directories as needed."},{"flag":"-m MODE","meaning":"Directory mode (octal, e.g. **755** or **0755**)."}],"keywords":["mkdir","bare-os","coreutils"],"examples":[{"caption":"one dir","code":"mkdir proj"},{"caption":"parents","code":"mkdir -p a/b/c"},{"caption":"mode","code":"mkdir -m 700 private"}],"listCategory":"coreutils"},{"name":"mkfifo","section":1,"title":"make FIFO special files","synopsis":["mkfifo [OPTION]... [OPERAND]..."],"description":"FIFO special files are not implemented on Hyperdrive. The command reports failure.","options":[],"keywords":["mkfifo","bare-os","coreutils","stub"],"stub":true,"bareOsNotes":"Documented stub; no real pipes as kernel objects.","examples":[{"caption":"stub","code":"# FIFOs not on Hyperdrive — use shell pipelines"}],"listCategory":"coreutils"},{"name":"mktemp","section":1,"title":"create a temporary file or directory","synopsis":["mktemp [OPTION] [TEMPLATE]"],"description":"Creates a file or directory under /tmp (or absolute TEMPLATE). Replaces XXXXXX with random characters. See packages/bare-os-coreutils/src/mktemp.js.","options":[{"flag":"-d","meaning":"create a directory"}],"keywords":["mktemp","bare-os","coreutils"],"examples":[{"caption":"file","code":"mktemp tmp.XXXXXX"},{"caption":"dir","code":"mktemp -d dir.XXXXXX"}],"listCategory":"coreutils"},{"name":"mv","section":1,"title":"move or rename files","synopsis":["mv [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of move or rename files. Full behavior is defined in packages/bare-os-coreutils/src/mv.js.","options":[],"keywords":["mv","bare-os","coreutils"],"examples":[{"caption":"rename","code":"mv old.txt new.txt"},{"caption":"into dir","code":"mv *.txt ~/inbox/"}],"listCategory":"coreutils"},{"name":"nano","section":1,"title":"alias for edit — terminal file editor","synopsis":["nano [file]"],"description":"The /bin/nano script is identical to edit. In the default shell, the name nano is also an alias for edit. See edit(1) for behavior, key bindings, and requirements.","options":[],"keywords":["nano","edit","editor"],"bareOsNotes":"Same implementation as edit; see man edit.","examples":[{"caption":"open a file","code":"nano ~/.barerc"}],"listCategory":"coreutils"},{"name":"nl","section":1,"title":"line numbering utility","synopsis":["nl [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of line numbering utility. Full behavior is defined in packages/bare-os-coreutils/src/nl.js.","options":[],"keywords":["nl","bare-os","coreutils"],"examples":[{"caption":"number all lines","code":"nl README.md"}],"listCategory":"coreutils"},{"name":"nproc","section":1,"title":"print number of processing units","synopsis":["nproc [--all]"],"description":"Counts processor lines in /proc/cpuinfo or BARE_OS_NPROC.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["nproc","bare-os","coreutils"],"examples":[{"caption":"basic","code":"nproc"}],"listCategory":"coreutils"},{"name":"numfmt","section":1,"title":"convert numbers","synopsis":["numfmt [--to=iec|--to=si] [NUMBER]..."],"description":"Human-readable IEC (1024) or SI (1000) scales.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["numfmt","bare-os","coreutils"],"examples":[{"caption":"basic","code":"numfmt"}],"listCategory":"coreutils"},{"name":"od","section":1,"title":"octal dump","synopsis":["od [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of octal dump. Full behavior is defined in packages/bare-os-coreutils/src/od.js.","options":[],"keywords":["od","bare-os","coreutils"],"examples":[{"caption":"hex dump vibe","code":"od -c file.bin | head"}],"listCategory":"coreutils"},{"name":"oidc-publish","section":1,"title":"OIDC client-credentials helper","synopsis":["oidc-publish help","oidc-publish"],"description":"POSTs client_credentials to ${OIDC_ISSUER}/oauth/token when ctx.httpFetch exists and HTTP policy allows. See packages/bare-os-coreutils/src/oidc-publish.js.","options":[],"keywords":["oidc","pear","http","bare-os"],"examples":[{"caption":"help","code":"oidc-publish help"}],"listCategory":"coreutils"},{"name":"paste","section":1,"title":"merge lines of files","synopsis":["paste [-d LIST] [-s] [FILE]..."],"description":"Parallel or serial (-s) column merge.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["paste","bare-os","coreutils"],"examples":[{"caption":"basic","code":"paste"}],"listCategory":"coreutils"},{"name":"pathchk","section":1,"title":"check pathname portability","synopsis":["pathchk [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of check pathname portability. Full behavior is defined in packages/bare-os-coreutils/src/pathchk.js.","options":[],"keywords":["pathchk","bare-os","coreutils"],"examples":[{"caption":"portable path check","code":"pathchk -p \"$HOME/file name\""}],"listCategory":"coreutils"},{"name":"pr","section":1,"title":"paginate or columnate","synopsis":["pr [-w WIDTH] [-n] [FILE]..."],"description":"Minimal column print and optional line numbers.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["pr","bare-os","coreutils"],"examples":[{"caption":"basic","code":"pr"}],"listCategory":"coreutils"},{"name":"printenv","section":1,"title":"print environment variables","synopsis":["printenv [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of print environment variables. Full behavior is defined in packages/bare-os-coreutils/src/printenv.js.","options":[],"keywords":["printenv","bare-os","coreutils"],"examples":[{"caption":"one variable","code":"printenv HOME"},{"caption":"all","code":"printenv"}],"listCategory":"coreutils"},{"name":"printf","section":1,"title":"format and print","synopsis":["printf [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of format and print. Full behavior is defined in packages/bare-os-coreutils/src/printf.js.","options":[],"keywords":["printf","bare-os","coreutils"],"examples":[{"caption":"format","code":"printf \"hex=%x dec=%d\\n\" 255 255"},{"caption":"no newline","code":"printf \"%s\" OK"}],"listCategory":"coreutils"},{"name":"pwd","section":1,"title":"return working directory name","synopsis":["pwd [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return working directory name. Full behavior is defined in packages/bare-os-coreutils/src/pwd.js.","options":[],"keywords":["pwd","bare-os","coreutils"],"examples":[{"caption":"where am I","code":"pwd"}],"listCategory":"coreutils"},{"name":"readlink","section":1,"title":"print symbolic link targets","synopsis":["readlink [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of print symbolic link targets. Full behavior is defined in packages/bare-os-coreutils/src/readlink.js.","options":[],"keywords":["readlink","bare-os","coreutils"],"examples":[{"caption":"symlink target","code":"readlink ~/.config"}],"listCategory":"coreutils"},{"name":"realpath","section":1,"title":"print resolved logical path","synopsis":["realpath [-m] FILE..."],"description":"Prints the VFS-resolved absolute path (same as the shells logical resolution). Does not traverse the host filesystem.","options":[{"flag":"-m, --canonicalize-missing","meaning":"Do not require the path to exist"},{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["realpath","bare-os","coreutils"],"examples":[{"caption":"resolve under $HOME","code":"realpath ./notes.txt"}],"listCategory":"coreutils"},{"name":"rev","section":1,"title":"reverse lines characterwise","synopsis":["rev [FILE]..."],"description":"Reverses each line's characters.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["rev","bare-os","coreutils"],"examples":[{"caption":"basic","code":"rev"}],"listCategory":"coreutils"},{"name":"rm","section":1,"title":"remove files","synopsis":["rm [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of remove files. Full behavior is defined in packages/bare-os-coreutils/src/rm.js.","options":[],"keywords":["rm","bare-os","coreutils"],"examples":[{"caption":"file","code":"rm tmp.txt"},{"caption":"tree","code":"rm -rf build/"}],"listCategory":"coreutils"},{"name":"rmdir","section":1,"title":"remove empty directories","synopsis":["rmdir [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of remove empty directories. Full behavior is defined in packages/bare-os-coreutils/src/rmdir.js.","options":[],"keywords":["rmdir","bare-os","coreutils"],"examples":[{"caption":"empty dir","code":"rmdir olddir"}],"listCategory":"coreutils"},{"name":"savevault","section":1,"title":"encrypt snapshot of personal drive","synopsis":["savevault [OPTION]... [OPERAND]..."],"description":"Encrypts a copy of the personal drive under /.bare/vault/ when identity services are available.","options":[],"keywords":["savevault","vault","encrypt","backup"],"seeAlso":[{"name":"login","section":1}],"examples":[{"caption":"snapshot encrypted vault","code":"savevault"}],"listCategory":"coreutils"},{"name":"sed","section":1,"title":"stream editor","synopsis":["sed [OPTION]... [OPERAND]..."],"description":"Stream editor with a subset of POSIX sed. Large engine is vendored in lib/sed-engine.js.","options":[],"keywords":["sed","stream","edit","substitute"],"seeAlso":[{"name":"awk","section":1},{"name":"grep","section":1}],"bareOsNotes":"JavaScript implementation; edge cases differ from GNU sed.","examples":[{"caption":"substitute first per line","code":"sed 's/foo/bar/' file.txt"},{"caption":"global per line","code":"sed 's/ //g' spaced.txt"},{"caption":"in-place (if supported)","code":"sed -i.bak 's/^/# /' f.cfg"},{"caption":"print line 5 only","code":"sed -n '5p' file"},{"caption":"delete blank lines","code":"sed '/^$/d' file"}],"listCategory":"coreutils"},{"name":"seq","section":1,"title":"print sequences of numbers","synopsis":["seq [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of print sequences of numbers. Full behavior is defined in packages/bare-os-coreutils/src/seq.js.","options":[],"keywords":["seq","bare-os","coreutils"],"examples":[{"caption":"1..10","code":"seq 1 10"},{"caption":"step","code":"seq 0 2 20"}],"listCategory":"coreutils"},{"name":"sha1sum","section":1,"title":"compute SHA-1 checksums","synopsis":["sha1sum [FILE]..."],"description":"Uses Web Crypto SHA-1 when available.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["sha1sum","bare-os","coreutils"],"examples":[{"caption":"basic","code":"sha1sum"}],"listCategory":"coreutils"},{"name":"sha256sum","section":1,"title":"compute SHA-256 checksums","synopsis":["sha256sum [FILE]..."],"description":"Prints SHA-256 hex digests in GNU-style lines (hash, two spaces, name). Uses Web Crypto globalThis.crypto.subtle when available. Reads stdin when no operands or when FILE is -.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["sha256sum","checksum","bare-os","coreutils"],"examples":[{"caption":"checksum files","code":"sha256sum *.js"},{"caption":"stdin","code":"cat f | sha256sum"}],"listCategory":"coreutils"},{"name":"sha512sum","section":1,"title":"compute SHA-512 checksums","synopsis":["sha512sum [FILE]..."],"description":"Uses Web Crypto SHA-512 when available.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["sha512sum","bare-os","coreutils"],"examples":[{"caption":"basic","code":"sha512sum"}],"listCategory":"coreutils"},{"name":"shuf","section":1,"title":"shuffle lines","synopsis":["shuf [FILE]..."],"description":"Shuffles in memory; capped by BARE_OS_SHUF_MAX_LINES.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["shuf","bare-os","coreutils"],"examples":[{"caption":"basic","code":"shuf"}],"listCategory":"coreutils"},{"name":"sleep","section":1,"title":"suspend execution for an interval","synopsis":["sleep [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of suspend execution for an interval. Full behavior is defined in packages/bare-os-coreutils/src/sleep.js.","options":[],"keywords":["sleep","bare-os","coreutils"],"examples":[{"caption":"pause seconds","code":"sleep 2"}],"listCategory":"coreutils"},{"name":"sort","section":1,"title":"sort lines","synopsis":["sort [OPTION]... [FILE]..."],"description":"Sorts lines from files or stdin. Collation follows JavaScript string ordering (and numeric keys when **`-n`**). Stable ordering is only guaranteed when **`-s`** is set.","options":[{"flag":"-c, --check","meaning":"Check whether input is already sorted; exit **1** if not; print a **disorder** diagnostic to stderr (GNU-style)"},{"flag":"-C, --check=quiet, --check=silent","meaning":"Like **`-c`** but no stderr message on failure"},{"flag":"-o, --output FILE","meaning":"Write result to **FILE** instead of stdout (place **`-o`** before file operands)"},{"flag":"-s, --stable","meaning":"Stable sort (preserve original order when keys compare equal)"},{"flag":"-n, --numeric-sort, -g","meaning":"Sort by leading numeric prefix"},{"flag":"-r, --reverse","meaning":"Reverse sort order"},{"flag":"-u, --unique","meaning":"Suppress duplicate lines after sorting; with **`-c`**, require strictly increasing keys (no adjacent duplicates)"},{"flag":"-f, --ignore-case","meaning":"Fold case for ordering"},{"flag":"-t, --field-separator SEP","meaning":"Field delimiter for **`-k`** (use **\\t** for tab)"},{"flag":"-k, --key POS","meaning":"Sort by 1-based field **POS** or **START,END** (blank-separated fields when **`-t`** omitted)"},{"flag":"-","meaning":"Operand reads stdin"}],"keywords":["sort","bare-os","coreutils"],"examples":[{"caption":"lexicographic","code":"sort names.txt"},{"caption":"numeric","code":"sort -n scores.txt"},{"caption":"unique","code":"sort -u tags.txt"},{"caption":"verify sorted","code":"sort -c sorted.txt"},{"caption":"write to file","code":"sort -o out.txt -n nums.txt"}],"listCategory":"coreutils"},{"name":"split","section":1,"title":"split a file into pieces","synopsis":["split [-l N] [-b N] [INPUT [PREFIX]]"],"description":"Line or byte chunks; output count capped.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["split","bare-os","coreutils"],"examples":[{"caption":"basic","code":"split"}],"listCategory":"coreutils"},{"name":"stat","section":1,"title":"display file status","synopsis":["stat [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of display file status. Full behavior is defined in packages/bare-os-coreutils/src/stat.js.","options":[],"keywords":["stat","bare-os","coreutils"],"examples":[{"caption":"metadata","code":"stat ~/README.md"}],"listCategory":"coreutils"},{"name":"sum","section":1,"title":"checksum and count blocks","synopsis":["sum [-r] [FILE]..."],"description":"SysV default or BSD (-r) 16-bit checksum.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["sum","bare-os","coreutils"],"examples":[{"caption":"basic","code":"sum"}],"listCategory":"coreutils"},{"name":"sync","section":1,"title":"flush file system buffers","synopsis":["sync"],"description":"No-op success on Bare OS.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["sync","bare-os","coreutils"],"examples":[{"caption":"basic","code":"sync"}],"listCategory":"coreutils"},{"name":"tac","section":1,"title":"concatenate and print lines in reverse","synopsis":["tac [FILE]..."],"description":"Last line first; per-file order.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["tac","bare-os","coreutils"],"examples":[{"caption":"basic","code":"tac"}],"listCategory":"coreutils"},{"name":"tail","section":1,"title":"copy the last part of a file","synopsis":["tail [OPTION]... [OPERAND]..."],"description":"Prints the last part of each file. Supports -n (line count, including +N to start at line N), -c (bytes, including +K to start at byte K), and -f/--follow for Hyperdrive-backed files. Follow mode uses vfs.watch when available (see BARE_OS_VFS_WATCH) and otherwise polls (BARE_OS_TAIL_F_POLL_MS, default 1000). For automated tests, BARE_OS_TAIL_F_MAX_ROUNDS limits poll iterations (unset = unlimited). Stdin follow is not supported (shell stdin is a captured string). Following multiple files at once is not supported.","options":[{"flag":"-n, --lines=[+]NUM","meaning":"Last NUM lines, or from line NUM onward if +NUM"},{"flag":"-c, --bytes=[+]NUM","meaning":"Last NUM bytes, or from byte NUM onward if +NUM"},{"flag":"-f, --follow","meaning":"Print appended data as the file grows (one file only)"},{"flag":"-F","meaning":"Same as -f (retry-on-truncate not distinct on Bare OS)"}],"environment":["BARE_OS_TAIL_F_POLL_MS — milliseconds between polls when watch is unavailable or capped","BARE_OS_TAIL_F_MAX_ROUNDS — max poll cycles after initial output (empty = unlimited)","BARE_OS_VFS_WATCH=0 — disable Hyperdrive watch; tail -f uses polling only"],"keywords":["tail","follow","log","bare-os","coreutils"],"seeAlso":[{"name":"head","section":1}],"examples":[{"caption":"last lines","code":"tail -n 20 app.log"},{"caption":"follow a log","code":"tail -f /var/log/app.log"},{"caption":"last bytes","code":"tail -c 512 image.bin"}],"listCategory":"coreutils"},{"name":"tee","section":1,"title":"duplicate standard input","synopsis":["tee [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of duplicate standard input. Full behavior is defined in packages/bare-os-coreutils/src/tee.js.","options":[],"keywords":["tee","bare-os","coreutils"],"examples":[{"caption":"copy stdout to file","code":"cat x | tee copy.txt | wc -l"}],"listCategory":"coreutils"},{"name":"test","section":1,"title":"evaluate a condition","synopsis":["test [OPTION]... [OPERAND]..."],"description":"Evaluates file tests, string equality, and signed integer comparisons. Subset of POSIX test(1).","options":[{"flag":"-eq -ne -lt -le -gt -ge","meaning":"Integer comparisons (decimal)"},{"flag":"-f -d -e -a","meaning":"File type / existence (stat)"},{"flag":"-h -L","meaning":"Symlink (lstat)"},{"flag":"-z -n","meaning":"String empty / non-empty"}],"keywords":["test","bare-os","coreutils"],"examples":[{"caption":"file exists","code":"test -f ~/.barerc && echo yes"},{"caption":"directory","code":"test -d /home/user"},{"caption":"string equal","code":"test \"$USER\" = guest"}],"listCategory":"coreutils"},{"name":"theme","section":1,"title":"switch Bare OS color theme","synopsis":["theme [list|current|set <name>|apply]"],"description":"Lists bundled theme presets, shows the active BARE_OS_THEME, writes theme <name> to ~/.barerc and reapplies colors (when the booter provides bareOsApplyTheme), or reapplies the current theme without editing the file.","options":[],"keywords":["theme","colors","LS_COLORS","prompt"],"bareOsNotes":"Requires ctx.bareOsApplyTheme for set/apply to refresh env; list/current work with static preset names.","examples":[{"caption":"list presets","code":"theme list"},{"caption":"switch to Nord palette","code":"theme set nord"},{"caption":"re-apply after manual env edits","code":"theme apply"}],"listCategory":"coreutils"},{"name":"time","section":1,"title":"time a simple command","synopsis":["time [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of time a simple command. Full behavior is defined in packages/bare-os-coreutils/src/time.js.","options":[],"keywords":["time","bare-os","coreutils"],"examples":[{"caption":"wall time a command","code":"time sort big.txt"}],"listCategory":"coreutils"},{"name":"touch","section":1,"title":"change file timestamps or create files","synopsis":["touch [OPTION]... FILE..."],"description":"Creates missing files (empty) or updates timestamps via **`vfs.writeFile`** with explicit **`mtimeMs`** / **`ctimeMs`** in metadata. Bare has no separate atime; **`-a`** updates **ctime** only and leaves **mtime** unchanged unless a time is given; **`-m`** updates **mtime** only and leaves **ctime** unchanged unless a time is given. Default (neither **`-a`** nor **`-m`**) updates both to the chosen time or now.","options":[{"flag":"-a","meaning":"Change access time only (approximated: **ctime** only; **mtime** unchanged)."},{"flag":"-m","meaning":"Change modification time only (**mtime**; **ctime** unchanged unless a time is given)."},{"flag":"-d, --date","meaning":"Use parsed time (**`Date.parse`**; **`@seconds`** for Unix seconds)."},{"flag":"-r, --reference","meaning":"Use **mtime** of **FILE** (last **`-d`** / **`-r`** wins)."}],"keywords":["touch","bare-os","coreutils"],"examples":[{"caption":"create empty","code":"touch newfile"},{"caption":"set time","code":"touch -d '@315532800' old.txt"},{"caption":"match another file","code":"touch -r template.txt copy.txt"}],"listCategory":"coreutils"},{"name":"tr","section":1,"title":"translate or delete characters","synopsis":["tr [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of translate or delete characters. Full behavior is defined in packages/bare-os-coreutils/src/tr.js.","options":[],"keywords":["tr","bare-os","coreutils"],"examples":[{"caption":"uppercase","code":"echo hi | tr 'a-z' 'A-Z'"},{"caption":"delete chars","code":"tr -d '\\r' < win.txt"}],"listCategory":"coreutils"},{"name":"truncate","section":1,"title":"shrink or extend file size","synopsis":["truncate -s SIZE FILE"],"description":"Absolute size only; pads with zeros.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["truncate","bare-os","coreutils"],"examples":[{"caption":"basic","code":"truncate"}],"listCategory":"coreutils"},{"name":"true","section":1,"title":"return true value","synopsis":["true [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return true value. Full behavior is defined in packages/bare-os-coreutils/src/true.js.","options":[],"keywords":["true","bare-os","coreutils"],"examples":[{"caption":"always success","code":"true && echo ok"}],"listCategory":"coreutils"},{"name":"tsort","section":1,"title":"topological sort","synopsis":["tsort [FILE]"],"description":"Directed edges as pairs per line (A B).","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["tsort","bare-os","coreutils"],"examples":[{"caption":"basic","code":"tsort"}],"listCategory":"coreutils"},{"name":"tty","section":1,"title":"return user's terminal name","synopsis":["tty [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return user's terminal name. Full behavior is defined in packages/bare-os-coreutils/src/tty.js.","options":[],"keywords":["tty","bare-os","coreutils"],"examples":[{"caption":"am I a tty","code":"tty"}],"listCategory":"coreutils"},{"name":"uname","section":1,"title":"return operating system name","synopsis":["uname [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of return operating system name. Full behavior is defined in packages/bare-os-coreutils/src/uname.js.","options":[],"keywords":["uname","bare-os","coreutils"],"examples":[{"caption":"kernel-ish info","code":"uname -a"}],"listCategory":"coreutils"},{"name":"uniq","section":1,"title":"report or filter adjacent duplicate lines","synopsis":["uniq [-c] [-d] [-u] [INPUT]"],"description":"Filters adjacent duplicate lines (input should be sorted for POSIX semantics). Optional OUTPUT operand is accepted for familiarity but ignored; use shell redirects.","options":[{"flag":"-c, --count","meaning":"Prefix lines with occurrence counts"},{"flag":"-d, --repeated","meaning":"Only print duplicate lines (one per group)"},{"flag":"-u, --unique","meaning":"Only print lines that appear once"},{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["uniq","bare-os","coreutils"],"examples":[{"caption":"unique sorted lines","code":"sort names.txt | uniq"},{"caption":"counts","code":"sort log | uniq -c"}],"listCategory":"coreutils"},{"name":"unlink","section":1,"title":"remove a file","synopsis":["unlink FILE"],"description":"Single-file unlink.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["unlink","bare-os","coreutils"],"examples":[{"caption":"basic","code":"unlink"}],"listCategory":"coreutils"},{"name":"unexpand","section":1,"title":"convert spaces to tabs","synopsis":["unexpand [-t N] [FILE]..."],"description":"Uniform tab width spacing to tabs.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["unexpand","bare-os","coreutils"],"examples":[{"caption":"basic","code":"unexpand"}],"listCategory":"coreutils"},{"name":"uptime","section":1,"title":"show uptime","synopsis":["uptime"],"description":"Uses /proc/uptime and /proc/loadavg when present.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["uptime","bare-os","coreutils"],"examples":[{"caption":"basic","code":"uptime"}],"listCategory":"coreutils"},{"name":"users","section":1,"title":"print login names","synopsis":["users"],"description":"Single-session user name.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["users","bare-os","coreutils"],"examples":[{"caption":"basic","code":"users"}],"listCategory":"coreutils"},{"name":"vdir","section":1,"title":"verbose directory listing","synopsis":["vdir [OPTION]... [FILE]..."],"description":"Delegates to ls -l.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["vdir","bare-os","coreutils"],"examples":[{"caption":"basic","code":"vdir"}],"listCategory":"coreutils"},{"name":"wc","section":1,"title":"word, line, and byte or character count","synopsis":["wc [OPTION]... [OPERAND]..."],"description":"Counts newlines, words, and bytes in each file. With no options, prints lines, words, and bytes. Line count is newline count (POSIX).","options":[{"flag":"-l, --lines","meaning":"Print newline counts"},{"flag":"-w, --words","meaning":"Print word counts"},{"flag":"-c, --bytes, -m","meaning":"Print byte counts"},{"flag":"-","meaning":"Operand reads stdin"}],"keywords":["wc","bare-os","coreutils"],"examples":[{"caption":"lines words bytes","code":"wc README.md"},{"caption":"lines only","code":"wc -l *.txt"},{"caption":"stdin","code":"cat f | wc -l"}],"listCategory":"coreutils"},{"name":"wget","section":1,"title":"non-interactive network download (Fetch-based, not GNU wget2)","synopsis":["wget [options] URL...","wget is implemented in the booter with the Fetch API (Node fetch or bare-fetch), not the C GNU wget2 tree."],"description":"Downloads resources over HTTP or HTTPS into the VFS. Bare OS does not ship GNU wget or wget2 (C); this command is a small compatibility-oriented subset built on JavaScript fetch. A minimal `/bin/wget` script exists on the system drive for PATH discovery; the booter delegates to the real implementation before that script runs. Full flag matrix: ../bare-os-booter/CLI_PARITY.md.","options":[{"flag":"-O, --output-document FILE","meaning":"Write the body to FILE; use - for stdout. Only one URL allowed."},{"flag":"-P, --directory-prefix DIR","meaning":"Save under DIR using a name derived from the URL (last path segment, or index.html if the path ends with /)"},{"flag":"-q, --quiet","meaning":"Suppress non-error messages on stderr (saved path lines)"},{"flag":"-c, --continue","meaning":"Resume: if the output file exists, send Range: bytes=<size>-; 206 responses are appended. Cannot use with -O -. If the server returns 416, the download is skipped for that URL (treated as already complete)."},{"flag":"-nc, --no-clobber","meaning":"Skip download when the target file already exists and has size > 0. Cannot combine with --continue."},{"flag":"-U, --user-agent STRING","meaning":"Set User-Agent (default Wget/VERSION (linux-gnu)-style when -U and --header User-Agent are absent)"},{"flag":"-T, --timeout SECONDS","meaning":"Abort the request after SECONDS (AbortController); whole-request timer, not connect-only"},{"flag":"--header LINE","meaning":"Extra header Name: value (repeatable). If you set Range, -c will not add another."},{"flag":"--post-data STRING","meaning":"POST body (sets method POST; default Content-Type application/x-www-form-urlencoded)"},{"flag":"--post-file PATH","meaning":"POST body read from a file on the VFS"},{"flag":"-V, --version","meaning":"Print Bare OS wget version string"},{"flag":"-h, --help","meaning":"Short usage"}],"environment":["BARE_OS_DNS_ALLOWLIST — optional comma/whitespace-separated HTTP(S) host allowlist; *.suffix wildcards when entry starts with *."],"keywords":["wget","download","http","https","fetch","mirror"],"bareOsNotes":"Not GNU wget2; packages/bare-os-booter/lib/wget-cli.js. Default User-Agent matches GNU wget-style Wget/VERSION (linux-gnu). -U overrides; --header User-Agent is used if present unless -U is set. Options and URLs may be interleaved; short options can be clustered (e.g. -qO-, -T30, -c, -nc). Host-style URLs without a scheme get http://; //host gets https://. Fetch follows redirects by default (unlike wget without --max-redirect, behavior may differ from GNU wget). No recursive retrieval, FTP, or WARC. Cannot combine -O and -P. Tests may set ctx.httpFetch. See packages/bare-os-booter/CLI_PARITY.md.","seeAlso":[{"name":"curl","section":1},{"name":"git","section":1}],"examples":[{"caption":"save with default name in cwd","code":"wget https://example.com/README"},{"caption":"choose output path","code":"wget -O ~/page.html https://example.com/"},{"caption":"directory prefix","code":"wget -P ~/dl https://example.com/a/b.bin"},{"caption":"stdout","code":"wget -O - -q https://example.com/robots.txt"},{"caption":"resume partial file","code":"wget -c -O ~/big.bin https://example.com/big.bin"}],"exitStatus":["0 — success","1 — generic error (reserved)","2 — bad usage or options","3 — file I/O error (e.g. --post-file unreadable)","4 — network failure or no fetch implementation","8 — HTTP 4xx/5xx response"],"listCategory":"coreutils"},{"name":"which","section":1,"title":"locate a command","synopsis":["which [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of locate a command. Full behavior is defined in packages/bare-os-coreutils/src/which.js.","options":[],"keywords":["which","bare-os","coreutils"],"examples":[{"caption":"resolve on PATH","code":"which ls"}],"listCategory":"coreutils"},{"name":"who","section":1,"title":"show who is logged on","synopsis":["who [OPTION]..."],"description":"Minimal session table from environment.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["who","bare-os","coreutils"],"examples":[{"caption":"basic","code":"who"}],"listCategory":"coreutils"},{"name":"whoami","section":1,"title":"display effective user ID","synopsis":["whoami [OPTION]... [OPERAND]..."],"description":"Bare OS implementation of display effective user ID. Full behavior is defined in packages/bare-os-coreutils/src/whoami.js.","options":[],"keywords":["whoami","bare-os","coreutils"],"examples":[{"caption":"effective user","code":"whoami"}],"listCategory":"coreutils"},{"name":"xargs","section":1,"title":"construct argument lists and invoke utility","synopsis":["xargs [-0] [-I repl] [-n maxargs] [--] [utility [argument ...]]"],"description":"Reads stdin, splits into words (or null-terminated records with -0), and invokes the utility via ctx.runBinCommand in batches. Enforces fixed limits on stdin size, token count, arguments per run, and total invocations.","options":[{"flag":"-0, --null","meaning":"Input items are separated by null bytes instead of whitespace"},{"flag":"-n maxargs, --max-args maxargs","meaning":"Use at most maxargs arguments from stdin per utility invocation (capped at 128)"},{"flag":"-I repl, -irepl","meaning":"Replace repl in utility arguments with each input item (implies -n 1 unless -n is set)"}],"keywords":["xargs","arguments","bare-os","coreutils"],"bareOsNotes":"No host fork; subset of POSIX/GNU xargs. See src/xargs.js for numeric limits.","examples":[{"caption":"pass lines as arguments","code":"printf 'a\\nb\\n' | xargs echo"},{"caption":"one argument per run","code":"printf 'a\\nb\\n' | xargs -n1 echo"},{"caption":"workaround for complex scripts","code":"# for f in *.txt; do grep -l foo $f; done"}],"listCategory":"coreutils"},{"name":"yes","section":1,"title":"output a string repeatedly","synopsis":["yes [STRING]"],"description":"Prints until BARE_OS_YES_MAX_LINES cap.","options":[{"flag":"-h, --help","meaning":"Print usage"}],"keywords":["yes","bare-os","coreutils"],"examples":[{"caption":"basic","code":"yes"}],"listCategory":"coreutils"},{"name":"bare-os-ctx-bare","section":7,"title":"ctx.bare library and drive bundles","synopsis":["# reference — not a shell command"],"description":"Documents BARE_OS_BARE_MODULES and BARE_OS_BARE_DRIVE_BUNDLES for the booter ctx.bare registry. In-image scripts (AsyncFunction) use ctx.bare.<key> instead of import(). Keys come from host dynamic import of packages listed in packages/bare-os-booter/lib/bare-module-manifest.json, then optional merge from trusted IIFE bundles under /lib/bare/bundles/ on the system image (see manifest.json there). Set BARE_OS_BARE_MODULES=0 to omit ctx.bare entirely. Set BARE_OS_BARE_DRIVE_BUNDLES=0 to skip executing drive bundles (host imports only). Rebuild bundles with npm run build -w bare-os-bare-libs.","options":[],"keywords":["BARE_OS_BARE_MODULES","BARE_OS_BARE_DRIVE_BUNDLES","ctx.bare","bare-module-manifest","bare-os-bare-libs"],"environment":["BARE_OS_BARE_MODULES — set to 0 or false to disable ctx.bare (hardened sessions).","BARE_OS_BARE_DRIVE_BUNDLES — set to 0 or false to skip loading /lib/bare/bundles/*.js into ctx.bare."],"seeAlso":[{"name":"bare-os-developer-guide","section":7}],"bareOsNotes":"See developer-guide/05-modules-and-imports.md and 12-bare-modules-and-pear-ecosystem.md.","examples":[],"listCategory":"extra"},{"name":"bare-os-shell","section":1,"title":"Bare OS interactive shell builtins","synopsis":["# builtins only — no full POSIX sh grammar"],"description":"The line-at-a-time shell supports aliases, simple pipelines (simulated), redirection, and the builtins below. Compound commands (if, for, while) are not available.","options":[],"aliases":["sh-builtins"],"keywords":["shell","builtin","cd","export","alias","bare-os-shell","sh-builtins"],"builtins":[{"name":"alias","synopsis":["alias","alias name=value ...","unalias name ..."],"description":"Define or list command aliases. unalias removes definitions."},{"name":"cd","synopsis":["cd [DIR]"],"description":"Change working directory via vfs.chdir; default is HOME."},{"name":"export","synopsis":["export NAME=value ..."],"description":"Set environment variables visible to child /bin invocations."},{"name":"unset","synopsis":["unset NAME ..."],"description":"Remove variables; readonly names cannot be unset."},{"name":"readonly","synopsis":["readonly NAME[=value] ..."],"description":"Mark variables read-only."},{"name":"umask","synopsis":["umask [octal]"],"description":"Show or set shell file creation mask (stored in env UMASK)."},{"name":"command","synopsis":["command -v|-V NAME","command ARGV..."],"description":"Resolve or run a command without using shell functions (none) or aliases for -v/-V."},{"name":"type","synopsis":["type NAME"],"description":"Report whether NAME is a builtin or a path under PATH."},{"name":"login / logout","synopsis":["login [--new] passphrase...","logout [--save]"],"description":"Identity unlock/register and session teardown; require booter hooks."},{"name":":","synopsis":[":"],"description":"No-op builtin."},{"name":"exit","synopsis":["exit [n]"],"description":"Request booter exit with status n (builtin path)."}],"seeAlso":[{"name":"help","section":1},{"name":"man","section":1}],"bareOsNotes":"Pipelines do not use OS pipes; see handbook ch.4 and ch.9.","examples":[{"caption":"pipeline (simulated)","code":"ls -1 /bin | grep man"},{"caption":"redirect out","code":"echo hi > ~/hello.txt"},{"caption":"append","code":"date >> ~/log.txt"},{"caption":"alias + use","code":"alias ll='ls -la'\nll ~"},{"caption":"export for children","code":"export EDITOR=ed\nman ls"},{"caption":"temp var for one command","code":"PATH=/bin man which"}],"listCategory":"extra"},{"name":"systemctl","section":1,"title":"bare-initd service control (systemd-like subset)","synopsis":["systemctl list|list-units","systemctl status [UNIT] [--lines N]","systemctl logs UNIT [--lines N]","systemctl start|stop|restart UNIT","systemctl enable|disable UNIT","systemctl is-enabled UNIT","systemctl is-active UNIT","journalctl -u UNIT [--lines N]"],"description":"Lists and manages session-scoped bare-initd units (kernel-logger, bare-cron, …). Implemented by the booter (kernel-runner); /bin stubs exist for PATH and man(1). enable/disable toggle the personal-drive preset file ~/.config/bare-os/initd/disabled.txt for future boots in the same image. is-enabled reports enabled or disabled; is-active reports active vs inactive from runtime phase (exit 0 vs 3). Logs live under /var/log/bare-os/ when the unit defines a logPath. The legacy name bare-initctl is still accepted by the booter as an alias.","options":[{"flag":"--lines N","meaning":"Tail N lines from the unit log (status, logs, journalctl)"}],"aliases":["bare-initctl"],"keywords":["bare-initd","initctl","service","supervisor","cron","systemd"],"bareOsNotes":"journalctl only supports -u UNIT and optional --lines / -n. Unknown systemd verbs are not implemented.","seeAlso":[{"name":"crontab","section":1},{"name":"bare-os-shell","section":1}],"examples":[{"caption":"list units","code":"systemctl list-units"},{"caption":"restart scheduler","code":"systemctl restart bare-cron"},{"caption":"tail cron errors","code":"journalctl -u bare-cron --lines 20"}],"listCategory":"extra"},{"name":"git","section":1,"title":"Bare OS git front-end (isomorphic-git)","synopsis":["git [-C dir] <subcommand> [ARGUMENTS...]"],"description":"Runs isomorphic-git against the VFS-backed adapter. Remote HTTP(S) uses BARE_OS_GIT_HTTP when set; otherwise Pear bare module fetch.","options":[{"flag":"-C dir","meaning":"Run as if git was started in dir"}],"environment":["BARE_OS_GIT_HTTP — optional fetch implementation for remotes","GIT_* — standard hints where supported"],"keywords":["git","version control","repository","clone","commit","isomorphic-git"],"bareOsNotes":"Not a separate /bin script; booter delegates argv[0]=git to git-cli.js.","seeAlso":[{"name":"bare-os-shell","section":1}],"examples":[{"caption":"new repo","code":"git init -C ~/myrepo"},{"caption":"status","code":"git -C ~/myrepo status"},{"caption":"clone over HTTP (needs remote + fetch)","code":"git clone https://example.com/repo.git ~/work/repo"},{"caption":"config local","code":"git -C ~/myrepo config user.email \"[email protected]\""},{"caption":"log one line","code":"git -C ~/myrepo log --oneline -5"}],"listCategory":"extra"},{"name":"bare-os-handbook","section":7,"title":"Bare OS handbook — table of contents and reading order","synopsis":["man 7 bare-os-handbook","Handbook chapter (plain text from handbook/README.md)"],"description":"BARE OPERATING SYSTEM — HANDBOOK\n\nBare OS is an experimental, P2P-first system image: a Merkle-addressed Hyperdrive you replicate from peers over Hyperswarm, plus a second drive for everything that should stay yours (home, identity, logs). This handbook is the narrative spine—written like a long-form technical article so you can read it cover to cover or jump to a chapter. It explains why the pieces exist, how they connect, and where to look when something breaks.\n\nThis project is experimental research software, not a production OS. It is licensed under Apache-2.0 (LICENSE <../LICENSE>).\n\nHOW THIS HANDBOOK FITS THE REPO\n\n| Doc | Role |\n| Preface — why Bare OS <00-preface.md> | Thesis, comparison to classic images, security limits, outlook, contributor paths |\n| *This handbook (handbook/.md)** | Story, architecture, protocol, runtime, identity, POSIX surface, operations |\n| docs/reference/README.md <../docs/reference/README.md> | File-by-file inventory, env vars, data-flow diagram |\n| developer-guide/README.md <../developer-guide/README.md> | How to write run(ctx, argv) / start(ctx), extend /bin, test under Pear |\n| Kernel extensions <../docs/reference/kernel-extensions.md> | Kernel feature bitmask, seed-channel RPC, capability bits |\n\nThe ctx object is versioned for kernels and scripts that depend on booter behavior. Treat packages/bare-os-booter/CHANGELOG.md <../packages/bare-os-booter/CHANGELOG.md> as the contract history (bareOsCtxApiVersion / BARE_OS_CTX_API_VERSION). TypeScript authors can use packages/bare-os-booter/lib/bare-os-ctx.d.ts <../packages/bare-os-booter/lib/bare-os-ctx.d.ts>.\n\nWHO SHOULD READ WHAT (THREE PATHS)\n\nI want to run it. Start at the root README.md <../README.md>, then Chapter 7 — Operations <07-operations-and-development.md> (install, npm test, seeder/booter, Pear). Skim Chapter 1 <01-introduction.md> for vocabulary.\n\nI want to change the image or /bin. Read Preface <00-preface.md> → Chapter 6 <06-kernel-and-binaries.md> → the developer guide <../developer-guide/README.md>, especially extending coreutils <../developer-guide/06-extending-bin-coreutils.md> and the ctx object <../developer-guide/02-the-context-object.md>.\n\nI want the architecture and trust model. Read Preface <00-preface.md> → Chapter 2 — Blueprints <02-blueprints.md> → Chapter 3 — Protocol <03-protocol-and-disk.md> → Chapter 4 — Booter runtime <04-the-booter-runtime.md> → Chapter 5 — Identity <05-identity-vault-and-hdms.md>.\n\nCHAPTERS\n\n| Chapter | Topic |\n| Preface <00-preface.md> | Whitepaper-style thesis, doc map, security limits, research directions, contributing |\n| 01 — Introduction <01-introduction.md> | Goals, vocabulary, Holepunch stack, clone-to-prompt story |\n| 02 — Blueprints <02-blueprints.md> | Layered architecture, trust, boot-flow diagram |\n| 03 — Protocol and disk <03-protocol-and-disk.md> | MBR, swarm, Protomux, SwarmDisk, failure matrix |\n| 04 — The booter runtime <04-the-booter-runtime.md> | ctx, VFS, shell, kernel, initd, cron, REPL, host bridges |\n| 05 — Identity, vault, HDMS <05-identity-vault-and-hdms.md> | Guest vs user, account blob, vault, extra drives |\n| 06 — Kernel and binaries <06-kernel-and-binaries.md> | /boot/init.js, coreutils pipeline, /bin summary |\n| 07 — Operations and development <07-operations-and-development.md> | CI, pretest, Pear channels, env vars, troubleshooting |\n| 08 — Git on Bare OS <08-git-on-bare-os.md> | isomorphic-git, VFS adapter, HTTP modes |\n| 09 — POSIX utilities, shell, VFS <09-posix-utilities-shell-and-vfs.md> | XCU-style /bin, shell, divergence from Issue 7 |\n| 10 — Manual pages and online help <10-manpages-and-online-help.md> | man(1), JSON DB, handbook ingest, help vs man |\n\nPear workflows, ctx.bare, drive bundles: developer-guide ch.11 <../developer-guide/11-kernel-pear-cookbook.md> and ch.12 <../developer-guide/12-bare-modules-and-pear-ecosystem.md>.\n\nPACKAGES IN ONE SENTENCE EACH\n\n- bare-os-protocol <../packages/bare-os-protocol/README.md> — Shared topic string, MBR layout, Protomux message IDs, and kernel feature bits used by seeder and booter.\n- bare-os-seeder <../packages/bare-os-seeder/README.md> — Stages kernel/ into a system Hyperdrive, publishes the MBR block and joins the swarm so booters can replicate the image.\n- bare-os-booter <../packages/bare-os-booter/README.md> — Joins the swarm, opens system + personal drives, builds ctx, runs /boot/init.js, shell, initd, cron, and delegated tools (git, curl, wget).\n- bare-os-coreutils <../packages/bare-os-coreutils/README.md> — Sources and build for /bin utilities plus the merged man.json database.\n- bare-os-bare-libs <../packages/bare-os-bare-libs/README.md> — Builds optional /lib/bare bundles merged into ctx.bare when enabled.\n\nThe staged tree also includes kernel/README.md <../kernel/README.md> (what lands on the system drive) and scripts/README.md <../scripts/README.md> (repo automation). Pear release links and host env notes: PEAR-RUN.md <../PEAR-RUN.md>.\n\nROOT README\n\nThe top-level README.md <../README.md> is the short runbook (clone, npm ci, seeder/booter commands). Use it when you only need copy-paste steps.\n\n_License: Apache-2.0 — see LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","bare","os","table","contents","and","reading","order"],"seeAlso":[{"name":"handbook-00-preface","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/README.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","aliases":["handbook","bare-os-handbook-index"],"listCategory":"handbook"},{"name":"handbook-00-preface","section":7,"title":"Preface — why Bare OS exists","synopsis":["man 7 handbook-00-preface","Handbook chapter (plain text from handbook/00-preface.md)"],"description":"PREFACE — WHY BARE OS EXISTS\n\nTime to read: about 12 minutes. Prerequisites: curiosity about peer-to-peer software; no Holepunch background required.\n\nMost operating system images are fetched from a single place: an HTTP mirror, a registry, or a block device someone prepared for you. Bare operating system asks a different question: what if the “golden image” were a content-addressed tree that many peers could help you replicate, so discovery and distribution look more like joining a swarm than downloading a monolithic blob?\n\nThis preface states the thesis in plain language, places the project next to familiar ideas, names what the design does not promise, and points you to the chapters that unpack each layer. The code in this repository is experimental research software—useful for learning and prototyping, not audited for production threat models.\n\nTHE THESIS IN ONE PARAGRAPH\n\nBare OS is a Unix-flavored environment whose system root lives on a Hyperdrive keyed from a tiny 512-byte MBR you read from peers. A seeder application publishes that drive; a booter application finds peers on a fixed Hyperswarm topic, replicates the drive, mounts a separate personal Hyperdrive for mutable state, and runs a JavaScript kernel (/boot/init.js) and a Tier-1 /bin built from small AsyncFunction scripts. Execution is one host process (Pear or Node) simulating POSIX paths, a line shell, and synthetic /proc-style views—not a hardware kernel.\n\nHOW THIS HANDBOOK RELATES TO OTHER DOCS\n\n- Handbook (handbook/.md) — Story and mental model*: why two drives, how the wire protocol boots the image, what the shell and identity layers do.\n- docs/reference/ <../docs/reference/README.md> — Where everything lives: package paths, complete environment variable tables, byte-level MBR layout.\n- developer-guide/ <../developer-guide/README.md> — How to implement: ctx fields, coreutils build, testing with Brittle, Pear staging.\n\nIf you edit handbook Markdown, those files are also ingested into man(7) inside the image (see Chapter 10 <10-manpages-and-online-help.md>); diagrams in mermaid fences are omitted in the terminal viewer—read the repo for figures.\n\nCOMPARISON FRAME (NOT MARKETING)\n\nVersus a static ISO or container layer: the system image is still “files in a tree,” but replication is sparse and keyed: peers contribute blocks; you verify structure against Hyperdrive semantics rather than trusting a single CDN tarball.\n\nVersus a traditional multi-user kernel: there is no fork, no hardware isolation between “processes,” and no guarantee that malicious /bin scripts cannot read host memory. Commands are JavaScript in the booters realm. See Security and limits <#security-and-limits> below.\n\nVersus “put / on IPFS”: the stack here is Holepunch-shaped (Corestore, Hyperdrive, Hyperswarm, Protomux) with a deliberate boot protocol (MBR block 0, seed channel, optional capability RPC). The goal is a coherent dev story (seeder + booter Pear apps), not maximal compatibility with every content network.\n\nSECURITY AND LIMITS\n\nBare OS separates system (replicated image) from personal (your writable drive), but does not sandbox the shell: anything execLine can do inherits the Pear/Node process capabilities. Identity uses PBKDF2 and AEAD for the on-disk account blob and vault snapshots—passphrase quality still matters, and ciphertext only stays private if replication and backups are under your control.\n\nFor a developer-oriented trust discussion (eval boundaries, import vs in-image scripts), read developer-guide — Security and trust <../developer-guide/09-security-and-trust.md>. Chapter 5 adds a trust boundary <05-identity-vault-and-hdms.md#trust-boundaries-what-the-design-does-not-promise> summary for identity and HDMS.\n\nRESEARCH DIRECTIONS\n\nThe codebase is a testbed for P2P distribution, POSIX ergonomics on Hyperdrive, optional ctx.bare module bundles, seed-channel capability negotiation, and Pear host bridges (reload, mirrors, snapshots). Open threads include stronger isolation (workers, Pear isolates), richer networking parity, and operational hardening. Treat roadmap bullets in Chapter 4 <04-the-booter-runtime.md#roadmap-and-out-of-scope> as current intent, not commitments.\n\nCONTRIBUTING — FIRST STEPS\n\n- Documentation: Follow the voice of this handbook (short hooks, clear “related” links). Run npm run build -w bare-os-coreutils after changing man pages; handbook ingest runs in that build.\n- Code: Read developer-guide README <../developer-guide/README.md>, then the package README for the area you touch (bare-os-booter, bare-os-coreutils, etc.). Run npm test from the repo root before opening a PR.\n\nWHERE TO READ NEXT\n\n| Goal | Next chapter |\n| Vocabulary and a clone-to-prompt story | Chapter 1 — Introduction <01-introduction.md> |\n| Boxes, arrows, trust | Chapter 2 — Blueprints <02-blueprints.md> |\n| Wire format and failure modes | Chapter 3 — Protocol and disk <03-protocol-and-disk.md> |\n\nRelated: Handbook home <README.md> · Root README <../README.md> · docs/reference <../docs/reference/README.md> · CHANGELOG — ctx API <../packages/bare-os-booter/CHANGELOG.md>\n\n_This project is experimental research software, not a production OS. License: Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","00","preface","why","bare","exists"],"seeAlso":[{"name":"handbook-01-introduction","section":7},{"name":"bare-os-handbook","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/00-preface.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-01-introduction","section":7,"title":"Chapter 1 — Introduction: what “Bare OS” is","synopsis":["man 7 handbook-01-introduction","Handbook chapter (plain text from handbook/01-introduction.md)"],"description":"CHAPTER 1 — INTRODUCTION: WHAT “BARE OS” IS\n\nTime to read: about 8 minutes. Prerequisites: none; Preface <00-preface.md> first if you want the thesis in essay form.\n\nIf you have only a minute: Bare operating system is a tiny Unix-flavored environment whose root filesystem is a Hyperdrive replicated from peers. A seeder publishes that drive and a 512-byte MBR over Hyperswarm; a booter joins the swarm, downloads the image, mounts a second Hyperdrive for per-user mutable state, and runs JavaScript “kernel” and /bin scripts inside a Bare or Node runtime.\n\nThe rest of this chapter sets vocabulary straight—without it, the architecture diagrams in Chapter 2 <02-blueprints.md> will not stick.\n\nFROM GIT CLONE TO A FIRST PROMPT (STORY, NOT A RUNBOOK)\n\nImagine two terminals on the same machine. In one you run the seeder: it loads the kernel/ tree into a system Hyperdrive, writes a 512-byte MBR (magic BIOS, embedded public keys), and joins Hyperswarm on the project topic plus the drives discovery key. In the other you run the booter: it joins the topic, finds a peer, opens a Protomux channel, reads block 0, parses the MBR, opens the system drive by key, creates your personal drive, and hands off to /boot/init.js. You see a line prompt; everything “POSIX” after that is the booters VFS and shell simulating a machine.\n\nExact commands, env vars, and Pear workflows live in Chapter 7 — Operations <07-operations-and-development.md> and the root README.md <../README.md>. This paragraph is only the narrative spine.\n\nTHE PROBLEM THIS PROJECT EXPLORES\n\nTraditional OS images live on block devices or tarball layers. Here, the image is a Merkle tree you can address by key and replicate live. Peers do not hand you a .iso; they help you fill in the same Hyperdrive from the same discovery key.\n\nThat raises three design questions this repo answers in code:\n\n1. Discovery — How does a fresh node find _someone_ who has block 0 (the MBR) and the drive root?\n2. Separation of concerns — What is immutable-ish OS vs mutable per-device home?\n3. Execution model — What runs in the host process vs what is “inside” the simulated POSIX surface?\n\nBare OS picks: one swarm topic for the project, Protomux channels for control + replication, two Hyperdrives (system + personal), and AsyncFunction-loaded JS for kernel and utilities.\n\nKEY VOCABULARY\n\n| Term | Meaning here |\n| System drive | Hyperdrive containing /boot/init.js, /bin, /etc — replicated from the seeder image |\n| Personal drive | Separate Hyperdrive (Corestore namespace) for $HOME, /.bare, cron, logs |\n| MBR | 512 bytes: magic BIOS + embedded Hyperdrive public keys (primary + optional failover) |\n| Kernel | /boot/init.js — async function start(ctx); not a microkernel, a session loop |\n| /bin | Small JS programs (async function run(ctx, argv)) built from bare-os-coreutils — includes a TTY editor (edit, nano) and usual POSIX-style tools |\n| VFS | Booter-provided path layer: routes paths under $HOME to the personal drive, else system |\n| ctx | Context object passed to kernel and commands: vfs, console, execLine, identity hooks, etc. |\n| Guest | Default session before login — predictable HOME=/home/guest, no Ed25519 identity |\n| HDMS | “Hyperdrive management” — optional extra drives mounted under /mnt after unlock |\n\nHOLEPUNCH STACK (FIRST-USE DEFINITIONS)\n\nUse these names consistently across docs:\n\n- Hyperdrive — Append-only, sparse-friendly filesystem identified by a public key; good for a shared OS tree.\n- Hyperswarm — DHT-style peer discovery; Bare OS uses a topic (bare-os-v1) and drive discovery keys.\n- Protomux — Multiplexes logical channels on one encrypted stream; the bare-os-v1 channel carries MBR reads and replication.\n- Corestore — Storage backend that holds Hyperdrive cores; seeder and booter use separate store paths.\n- Bare — Minimal JavaScript runtime; Pear wraps Bare for distributable apps (the seeder and booter are Pear apps).\n\nWHY HYPERDRIVE AND HYPERSWARM\n\nHyperdrive gives you a single-writer (per key) log-backed filesystem with deterministic reads and sparse replication—good for an OS tree that many nodes can share.\n\nHyperswarm gives you topic-based and discovery-key-based peer finding. The seeder joins both the bare-os-v1 topic (so booters find _some_ peer) and the drive discovery key (so Hyperdrive replication completes).\n\nYou do not need to agree with every product choice to read the code: the handbook describes what the repo does, not whether it is the only way to build a P2P OS.\n\nRELATIONSHIP TO PEAR AND BARE\n\n- Bare is a minimal JavaScript runtime used by Pear apps.\n- Both seeder and booter are Pear applications (pear field in package.json) and can run under node index.js for development.\n- brittle-bare vs brittle-node split in tests reflects native addons (e.g. identity crypto) that only load on Bare.\n\nWHERE TO GO NEXT\n\n- Essay-length thesis: Preface <00-preface.md>\n- Big picture: Chapter 2 — Blueprints <02-blueprints.md>\n- Wire protocol: Chapter 3 <03-protocol-and-disk.md>\n- Day-to-day hacking: Chapter 7 <07-operations-and-development.md>\n\nNext: Chapter 2 — Blueprints <02-blueprints.md>\n\nRelated: Handbook home <README.md> · Kernel extensions <../docs/reference/kernel-extensions.md> · CHANGELOG — ctx API <../packages/bare-os-booter/CHANGELOG.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","01","introduction","what","bare"],"seeAlso":[{"name":"handbook-02-blueprints","section":7},{"name":"handbook-00-preface","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/01-introduction.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-02-blueprints","section":7,"title":"Chapter 2 — Blueprints: architecture and trust","synopsis":["man 7 handbook-02-blueprints","Handbook chapter (plain text from handbook/02-blueprints.md)"],"description":"CHAPTER 2 — BLUEPRINTS: ARCHITECTURE AND TRUST\n\nTime to read: about 10 minutes. Prerequisites: Chapter 1 <01-introduction.md> vocabulary.\n\nThis chapter is the aerial view: boxes, arrows, and what is allowed to trust what. Implementation details live in later chapters.\n\nFor a comparison to classic images and security limits, see Preface — Comparison frame and Security <00-preface.md#comparison-frame-not-marketing>.\n\n0. BOOT PATH FROM SEEDER TO SHELL\n\nThe following is the conceptual ordering (not every substep on the wire). It complements the reference sequence diagram in Architecture: end-to-end data flow <../docs/reference/architecture-data-flow.md>.\n\n1. TWO APPLICATIONS, ONE PROTOCOL\n\n- The seeder is the publisher of the OS image (plus MBR in a small RAM map).\n- The booter is a consumer that refuses to invent a local copy: it must see peers.\n\n2. TWO DRIVES ON THE BOOTER\n\nTrust model (pragmatic):\n\n- System drive content is whatever replicated from the swarm matching the MBR keys. In dev you treat the seeder as trusted; in the wild this is “who you peer with.”\n- Personal drive is your namespace (Corestore bare-os-personal-v1). It holds secrets, cron, dotfiles, HDMS registry, vault snapshots.\n\n3. PROTOCOL, MBR, AND DISCOVERY\n\nThe shared package bare-os-protocol pins:\n\n- TOPIC_STRING === 'bare-os-v1'\n- topicKey() = crypto.hash(b4a.from(TOPIC_STRING))\n- MBR layout: 512 bytes, magic BIOS, primary key at offset 8, optional failover keys at 40 and 72\n\nMBR layout (512 bytes, see bare-os-protocol/constants.js):\n\n- Bytes 03: BIOS magic\n- Bytes 839: primary system Hyperdrive public key\n- Bytes 4071, 72103: optional additional keys\n\nProtomux channel bare-os-v1 carries:\n\n- Block read requests (MBR and any indexed RAM the seeder exposes)\n- Hyperdrive replication on the same socket\n- Gossip bitfield (message 2), manifest search (3/4), and *bare_os. RPC (5/6**) on the seed channel (see packages/bare-os-protocol/lib/channel.js; Kernel extensions <../docs/reference/kernel-extensions.md>)\n\n4. EXECUTION STACK INSIDE THE BOOTER\n\nKernel and /bin scripts are not separate processes. They are AsyncFunction closures in the same JS realm as the booter, with a synthetic ctx instead of syscalls.\n\n5. SERVICES AFTER THE CONSOLE EXISTS\n\nstopBareInitd() runs from REPL session cleanup so timers do not leak across session restarts.\n\n6. IDENTITY STATES\n\nGuest and unlocked sessions share the same booter process; the state machine below is about environment and policy, not separate OS processes.\n\n- Guest: fixed HOME=/home/guest, read-oriented personal tree policy for some operations.\n- Unlocked: HOME under /home/<pubkey-prefix>, HDMS can attach writable drives, crontab install/remove allowed.\n\nFull story: Chapter 5 — Identity, vault, HDMS <05-identity-vault-and-hdms.md>.\n\n7. WHAT IS _NOT_ HERE (BOUNDARY)\n\n- No hardware kernel, no MMU, no ELF loader for native /bin.\n- No container cgroup isolation—commands are JS with full host capability of the Pear/Bare process.\n- Future: stronger isolation would compose Bare workers, Pear runtime isolates, or bare-kit-style embeds; the stock ctx.bareOsSandboxRunScript hook is a documented placeholder until then (see developer guide security chapter).\n- No global consensus: two booters can diverge if they replicate different forks of the same discovery key (Hyperdrive versioning is a separate concern).\n\nNext: Chapter 3 — Protocol and disk <03-protocol-and-disk.md>\n\nRelated: Preface <00-preface.md> · Handbook home <README.md> · Kernel extensions <../docs/reference/kernel-extensions.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","02","blueprints","architecture","and","trust"],"seeAlso":[{"name":"handbook-03-protocol-and-disk","section":7},{"name":"handbook-01-introduction","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/02-blueprints.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-03-protocol-and-disk","section":7,"title":"Chapter 3 — Protocol, MBR, and SwarmDisk","synopsis":["man 7 handbook-03-protocol-and-disk","Handbook chapter (plain text from handbook/03-protocol-and-disk.md)"],"description":"CHAPTER 3 — PROTOCOL, MBR, AND SWARMDISK\n\nTime to read: about 12 minutes. Prerequisites: Chapter 2 — Blueprints <02-blueprints.md>.\n\nHere we connect bare-os-protocol to what seeder and booter actually do on the wire and in RAM. For byte offsets and constants, keep package-bare-os-protocol <../docs/reference/package-bare-os-protocol.md> open. For kernel feature bits and seed-channel RPC behavior, see Kernel extensions <../docs/reference/kernel-extensions.md>.\n\nTHE MBR IN PLAIN LANGUAGE\n\nThink of the MBR as a business card for the system image: 512 bytes that say “this Hyperdrive key (and optional alternates) is the OS you want.” The first bytes are the ASCII magic BIOS so booters do not mistake random data for a catalog. Starting at offset 8, the card embeds 32-byte public keys—the primary system drive first, then optional failover keys at 40 and 72 if you publish multiple compatible images.\n\nThe booter always tries to obtain block 0 through the swarm-backed SwarmDisk; it does not silently fall back to your git checkouts kernel/. That design choice forces you to confront availability: if nobody is seeding, you do not boot.\n\nDetails: bare-os-protocol/constants.js <../packages/bare-os-protocol/constants.js> and the reference doc above.\n\nSEEDER LIFECYCLE\n\n1. Resolve kernel root (BARE_OS_KERNEL_ROOT or vendored kernel/).\n2. Optionally rebuild coreutils when running under Node (file: URL) — skipped under Pear.\n3. Open Corestore + Hyperdrive, stageKernelTree:\n- init.js → /boot/init.js\n- bin/ → /bin/\n- etc/ → /etc/\n- Other paths under the kernel tree map to the same path on the drive; README.md at the kernel root is skipped (repository layout doc only — not installed as /README.md).\n4. Build MBR with buildMbr(drive.key) and store block 0 in a Map (localRAM).\n5. Hyperswarm join(topicKey()) and join(drive.discoveryKey).\n6. On each connection: Protomux + setupSeedChannel, which:\n- Answers read index requests from localRAM (index 0 → MBR)\n- Attaches drive.replicate(stream)\n\nBOOTER: FROM PEERS TO HYPERDRIVE\n\nSwarmDisk (booter) mirrors the seeders channel handlers:\n\n- read(index) — if not local RAM, broadcast msg 0 to peers, await msg 1 (timeout).\n- addPeer — open channel, replicate system (and later personal) drives on the mux stream.\n\nBoot path:\n\n1. Wait until disk.peers.size > 0 or boot timeout.\n2. parseMbr(await disk.read(0)) → list of 32-byte keys.\n3. For each key, try Hyperdrive(store, key) + replicate until /boot/init.js exists.\n4. Initialize personal drive namespace and join its discovery key.\n5. Hand off to executeKernel.\n\nThere is intentionally no “use my checkouts kernel/ if the network fails” path—the project forces you to think about availability of the swarm.\n\nMESSAGE IDS — WHAT EACH IS FOR\n\nAligned with packages/bare-os-protocol/lib/channel.js and swarm-disk.js. The boot-critical path is 0/1 plus Hyperdrive replication on the same socket; the rest supports discovery, ops, and capability negotiation (see Kernel extensions <../docs/reference/kernel-extensions.md>).\n\n| ID | Direction | Why it exists |\n| 0 | Client → peers | Fetch a RAM block by index (block 0 = MBR) when the booter has no local copy. |\n| 1 | Peer → client | Return the bytes for that index (or satisfy the read contract). |\n| 2 | Gossip stub | Bitfield buffer for optional capability / gossip experiments (see kernel feature bits). |\n| 3 / 4 | Search req/res | Manifest search so operators can ask “does this image contain path X?” without walking the whole tree client-side. |\n| 5 / 6 | RPC req/res | *bare_os. RPC — version, health, kernel info, capabilities, replication_status**, gossip; strict boot can require answers before trusting the image. |\n\nThe important path for boot is 0/1 + Hyperdrive replication on the same socket.\n\nKERNEL FEATURE BITMASK (DOCUMENTATION)\n\nThe package bare-os-protocol exports lib/kernel-feature-bits.js (re-exported from index.js) with a versioned bitmask describing optional booter / image capabilities. Peers see a 250-byte bitfield on message 2 (gossip stub; bit 0 set today). The seeder answers bare_os.capabilities over RPC with doc / featureBitsDoc, bits, protocolPackageVersion, role, protocol so the booter can compare before MBR read (BARE_OS_SEED_CAP_STRICT; comparison uses unsigned >>> semantics). bare_os.replication_status adds seeder-local replication hints (e.g. manifest path count). Guests read dumps under /proc/bare_os_features, /proc/bare_os/, and related /proc nodes. Unknown bits should be ignored.\n\nAuthoritative tables: Kernel extensions <../docs/reference/kernel-extensions.md>.\n\nPERSONAL DRIVE REPLICATION\n\nSwarmDisk.initPersonalDrive creates a separate Hyperdrive under a stable Corestore namespace and swarm.join(personalDrive.discoveryKey). Your $HOME tree can therefore sync across your devices if peers share that discovery key—orthogonal to the system image key from the MBR.\n\nWhat you should expect: personal data persists under the same store path between runs; if you delete the booter Corestore or switch BARE_OS_BOOT_STORE, you effectively get a new personal namespace unless you restore keys. Multi-device sync only happens if another device joins the same personal discovery key—there is no automatic “cloud account”; it is still P2P replication semantics.\n\nFAILURE MODES YOU WILL SEE IN THE WILD\n\n| Symptom | Likely cause | What to try |\n| Booter exits after boot timeout | No peer on bare-os-v1 topic, or firewall blocks Hyperswarm | Start a seeder on the same network; check BARE_OS_BOOT_TIMEOUT_MS; verify HYPERSWARM_BOOTSTRAP if you use custom bootstrap nodes |\n| Invalid MBR / parse error | Block 0 not from this project, corrupt RAM map, or wrong seeder | Ensure seeder and booter use compatible bare-os-protocol; rebuild MBR from a known good drive |\n| Drive never finishes replicating | Discovery key mismatch, flaky peers, or stalled mux | Watch peer count; restart seeder; check logs; confirm booter joined system discovery key from MBR |\n| Capabilities / strict seed errors | Booter expects features the seeder image does not advertise | Align package versions; relax BARE_OS_SEED_CAP_STRICT only if you understand the tradeoff (Kernel extensions <../docs/reference/kernel-extensions.md>) |\n| Personal files missing on a new machine | New Corestore path or new personal drive | Same BARE_OS_BOOT_STORE / backup of key material; personal drive is not the system MBR key |\n\nNext: Chapter 4 — The booter runtime <04-the-booter-runtime.md>\n\nRelated: Chapter 2 — Blueprints <02-blueprints.md> · Handbook home <README.md> · Kernel extensions <../docs/reference/kernel-extensions.md> · Environment appendix <../docs/reference/environment-and-posix-appendix.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","03","protocol","and","disk","mbr","swarmdisk"],"seeAlso":[{"name":"handbook-04-the-booter-runtime","section":7},{"name":"handbook-02-blueprints","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/03-protocol-and-disk.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-04-the-booter-runtime","section":7,"title":"Chapter 4 — The booter runtime: ctx, VFS, shell, kernel, services","synopsis":["man 7 handbook-04-the-booter-runtime","Handbook chapter (plain text from handbook/04-the-booter-runtime.md)"],"description":"CHAPTER 4 — THE BOOTER RUNTIME: CTX, VFS, SHELL, KERNEL, SERVICES\n\nTime to read: about 20 minutes (skim headings first). Prerequisites: Chapters 23 <02-blueprints.md>.\n\nThe booter is the largest package because it is the machine: everything the user experiences as “the OS” (except the raw Hyperdrive bytes) is assembled in packages/bare-os-booter/index.js and *lib/.js**.\n\nCTX AT A GLANCE (SURFACE AREA)\n\nctx is the single handle passed into /boot/init.js and every /bin utility. You can think of it as the simulated machine:\n\n- ctx.vfs — path operations across system + personal drives (readFile, writeFile, stat, chdir, …).\n- ctx.console — log / error wired to the session console (and often mirrored to kernel logs).\n- ctx.execLine / ctx.readLine — the line shell and prompt input.\n- ctx.runBinCommand — run a /bin command as if typed (used by time, xargs, etc.).\n- Identity — hooks and state for guest vs unlocked sessions (login / logout).\n- Optional ctx.bare — merged Bare module map when the host allows imports + optional drive bundles (see below).\n- Policy and caps — ctx.bareOsRuntimeCaps, optional httpFetch (policy fetch for delegated curl/wget when a fetch backend exists at ctx build), IPC FIFOs, HDMS, Pear reload requests, audit flags, …\n\nThe authoritative field list and versioning story are in developer-guide — The context object <../developer-guide/02-the-context-object.md> and CHANGELOG <../packages/bare-os-booter/CHANGELOG.md>.\n\nBOOT SPLASH AND STDIO\n\nresolveStdio() picks session stdin/stdout appropriate for Pear/Bare vs Node. When stdout is a TTY and BARE_OS_NO_SPLASH is unset, createBootSplash shows a full-screen progress UI tied to BARE_OS_BOOT_TIMEOUT_MS, then prepareForKernel() clears the screen before the line editor attaches.\n\nNon-TTY mode skips splash noise; automation uses BARE_OS_SKIP_REPL=1.\n\nEXECUTEKERNEL IN ONE PARAGRAPH\n\nAfter the system and personal drives exist:\n\n1. Build shellEnv (guest defaults: HOME, PATH, USER, …, BARE_OS_CTX_API_VERSION), copying host keys when set — including *BARE_OS_PIPELINE_, BARE_OS_SHELL_STREAMING, BARE_OS_SHELL_STREAMING_MULT, BARE_OS_SHELL_CMDSUBST, BARE_OS_SHELL_CMDSUBST_MAX_BYTES, boot and audit toggles (BARE_OS_BOOT_PROFILE, BARE_OS_ONBOOT, BARE_OS_BOOT_STRICT, BARE_OS_RC_D_SKIP, BARE_OS_BOOT_MINIMAL, BARE_OS_BOOT_SKIP, BARE_OS_BOOT_TRACE, BARE_OS_KERNEL_SELFTEST, BARE_OS_SELFTEST_FORMAT, BARE_OS_AUDIT, BARE_OS_AUDIT_JSON, BARE_OS_AUDIT_REDACT, BARE_OS_BOOT_ALLOWLIST, BARE_OS_EXEC_MAX_DEPTH, BARE_OS_IPC_, BARE_OS_IPC_CHANNEL_MAX_BYTES, BARE_OS_HTTP_ALLOWLIST, BARE_OS_HTTP_DENYLIST, BARE_OS_TLS_PIN_SHA256, BARE_OS_VFS_WATCH, BARE_OS_VFS_UNION_PREFIXES, BARE_OS_VFS_UNION_WRITE_DENY, BARE_OS_VFS_BIN_CACHE, BARE_OS_IMAGE_DIGEST, BARE_OS_PEAR_CHANNEL, BARE_OS_PEAR_RELEASE, BARE_OS_BARE_MODULES, BARE_OS_BARE_DRIVE_BUNDLES, BARE_OS_BOOT_MANIFEST, BARE_OS_BOOT_MANIFEST_SIGN, BARE_OS_BOOT_MANIFEST_PUBKEY_HEX, BARE_OS_BOOT_POLICY, BARE_OS_SANDBOX_SCRIPT, BARE_OS_SANDBOX_WORKER, BARE_OS_INITD_MAX_PARALLEL, BARE_OS_INITD_JOURNAL_MAX_LINES, BARE_OS_URANDOM_CRYPTO, BARE_OS_TELEMETRY_NDJSON, BARE_OS_SEED_RPC_HANDSHAKE, BARE_OS_SEED_CAP_STRICT, BARE_OS_SEED_CAP_FAIL, BARE_OS_BLIND_BOOTSTRAP_URL, BARE_OS_BLIND_BOOTSTRAP_JSON, BARE_OS_MIRROR_READ_KEY, PEAR_CHANNEL) — see Chapter 7 <07-operations-and-development.md>, the environment appendix <../docs/reference/environment-and-posix-appendix.md#14-environment-variables-complete-list>, Kernel extensions <../docs/reference/kernel-extensions.md>, and the context object developer guide <../developer-guide/02-the-context-object.md>. Set BARE_OS_BOOT_PROFILE_RESOLVED from the host override or the first line of /etc/bare-os/profile on the system drive; assign BARE_OS_SESSION_ID for /run/bare-os/session. Seed /run/bare-os/boot.json fields imageDigest, pearChannel, pearRelease, and accumulate booterPhases (vfs, ctx, repl, initd, kernel_invoke) for observability alongside kernel phases*.\n2. createBareOsIpc({ maxFifoBytes, perChannelMaxBytes?, ipcRpcToken?, enableFanout?, maxJsonRpcLineBytes? }) — in-memory FIFOs under /run/bare-os/ipc/<name>; optional per-name byte caps via BARE_OS_IPC_CHANNEL_MAX_BYTES (JSON map); pushJson/takeJson with optional shared-secret field bareOsIpcToken when BARE_OS_IPC_RPC_TOKEN is set; fan-out topics fanoutPublish/fanoutSubscribe (disable with BARE_OS_IPC_FANOUT=0); createDuplexBridge(baseName) pairs two push/take sides for bidirectional byte streams; duplexJsonRoundTrip(side, request) sends one JSON object and awaits one JSON reply (bounded); stats includes fan-out subscriber counts.\n3. createVfs(drive, personalDrive, shellEnv, mntRef, vfsOptions?) — the two-drive router; optional vfsOptions supply procSnapshot (/proc/version, cmdline), dynamic text for /proc/net/dev, /proc/diskstats, /proc/bare_os_quotas, /proc/bare_os_resources, /proc/bare_os_features, /sys/class/net/lo, bootProfileText, sessionText, initdRunText, bootReadyJsonText, getVirtualReaders for /run/bare-os/virtual/<name>, etc.\n4. After VFS: buildBareCtxObjectFromHost + maybeMergeBareFromDrive fill a bareLibrary map (host imports first; drive bundles only add missing keys). /lib/bare/manifest.json and */lib/bare/bundles/.js are trusted like /bin**. See developer guide ch.12 <../developer-guide/12-bare-modules-and-pear-ecosystem.md>.\n5. Construct ctx: disks, vfs, bareOsIpc, env, b4a, optional bare: Object.freeze(bareLibrary) when BARE_OS_BARE_MODULES is enabled, topic, bareOsRuntimeCaps (pipeline limits, quotas, pseudo path list, feature flags such as vfsWatch, ipcRpcJson, ipcFanout, initdSocketActivation, bareCtxModules, bareDriveBundles), optional httpFetch (policy-wrapped fetch when globalThis.fetch or ctx.bare.fetch is available at ctx build — see HTTP: curl and wget <../docs/reference/http-curl-and-wget.md>), optional bareOsHostStats from the bare-os module, bareOsGetResourceStatus, bareOsRegisterVirtualFile, Pear/sandbox stubs, identity hooks, bareOsSubscribeBootEvent / bareOsEmitBootEvent, bareOsSubscribeHdmsLifecycle, bareOsAwaitInitdUnits, runHdms, requestBooterExit, bareOsPublishBootReady, …\n6. applyGuestEnv + ensureGuestHome — identity stub and /.bare skeleton on the personal drive (after the ctx object exists).\n7. createKernelReplSession — fish-style readLine + console bound to the same stdout as the prompt.\n8. Set ctx.execLine, ctx.readLine, ctx.runBinCommand — optional AbortSignal/timeoutMs on execLine, readLine, runBinCommand, and VFS readFile/writeFile; exit, optional audit logging (BARE_OS_AUDIT, BARE_OS_AUDIT_JSON, redaction), execLine nesting cap (BARE_OS_EXEC_MAX_DEPTH), then execShellLine.\n9. await startBareInitd(ctx) — see below.\n10. runKernelFromSource(initSource, ctx) — runs /boot/init.js.\n\nCleanup path closes swarm/drives and calls session.cleanup(), which runs stopBareInitd().\n\nVFS: TWO DRIVES, ONE PATH SPACE\n\nlib/vfs.js implements resolveLogical with unix-path-resolve(cwd, userPath) (two arguments only—important when reading the code).\n\n- Paths under $HOME resolve to the personal Hyperdrive under /.bare-os/home/<HOME-basename>/… (mutable writeFile / unlink where policy allows); writable /var/log uses /.bare-os/var/log/<same-basename>/…; writable /tmp uses /.bare-os/tmp/<same-basename>/… (session-isolated scratch).\n- Other absolute paths hit the system drive (OS image).\n- Hyperdrive rejects / as a filename; the VFS special-cases logical root for stat, chdir, exists.\n\nVirtual listings include /home (session-specific), /mnt when HDMS mounts exist, and injected root entries proc, sys, tmp when absent from the system image.\n\nCatalog detail: Chapter 9 <09-posix-utilities-shell-and-vfs.md>.\n\nPSEUDO /PROC, /SYS, /RUN, /DEV (MOSTLY READ-ONLY)\n\nThese paths are synthetic (not stored on either Hyperdrive). They exist for inspection and scripting ergonomics, not Linux ABI compatibility. In blog terms: /proc is “what is this session doing?”; /sys is “tiny sysfs-shaped stubs”; /run is “volatile session state the booter owns”; /dev is “just enough device names that scripts stop crashing”; session /tmp is “scratch space that never lands on the read-only system drive.”\n\n- /proc: version, bare_os_version, uptime, meminfo, cpuinfo, loadavg, mounts, diskstats (stub text), bare_os_quotas (JSON: pipeline limits, exec-depth cap, IPC cap, session stats, FIFO stats), bare_os_resources, bare_os_features (includes optional seedHandshake summary after bare_os.capabilities RPC when enabled), bare_os_swarm (bounded P2P / session snapshot when the host provides it), bare_os_replication (JSON hints: version, peers, last error when known), bare_os_capabilities (human-readable dump of ctx.bareOsRuntimeCaps; bare_os_capabilities.json or Accept: application/json for machine output), bare_os_bootstrap, bare_os_union (JSON: union read prefixes + BARE_OS_VFS_UNION_WRITE_DENY), bare_os_seed_handshake (raw handshake / error object), bare_os_virtual_registry (registered virtual file metadata), net/dev (P2P-oriented stub), self/ with environ, cmdline, exe, fd/02 (stub targets), plus bare_os_session_stats. environ omits keys whose names look secret-bearing (e.g. PASSWORD, TOKEN, VAULT) and only includes a small public set plus *BARE_OS_ (including BARE_OS_SESSION_ID**).\n- /sys: fs/bare_os/version, fs/bare_os/build_id, class/net/lo (stub operstate / carrier), devices/virtual/ (placeholder tree for script portability).\n- /sys/fs/bare_os/version: same text as /proc/version.\n- /run/bare-os/units: tab-separated snapshot of bare-initd registered units (phase, start time, description).\n- /run/bare-os/unit-journal/: append-only NDJSON per unit (<name>.ndjson) for start/stop/health/restart events (size-capped); journalctl -u also tails this file when present.\n- /run/bare-os/boot_profile: one line (plus newline): resolved boot profile name (BARE_OS_BOOT_PROFILE from the host, else first line of /etc/bare-os/profile, else empty). Listed in ctx.bareOsRuntimeCaps.pseudoFsPaths.\n- /run/bare-os/session: session UUID (from BARE_OS_SESSION_ID) plus newline.\n- /run/bare-os/virtual/: optional kernel-registered synthetic files via ctx.bareOsRegisterVirtualFile.\n- /dev/null, /dev/zero: minimal device semantics — null discards writes and reads empty; zero reads a fixed 64KiB zero buffer. Not infinite /dev/zero like Linux.\n\nNon-goals: no real PIDs, accurate meminfo, or guarantees of path parity with Linux.\n\nvfs.watch(logicalPath) (Hyperdrive-backed paths only — not pseudo roots): returns { watcher, destroy, logicalAbs, driveFolder }; use Hyperdrives async iterator on watcher. Disabled when host sets BARE_OS_VFS_WATCH=0. See ctx.bareOsRuntimeCaps.features.vfsWatch.\n\nUnion read: when BARE_OS_VFS_UNION_PREFIXES lists comma-separated logical prefixes, readFile / readlink on those paths may merge the system image with overlays (see vfs.js and ctx.bareOsRuntimeCaps.features.vfsUnionRead). BARE_OS_VFS_BIN_CACHE=1 enables a small LRU read cache for /bin entries, invalidated when vfs.watch notifications fire on watched prefixes.\n\nImplementation note: pseudo-file content is UTF-8 encoded with b4a, not TextEncoder, because some Bare/Pear runtimes omit the Web Encoding globals (TextEncoder / TextDecoder). The same applies elsewhere in the booter and in-image utilities that must run on Bare.\n\n/DEV AND /RUN (MINIMAL SUBSET)\n\nSee Pseudo /proc, /sys, /run, /dev above. A full device tree and /run parity with Linux are still out of scope.\n\nCTX.BARE AND DRIVE BUNDLES\n\nAfter the VFS exists, buildBareCtxObjectFromHost plus maybeMergeBareFromDrive fill a bareLibrary map: host-configured imports first, then /lib/bare/manifest.json and */lib/bare/bundles/.js on the system drive may supply only missing keys. Those paths are trusted like /bin**—they ship in the replicated image.\n\nUse this when you want real ESM modules (Holepunch *bare- packages) inside an otherwise AsyncFunction-only tree. Trust stance: enabling BARE_OS_BARE_MODULES** and drive bundles expands attack surface; treat manifests as part of your image signing story.\n\nDeep dive: developer-guide ch.12 — Bare modules and Pear ecosystem <../developer-guide/12-bare-modules-and-pear-ecosystem.md> · kernel/lib/bare/ <../kernel/lib/bare/> · PEAR-RUN.md — BARE_OS_BARE_MODULES <../PEAR-RUN.md>.\n\nPEAR HOST BRIDGES AND HTTP POLICY\n\nThe booter exposes policy-gated hooks so a Pear host can react without forking the guest kernel:\n\n- ctx.bareOsRequestPearReload(opts?) — ask the host to reload the Pear runtime (OTA-style); optional persistRequest writes ~/.bare-os/pear-reload.request. Env mirrors BARE_OS_PEAR_CHANNEL, BARE_OS_PEAR_RELEASE, PEAR_CHANNEL into /run/bare-os/boot.json.\n- ctx.bareOsRequestMirror({ key?, label? }), ctx.bareOsExportPersonalSnapshot({ label? }), ctx.bareOsPearIpcEmit(channel, payload) — return hints or booleans; on Node the booter emits process events for embedding apps to implement real mirrors or snapshots.\n\nHTTP CLIENTS (CURL / WGET)\n\nDelegated curl and wget run from the booters host delegate registry before any /bin script on the system drive. They use a Fetch-shaped stack: policy-wrapped ctx.httpFetch when set, else ctx.bare.fetch from host imports or /lib/bare/bundles, else globalThis.fetch. On minimal Pear/Bare hosts, ensureBareFetchGlobals may install globals from bare-fetch or bare-https when no native fetch exists. Outbound URLs are constrained by BARE_OS_HTTP_ALLOWLIST / BARE_OS_HTTP_DENYLIST, optional BARE_OS_TLS_PIN_SHA256 (and init.bareOsCurlTls for curl TLS details), and optional BARE_OS_DNS_ALLOWLIST. The drive still ships /bin/curl and /bin/wget as manifest stubs; normal sessions never execute them.\n\nCanonical reference: HTTP: curl and wget <../docs/reference/http-curl-and-wget.md> · Flag matrix: CLI_PARITY.md <../packages/bare-os-booter/CLI_PARITY.md> · Full env tables: environment appendix <../docs/reference/environment-and-posix-appendix.md> · Pear notes: PEAR-RUN.md <../PEAR-RUN.md>.\n\nROADMAP AND OUT-OF-SCOPE\n\nRemaining gaps are tracked in packages/bare-os-booter/CLI_PARITY.md, POSIX appendix — gaps <../docs/reference/environment-and-posix-appendix.md#14a-posix-userland-appendix-implemented-vs-gaps>, and Kernel extensions <../docs/reference/kernel-extensions.md>: transports and flags curl/wget may never match GNU; pipelines remain bounded captures rather than kernel pipes; bareOsSandboxRunScript is not a hard hardware-style isolate yet; socket-activation idle stop and richer *bare_os. RPC are directional** work, not promises.\n\nMilestone shape (current intent): (1) VFS + shell + synthetic proc/run + boot trace + allowlists — largely in place; (2) man and incremental /bin flags; (3) delegated HTTP parity where feasible; (4) init/protocol hardening as needs arise.\n\nDirectories: vfs.mkdir(path, { recursive }) and vfs.rmdir(path) implement POSIX-like tree creation and removal using a .bareos_empty marker file for empty directories (aligned with git-fs-adapter). See Chapter 9 <09-posix-utilities-shell-and-vfs.md>.\n\nctx.runBinCommand(argv) — same resolution as external commands in the shell; exposed for utilities such as /bin/time.\n\nSHELL AND KERNEL RUNNER\n\nexecShellLine (lib/shell.js):\n\n- Tokenizes words, quotes, escapes, $VAR, pipelines |, redirections > / >> / <.\n- Builtins: alias, unalias, cd, export, unset, readonly, umask, :, command, type, login, logout, exit, jobs, fg, wait, bounded if/while/for/case — plus external commands via runBinCommand. Optional BARE_OS_SHELL_CMDSUBST enables bounded $(…) in words; optional BARE_OS_SHELL_STREAMING scales pipeline capture caps. readonly blocks export and assignment writes to the same name; command -v / -V and type use resolveBinInPath for PATH lookup.\n- First-word aliases (defaults like ll → ls -la, nano → edit) expand after $VAR substitution; alias / unalias match the restricted ~/.barerc syntax (not full POSIX sh).\n- Pipes capture console.log into the next stage or a string sink.\n\nrunBinCommand (lib/kernel-runner.js):\n\n1. If argv[0] contains / — resolve via VFS, drive.get, runScriptFromSource.\n2. Else if the name ends with .js — resolve $PWD/name.js first (same as explicit ./ for many cases).\n3. Else walk PATH on the system drive only.\n\nrunScriptFromSource strips an optional #! line, runs the script body as top-level code in an async function, then awaits a top-level run(ctx, argv) if one is defined (optional for user scripts; /bin utilities always define run). It catches errors—logs to ctx.console.error without unwinding the kernel loop.\n\nrunKernelFromSource requires async function start(ctx) at the top level of /boot/init.js.\n\n~/.BARERC (RESTRICTED STARTUP FILE)\n\nOn guest and logged-in identity transitions, the booter loads ~/.barerc from the personal drive if it exists. On login (unlocked identity), if the file is missing, the booter creates a comment-only skeleton you can edit. Only these forms are applied (other lines are ignored; set BARE_OS_STRICT_BARC=1 to log warnings):\n\n- export NAME=value — same name rules as the shell builtin; value is expanded like export in execShellLine.\n- alias name=value and unalias — same behavior as the interactive builtins (unalias -a resets to the default alias table).\n\nThere is no arbitrary command execution, source, or control flow — it is intentionally not a full sh profile.\n\nBARE-INITD, CRON, AND THEMES\n\nbare-initd.js (below) starts DAG-ordered units after the console exists. bare-cron (also below) reads /etc/bare-os/crontab and ~/.crontab.\n\nThemes live in docs/themes/README.md <../docs/themes/README.md> — preset packs (for example Nord) that align LS_COLORS, prompt colors, and sample Alacritty / Warp YAML so your host terminal and the in-guest theme / dircolors utilities agree. At login, ~/.barerc may contain theme nord (plus export / alias lines) to set *BARE_OS_COLOR_** without hand-editing escape codes.\n\nBARE-INITD AND KERNEL LOGGER\n\nbare-initd.js:\n\n- registerBareService({ name, start, stop?, description?, logPath? }) — optional stop enables systemctl stop / restart for that unit; logPath is a logical VFS path for systemctl status / logs\n- startBareInitd(ctx) — ensures /var/log/bare-os (see below), then DAG-ordered start with optional parallelism (BARE_OS_INITD_MAX_PARALLEL, default 1). Skips units listed in ~/.config/bare-os/initd/disabled.txt. Drop-ins ~/.config/bare-os/units/<name>.unit support [Unit] keys After=, Before=, Requires=, Wants=, TimeoutStartSec=, TimeoutStopSec=, Restart=, RestartSec=, OnFailure=, FailureAction=, ExecStartPost=, SocketActivationIpc= (defers start() until the first read on that FIFO), ReadinessPath=, ReadinessTimeoutSec=. Cycles in After/Before are detected and logged; affected units fail start. Default bare-cron runs after kernel-logger. Per-service try/catch, [bare-initd] name: err on failure; failures append to /var/log/bare-os/initd.log and the structured unit journal; runtime state active / failed / inactive. waitForBareInitdUnits(names, timeoutMs) polls until listed units are active (exposed as ctx.bareOsAwaitInitdUnits).\n- listBareServices(), getBareServiceRuntime(name), findBareServiceDefinition(name), startBareService / stopBareService / restartBareService — introspection and lifecycle (used by the CLI below)\n- registerKernelShutdownHook(fn) + runKernelShutdownHooks() — async-friendly teardown before disposers (REPL session.cleanup awaits hooks, then stopBareInitd())\n- registerBareInitdDisposer(fn) + stopBareInitd() — for intervals and synchronous teardown\n- Kernel logger — mirrors console.log/error to /var/log/bare-os/kernel-console.log. The VFS exposes /var as a virtual directory and maps /var/log/… onto the personal Hyperdrive at /.bare-os/var/log/… (the system image drive stays read-only). Each log file is trimmed when it grows past 512KiB (last 256KiB kept plus a notice line).\n\nBuilt-in kernel-logger wraps ctx.console.log / error to append UTF-8 lines to that path (with stop / restart support). startBareInitd also creates /var/log/bare-os and a short README there. Other services use the same tree (e.g. cron.log). Failures to write logs are swallowed so logging never kills the session.\n\nService control: /bin/systemctl is implemented by the booter (kernel-runner delegates to systemctl-cli.js), not by evald image JS. Subcommands: list / list-units (shows PRESET enabled/disabled from disabled.txt), status, logs, start, stop, restart, enable, disable, is-enabled. journalctl -u UNIT (log tail only) shares the same backend. The legacy name bare-initctl is still accepted as an alias. enable / disable only affect the next startBareInitd (personal-drive config); runtime start / stop remain session commands. See man systemctl.\n\nBARE-CRON\n\nbare-cron.js registers service bare-cron:\n\n- Reads /etc/bare-os/crontab on the system image (if present), then ~/.crontab on the personal drive (silent if missing). Invalid lines are skipped and logged to /var/log/bare-os/cron.log.\n- Loads timer drop-ins from *~/.config/bare-os/timers/.timer: [Timer] section with OnCalendar= (five cron fields) and ExecLine=** — merged into the same minute tick as crontab jobs.\n- Parses five-field cron lines + command remainder.\n- Aligns to minute boundaries, setInterval(60s), runs await ctx.execLine(command) with per-line in-flight guard; job errors are appended to /var/log/bare-os/cron.log as well as console.error.\n- One disposer at module load clears timers on session shutdown; stopBareCron is also the unit stop for systemctl.\n\nInstall/list/remove user crontab with /bin/crontab (see Chapter 6 <06-kernel-and-binaries.md>). See Developer guide ch.11 <../developer-guide/11-kernel-pear-cookbook.md> for timer file layout.\n\nREPL: FISH-STYLE LINE EDITOR\n\nWhen stdin/stdout are a capable TTY and BARE_OS_FISH≠0, fish-readline.js provides history, hints, and synchronized Console output so prompts and console.log do not fight. History files live on the personal drive keyed by user identity, so guests and logged-in users do not stomp each others command recall. Set BARE_OS_FISH=0 for minimal readline or pipes-first automation; BARE_OS_SKIP_REPL=1 skips the interactive kernel loop entirely.\n\nImplementation touchpoint: packages/bare-os-booter/lib/fish-readline.js <../packages/bare-os-booter/lib/fish-readline.js>.\n\nDEBUG\n\ndebug-repl.js and env-driven logging can trace readline and write paths—useful when stdin is a pipe vs TTY.\n\nNext: Chapter 5 — Identity, vault, HDMS <05-identity-vault-and-hdms.md>\n\nRelated: Preface — Security <00-preface.md> · Kernel extensions <../docs/reference/kernel-extensions.md> · CHANGELOG <../packages/bare-os-booter/CHANGELOG.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","04","the","booter","runtime","ctx","vfs","shell","kernel","services"],"seeAlso":[{"name":"handbook-05-identity-vault-and-hdms","section":7},{"name":"handbook-03-protocol-and-disk","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/04-the-booter-runtime.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-05-identity-vault-and-hdms","section":7,"title":"Chapter 5 — Identity, vault, and HDMS","synopsis":["man 7 handbook-05-identity-vault-and-hdms","Handbook chapter (plain text from handbook/05-identity-vault-and-hdms.md)"],"description":"CHAPTER 5 — IDENTITY, VAULT, AND HDMS\n\nTime to read: about 12 minutes. Prerequisites: Chapter 4 — Booter runtime <04-the-booter-runtime.md> (VFS and shell).\n\nThis chapter covers who the session is (guest vs unlocked), where keys live, encrypted vault snapshots, and extra Hyperdrives under /mnt. Cryptographic details are implemented in identity-account.js <../packages/bare-os-booter/lib/identity-account.js> and identity-session.js <../packages/bare-os-booter/lib/identity-session.js>; here we stay at prose level.\n\nEND-TO-END: FROM COLD BOOT TO AN HDMS MOUNT\n\n1. Boot — The booter applies guest defaults: USER=guest, HOME=/home/guest, no Ed25519 material in the environment. You can already read the system image and write guest-scoped paths on the personal drive.\n2. login — You provide a passphrase. If the account exists, the booter decrypts /.bare/account and derives session keys; if login --new, it mints a new Ed25519 keypair and writes a v2 blob (see below).\n3. Unlocked — HOME moves under /home/<pubkey-prefix>, BARE_OS_PUBLIC_KEY is set, and HDMS may attach extra Hyperdrives registered on the personal drive.\n4. hdms mount … — Writable or read-only drives appear under /mnt/<label>; the registry JSON on the personal drive is the source of truth.\n5. logout — Sensitive material is zeroed; you return to guest. logout --save or savevault can snapshot selected paths into /.bare/vault/ as encrypted records.\n\nCron note: crontab install/remove requires unlocked identity so arbitrary guests cannot overwrite ~/.crontab.\n\nGUEST SESSION\n\nOn boot, applyGuestEnv sets:\n\n- USER / LOGNAME — guest\n- HOME / PWD — /home/guest\n- BARE_OS_IDENTITY — guest\n- Empty or absent BARE_OS_PUBLIC_KEY\n\nThe personal drive still persists: guest data is not anonymous to the drive—it is simply the unauthenticated profile.\n\nHome and session logs on disk: logical $HOME and /var/log map to the personal Hyperdrive under /.bare-os/home/<basename> and /.bare-os/var/log/<basename>, where <basename> is the first segment of HOME (e.g. guest or the 12-hex display name). That keeps guest and unlocked trees separate on the same drive. Shared machine metadata (/.bare/account, /.bare/hdms/, vault blobs, etc.) stays outside those prefixes. On first boot after an upgrade from older booters, a best-effort migration may move non-reserved files from the personal drive root into the current sessions home prefix when that prefix is still empty.\n\nACCOUNT BLOB: /.BARE/ACCOUNT AND CRYPTOGRAPHY IN PROSE\n\nidentity-account.js defines v2 on-disk format:\n\n- Magic BAREOS01, version 2\n- 32-byte Ed25519 public key (your identity handle in the UI)\n- PBKDF2-SHA256 salt + iteration count (default 210000) — slows passphrase guessing\n- ChaCha20-Poly1305 seal over the 64-byte secret key material (bare-crypto)\n\nWhat this means in practice: the passphrase never sits on disk; the blob stores salt + iterations + ciphertext. Unlocking derives a key from the passphrase, decrypts the signing secret, and keeps derived session state in memory. login --new creates a new account; login decrypts an existing one. Legacy v1 blobs are rejected with a message to recreate.\n\nVault (savevault, logout --save): selected files are snapshotted into /.bare/vault/ as AEAD-protected records (path hashing + per-record keys in the implementation). Vault ciphertext is only as good as your passphrase, backups, and who can replicate your personal drive.\n\nUNLOCKED SESSION\n\nidentity-session.js:\n\n- Updates ctx.vfs.env with real USER, HOME under /home/<pubkey-prefix>, BARE_OS_PUBLIC_KEY, derived UID/GID-like fields from a hash of the public key.\n- vfs.chdir to the new home.\n- onIdentityUnlocked (from index.js) activates HDMS with Corestore, swarm bootstrap, personal drive, mount map.\n- loadBarerc runs inside applyUnlockedEnv after a successful login or login --new (with createSkeletonIfMissing: true on first unlock), so ~/.barerc exports and aliases apply immediately—custom kernels normally do not need to reload barerc themselves. Use ctx.onIdentityUnlocked if you want an extra banner or post-login message.\n\nlogout zeroes sensitive material and returns to guest; logout --save (and savevault) snapshot selected paths into /.bare/vault/ as encrypted records (see identity-account.js helpers for AEAD and path hashing).\n\nHDMS (HYPERDRIVE MANAGEMENT)\n\nhdms-manager.js implements /bin/hdms via ctx.runHdms(argv):\n\n- Registry JSON on the personal drive: /.bare/hdms/registry.json\n- Writable drives: new Corestore namespace + Hyperdrive, label, replicate to swarm\n- Read-only drives: open by key string\n- invite / pair — uses Autopass (static ESM import for Pear tracing)\n\nassertLoggedIn requires ctx.identity.state === 'unlocked' and active controller—guests can list mounts that are already open but cannot mutate registry until login.\n\nVFS exposes /mnt/<label>/... for mounted drives; writable mounts allow put on those routes.\n\nKernel hooks: ctx.bareOsSubscribeHdmsLifecycle(fn) runs your callback after HDMS activate and before deactivate with { kind: 'afterActivate' | 'beforeDeactivate', labels?: string[] } so custom /boot/init.js can refresh mounts-dependent state without forking HDMS. The stock booter also invokes onAfterActivate on the hdms module export when present (see Developer guide ch.11 <../developer-guide/11-kernel-pear-cookbook.md>).\n\nEXAMPLE SESSION (ILLUSTRATIVE TRANSCRIPT)\n\n [guest@bare:/home/guest] > login\n …\n [alice@bare:/home/a1b2c3d4e5f6] > hdms list\n (no mounts)\n [alice@bare:/home/a1b2c3d4e5f6] > hdms create-workspace notes\n …\n [alice@bare:/home/a1b2c3d4e5f6] > ls /mnt\n notes\n [alice@bare:/home/a1b2c3d4e5f6] > touch /mnt/notes/hello.txt\n\nExact subcommands and flags: man hdms after a coreutils build.\n\nTRUST BOUNDARIES: WHAT THE DESIGN DOES NOT PROMISE\n\n- Passphrase strength matters: PBKDF2 iterations slow brute force but do not fix weak secrets.\n- Vault ciphertext is only as safe as the derived key and where copies replicate.\n- JS in-process commands can exfiltrate keys from memory—this is a toy OS shell, not a sandbox. See Preface — Security <00-preface.md#security-and-limits> and developer-guide — Security and trust <../developer-guide/09-security-and-trust.md>.\n\nNext: Chapter 6 — Kernel and binaries <06-kernel-and-binaries.md>\n\nRelated: Handbook home <README.md> · Chapter 4 <04-the-booter-runtime.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","05","identity","vault","and","hdms"],"seeAlso":[{"name":"handbook-06-kernel-and-binaries","section":7},{"name":"handbook-04-the-booter-runtime","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/05-identity-vault-and-hdms.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-06-kernel-and-binaries","section":7,"title":"Chapter 6 — Kernel and /bin utilities","synopsis":["man 7 handbook-06-kernel-and-binaries","Handbook chapter (plain text from handbook/06-kernel-and-binaries.md)"],"description":"CHAPTER 6 — KERNEL AND /BIN UTILITIES\n\nTime to read: about 15 minutes. Prerequisites: Chapter 4 <04-the-booter-runtime.md>, Chapter 5 <05-identity-vault-and-hdms.md> for identity-aware paths.\n\nThe kernel is a single script. The utilities are many small scripts. Both follow strict AsyncFunction contracts so the same code runs under Bare without a bundler per command.\n\nTHE KERNEL LOOP IN PLAIN LANGUAGE\n\nAfter boot snippets and the banner, stock /boot/init.js enters an infinite read/eval loop: readLine returns one user line; execLine runs it through the same shell as interactive typing (pipelines, redirects, builtins). Exceptions are caught so a bad script does not exit the session—the booter logs and continues. There is no second process: the “kernel” is a JavaScript loop in the booter, not a ring-0 scheduler.\n\nShell entry is still ctx.execLine; /bin utilities are ctx.runBinCommand or runScriptFromSource from the runner. For why import does not work inside /bin sources, read developer-guide — Modules and imports <../developer-guide/05-modules-and-imports.md>.\n\n/BOOT/INIT.JS\n\nStaged from kernel/init.js. Responsibilities (typical):\n\n1. Print /etc/os-release via ctx.drive.get + b4a.toString\n2. Print optional /etc/motd if present\n3. Optional boot profile: first line of /etc/bare-os/profile, overridden by host BARE_OS_BOOT_PROFILE; if the name is safe, run /etc/bare-os/rc.profile.<name> when present (before main rc)\n4. Run non-comment lines from /etc/bare-os/rc through execLine (boot-time shell snippets)\n5. Run digit-prefixed snippets under /etc/bare-os/rc.d/ (same rules as before)\n6. Run optional /etc/bare-os/rc.local (non-comment lines via execLine, after rc.d)\n7. Run digit-prefixed snippets under /etc/bare-os/kernel.d/ (same skip rules as rc.d) after rc.local\n8. Run optional */etc/bare-os/kernel.ext.d/.json drop-ins listing trusted scripts under /lib/bare-os/extensions/ (via ctx.bareOsRunImageScript**)\n9. Print a one-line hint (commands, login, paths), or /etc/bare-os/banner / /etc/issue when present\n10. When BARE_OS_SKIP_REPL: optional onboot — every non-comment line from host BARE_OS_ONBOOT (newline-separated), or if unset, every such line from /etc/bare-os/onboot in order, via execLine\n11. Loop forever:\n\n- line = await readLine('')\n- Break on null (EOF / session end)\n- Skip empty lines\n- try/catch around execLine(t) so stray throws do not kill the loop\n\nThe prompt ([user@host:path] > ) is applied by the booters readline layer, not by init.js.\n\nBOOT PROFILES, RECOVERY, AND READINESS\n\nWhen to use which (practically):\n\n- Normal dev — leave profiles unset; use /etc/bare-os/rc and friends on the system image.\n- *BARE_OS_BOOT_PROFILE / rc.profile. — opt into extra PATH, aliases, or distro-specific setup without** forking init.js.\n- BARE_OS_BOOT_MINIMAL — “something is broken in rc” recovery: you still get os-release / motd and a prompt, but skip heavy boot phases.\n- BARE_OS_BOOT_SKIP — surgical skips (comma list) when bisecting which boot phase fails.\n- BARE_OS_BOOT_ALLOWLIST + BARE_OS_BOOT_STRICT — distributor mode: only vetted first tokens from /etc/bare-os/boot.allow run during boot snippets.\n- BARE_OS_KERNEL_SELFTEST + BARE_OS_SELFTEST_FORMAT=tap — CI smoke inside the image after boot.\n- ctx.bareOsPublishBootReady — automation hooks that watch /run/bare-os/ready or boot.json (see Kernel extensions <../docs/reference/kernel-extensions.md> for related caps).\n\n| Host / kernel env | Purpose |\n| BARE_OS_BOOT_PROFILE / /etc/bare-os/profile | First line names /etc/bare-os/rc.profile.<name> (before rc). Suggested names: dev (extra PATH, aliases), ci (BARE_OS_SKIP_REPL + BARE_OS_ONBOOT smoke lines), kiosk (minimal rc.d, fixed onboot). |\n| BARE_OS_BOOT_MINIMAL | Skip rc, rc.d, rc.local, kernel.d, onboot, and profile *rc.profile. — recovery shell with os-release / motd** only. |\n| BARE_OS_BOOT_SKIP | Comma list of phases to skip: profile, rc, rc.d, rc.local, kernel.d, kernel.ext.d, onboot. |\n| BARE_OS_BOOT_TRACE=ndjson | One JSON object per boot phase on stderr (type, phase, ms, sessionId, ts). |\n| BARE_OS_KERNEL_SELFTEST | After boot snippets, run a short trusted execLine checklist. |\n| BARE_OS_SELFTEST_FORMAT=tap | Same self-test emits TAP lines on stderr (CI-friendly). |\n| BARE_OS_BOOT_ALLOWLIST=1 | Only run boot snippet lines whose first shell token is listed in /etc/bare-os/boot.allow (plus safe builtins); distributors can start from etc/bare-os/boot.allow.example on the system image. Pair with BARE_OS_BOOT_STRICT to exit on the first disallowed or failing line. |\n| BARE_OS_EXEC_MAX_DEPTH | Max nested execLine depth (host → session; default 64). |\n| ctx.bareOsPublishBootReady(...) | Kernel calls this when boot is complete; populates /run/bare-os/ready (1 / 0) and /run/bare-os/boot.json (imageDigest, pearChannel, pearRelease are pre-seeded from host env when set — see environment variables reference <../docs/reference/environment-and-posix-appendix.md#14-environment-variables-complete-list>). |\n| BARE_OS_BOOT_MANIFEST | When 1 / true, the stock kernel verifies /etc/bare-os/boot.manifest.json against an expected SHA-256 (see kernel init.js and ctx.bareOsBootFileSha256Hex). Example layout: kernel/etc/bare-os/boot.manifest.example.json <../kernel/etc/bare-os/boot.manifest.example.json>. |\n| BARE_OS_BOOT_MANIFEST_SIGN, BARE_OS_BOOT_MANIFEST_PUBKEY_HEX | Optional Ed25519 over the raw manifest bytes: expects /etc/bare-os/boot.manifest.sig and ctx.bareOsVerifyBootManifestSignature (host/booter). Mismatch fails boot with a clear stderr line. |\n| ctx.bareOsRegisterBootPhaseHook / bareOsInvokeBootPhaseHooks | Kernel extensions can observe before: / after: stock phases (e.g. rc, repl) without replacing init.js. See developer guide §2 <../developer-guide/02-the-context-object.md>. |\n| /etc/bare-os/selftest.d/ | Optional digit-prefixed *.sh snippets run after the main boot path when BARE_OS_KERNEL_SELFTEST is enabled (same execLine rules as other boot snippets). Pair with BARE_OS_SELFTEST_FORMAT=tap** for CI-friendly stderr. |\n\nCUSTOM INIT.JS CONTRACT\n\nReplacing /boot/init.js on the system image is supported: the booter loads it with AsyncFunction and expects a top-level async function start(ctx). Stable ctx fields for kernels are documented in Chapter 4 <04-the-booter-runtime.md> and the context object developer guide <../developer-guide/02-the-context-object.md>, including ctx.bareOsRuntimeCaps for pipeline limits, quotas, pseudo path lists, and features (e.g. httpDelegate, gitDelegate, systemctlDelegate, vfsWatch, ipcRpcJson, initdSocketActivation). Use ctx.registerKernelShutdownHook for teardown that must run before stopBareInitd. Boot snippets under /etc/bare-os/rc, /etc/bare-os/rc.d/ (only rc.d files whose names start with a digit), rc.local, kernel.d/ (same digit-prefix rules), *rc.profile., and onboot are trusted (full execLine power); keep them minimal. Optional /etc/bare-os/boot.allow (see boot.allow.example in the kernel tree) lists allowed first tokens when BARE_OS_BOOT_ALLOWLIST=1**.\n\nCOREUTILS BUILD PIPELINE\n\nIn one sentence: developers edit packages/bare-os-coreutils/src/<cmd>.js and optional *lib/-engine.js helpers; build.mjs concatenates a preamble (runtime + engines) per command, emits kernel/bin/<cmd>, and the seeder stages the same bytes into its vendored kernel/bin/ for Pear. lib/commands.mjs is the sorted manifest of every /bin name; the build fails if a command is missing from the manifest or from man/pages/**.\n\n packages/bare-os-coreutils/lib/runtime.js\n +\n (optional) packages/bare-os-coreutils/lib/<engine>.js ← sed-engine, awk-engine, edit-*.js, …\n +\n packages/bare-os-coreutils/src/<cmd>.js\n ↓ (build.mjs, see preamble map)\n kernel/bin/<cmd>\n packages/bare-os-seeder/kernel/bin/<cmd> ← Pear vendored copy\n\nRule: no import in *src/.js — only async function run(ctx, argv) (shared helpers live in lib/runtime.js). Large sed and awk bodies live in lib/-engine.js; md5sum prepends lib/md5.js; jq prepends lib/jq-engine.js; all are concatenated at build time (same global scope as run). edit and nano share src/edit.js and lib/edit-.js; /bin/nano is a separate staged name (default shell alias nano → edit). See lib/commands.mjs for the full sorted /bin** name list.\n\nSIDEBAR: WHY SED AND AWK ARE “ENGINES”\n\nPOSIX sed and awk are large enough that shipping them as one file per command would duplicate parsers and bloat the image. The build prepends shared lib/sed-engine.js / lib/awk-engine.js into the emitted /bin scripts so one JS runtime runs the grammar, while run(ctx, argv) stays the stable entrypoint. Behavior is Issue 7inspired, not byte-identical to GNU—see Chapter 9 <09-posix-utilities-shell-and-vfs.md>.\n\nFull POSIX-style catalog, stubs, and divergence notes: Chapter 9 — POSIX utilities, shell, and VFS <09-posix-utilities-shell-and-vfs.md>.\n\nDELEGATED COMMANDS (BEFORE /BIN)\n\ngit, curl, wget, and the systemctl family are not executed from the coreutils /bin sources first. runBinCommand <../packages/bare-os-booter/lib/kernel-runner.js> matches the command basename against the host delegate registry (host-delegate-registry.js <../packages/bare-os-booter/lib/host-delegate-registry.js>) before it walks PATH on the system drive. BARE_OS_DELEGATE_ALLOW can disable individual kinds (git, curl, wget, systemctl). The system image still contains /bin/curl and /bin/wget so which and ls /bin look complete; those files are placeholders that should never run in a correctly configured session.\n\nHTTP details: Reference — HTTP: curl and wget <../docs/reference/http-curl-and-wget.md> · Policy: Developer guide — Security and trust <../developer-guide/09-security-and-trust.md>.\n\nFILE METADATA AND PERMISSIONS (NOT FULL POSIX)\n\nHyperdrive entries carry optional metadata.bareOs (mode, uid, gid, names, mtime) set on vfs.writeFile. New files use UMASK from the environment (default 022): typically 0644 for data files, 0755 when executable is set. ls -l and stat/lstat read that metadata; seeded system files without bareOs are synthesized (e.g. root, 0555 under /bin). The VFS enforces basic read/write/traverse checks from UID/GID and mode bits. chown / chgrp update that metadata on the personal drive (same writable scope as chmod); this is still not ACLs or a multi-user host kernel.\n\nCOMMAND REFERENCE (SUMMARY)\n\n| Command | Role |\n| systemctl, journalctl | Booter-delegated: list/status/logs/start/stop/restart/enable/disable/is-enabled/is-active for bare-initd units; preset file on personal drive; journalctl -u only; bare-initctl alias; see ch. 4 |\n| curl, wget | Booter-delegated Fetch-based HTTP clients; /bin copies are stubs — see HTTP: curl and wget <../docs/reference/http-curl-and-wget.md> and CLI_PARITY.md <../packages/bare-os-booter/CLI_PARITY.md> |\n| git | Booter-delegated (isomorphic-git); see Chapter 8 <08-git-on-bare-os.md> |\n| basename, dirname | Path manipulation |\n| cat, head, tail, nl | Text |\n| clear | ANSI clear screen |\n| crontab | -l list, -r remove, <file> install (~/.crontab; writes need login) |\n| date | Date/time |\n| echo, printf-like simplicity | Args to stdout |\n| edit, nano | TTY full-screen buffer editor (same source for both /bin names; stock alias nano → edit); requires real TTY — see ch. 9 §5.2a <09-posix-utilities-shell-and-vfs.md> |\n| env, printenv | Environment |\n| exit | Sets exit code / session end via booter |\n| false, true | Status |\n| grep | Line filter: -E/-F, -i, -v, -w, -x, -n, -c, -l, -o, -m, -q, -s, -e, -f, -H/-h; JS RegExp, not full GNU/PCRE |\n| hdms | Hyperdrive management CLI |\n| help | Lists builtins + /bin |\n| hostname | Host string |\n| id, whoami, tty | Identity / TTY |\n| login, logout | Account session |\n| ls | Lists directories; *hides . unless -a; -l** uses real mode, owner, group, mtime from VFS stat |\n| chmod | Octal (e.g. 644) or symbolic (e.g. u+rw) on writable drives; updates stored metadata + executable bit |\n| mkdir, rmdir | mkdir -p; empty dirs use .bareos_empty (see ch. 9) |\n| cp, mv, ln | cp -R, mv (copy+delete trees), ln -s only (no hard links) |\n| stat, readlink | File metadata and symlink targets |\n| printf, cut, tr, od | Formatting and text transforms (ASCII-oriented tr) |\n| sed, awk | Large JavaScript engines in *lib/-engine.js** — not byte-identical to GNU/POSIX everywhere; see ch. 9 |\n| tee, find, du, cksum | Pipe tee, limited find (-maxdepth, -mindepth, -depth, -name, -type), du -k, POSIX CRC cksum |\n| mktemp | Creates a temp file under session /tmp (template XXX suffix) |\n| git-pear | Thin helper for Git + Pear workflows (channel/release env); see Chapter 8 <08-git-on-bare-os.md> |\n| time, logname | Wall-clock time via ctx.runBinCommand; identity string |\n| chown, chgrp | Update ownership in metadata.bareOs on the personal drive (same writable scope as chmod); supports :group and numeric ids; root vs owner rules as in VFS |\n| mkfifo | Creates a simulated named pipe at /run/bare-os/ipc/<name> (in-memory FIFO in the booter; readFile blocks until writeFile delivers bytes) |\n| getconf, xargs | Documented Bare subsets (fixed getconf table; bounded xargs via ctx.runBinCommand) |\n| pathchk | Path sanity |\n| pwd | Logical cwd |\n| rm | Remove files; -r/-R/--recursive for directories, -f/--force (bundled -rf) — uses VFS tree walk + del per entry |\n| savevault | Encrypted vault snapshot |\n| seq, sleep, sort | Misc |\n| test, [ | Conditionals (as implemented) |\n| touch | Create/empty files |\n| uname | OS string |\n| wc, which | Text / PATH lookup |\n| uniq, realpath, base64, sha256sum, … | Checksums and path canonicalization (see ch. 9 for md5sum, sha1sum, sha512sum, sum, base32, basenc) |\n| paste, split, tac, rev, expand, unexpand, fold, fmt, comm, join, pr, yes, shuf, tsort, factor, expr, numfmt | GNU-style text/data utilities (several are memory- or output-bounded; see ch. 9 and getconf) |\n| truncate, unlink, install, df, sync | File sizing, single unlink, copy+chmod, synthetic df, no-op sync |\n| arch, groups, hostid, nproc, uptime, users, who | Session / stub introspection |\n| dir, vdir | ls -C / ls -l via runBinCommand |\n\nExact flags vary—read each src/<cmd>.js for truth.\n\nRUNNING USER SCRIPTS\n\n- ./foo.js — explicit relative path via VFS.\n- foo.js — if the basename ends with .js, the runner tries $PWD/foo.js before scanning PATH on the system drive.\n\nShebang lines #!... are stripped before compilation.\n\nNo ESM in the image: user scripts are AsyncFunction bodies, not Node modules—see developer-guide — User scripts and PATH <../developer-guide/04-user-scripts-and-path.md> and Modules and imports <../developer-guide/05-modules-and-imports.md>.\n\nEDITING THE BANNER\n\nUpdate kernel/init.js and packages/bare-os-seeder/kernel/init.js if you want the staged Pear copys first-run text to match (some workflows copy automatically via build; the seeders kernel/ tree may be vendored separately—check your release process).\n\nNext: Chapter 7 — Operations <07-operations-and-development.md> · POSIX utilities (detail) <09-posix-utilities-shell-and-vfs.md>\n\nRelated: Identity and HDMS <05-identity-vault-and-hdms.md> · Handbook home <README.md> · Kernel extensions <../docs/reference/kernel-extensions.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","06","kernel","and","binaries","bin","utilities"],"seeAlso":[{"name":"handbook-07-operations-and-development","section":7},{"name":"handbook-05-identity-vault-and-hdms","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/06-kernel-and-binaries.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-07-operations-and-development","section":7,"title":"Chapter 7 — Operations, development, and release","synopsis":["man 7 handbook-07-operations-and-development","Handbook chapter (plain text from handbook/07-operations-and-development.md)"],"description":"CHAPTER 7 — OPERATIONS, DEVELOPMENT, AND RELEASE\n\nTime to read: about 14 minutes. Prerequisites: root README.md <../README.md> for the shortest path; Chapter 3 <03-protocol-and-disk.md> if debugging boot.\n\nThis chapter is the operators desk: how to install, test, run Pear apps, interpret CI, and chase common failures.\n\nREPOSITORY LAYOUT (MONOREPO)\n\n| Path | Package / role |\n| package.json | Workspaces root, pretest builds coreutils + bare-libs + kernel/seeder parity |\n| kernel/ | System image sources |\n| packages/bare-os-protocol | Topic + MBR + Protomux helpers |\n| packages/bare-os-coreutils | Build /bin scripts |\n| packages/bare-os-bare-libs | Build /lib/bare bundles for optional ctx.bare drive merge |\n| packages/bare-os-seeder | Publish OS drive |\n| packages/bare-os-booter | Network boot + runtime |\n| scripts/ | Pear node_modules fixer, parity, catalog, release checklist |\n| data/ | Gitignored legacy Corestore dir (optional; defaults use ~/.bare-os) |\n\nEach workspace has its own README.md with package-specific commands.\n\nCONTINUOUS INTEGRATION (GITHUB ACTIONS)\n\nThe .github/workflows/ci.yml <../.github/workflows/ci.yml> job:\n\n1. Checks out the repo on ubuntu-latest.\n2. Installs Node 20 with npm cache.\n3. Runs npm ci.\n4. Installs Bare globally: npm install -g bare (matches local identity/crypto tests).\n5. Runs npm run gen:bare-catalog:check — ensures docs/bare-holepunch-catalog.json <../docs/bare-holepunch-catalog.json> is up to date with the generator (no drift in PRs).\n6. Runs npm test, which triggers pretest first (see below).\n\nIf CI fails on gen:bare-catalog:check, run npm run gen:bare-catalog locally and commit the JSON. If pretest fails, read the next section.\n\nPRETEST: WHAT RUNS BEFORE NPM TEST\n\nRoot package.json <../package.json> defines:\n\n \"pretest\": \"npm run build -w bare-os-coreutils && npm run build -w bare-os-bare-libs && node scripts/verify-kernel-seeder-parity.mjs && npm run smoke:bare-manifest\"\n\n| Step | What breaks if it fails |\n| build -w bare-os-coreutils | Stale or broken /bin outputs, man.json, or TypeScript/ syntax errors in utilities |\n| build -w bare-os-bare-libs | Bad ctx.bare bundles or esbuild errors for kernel/lib/bare/ |\n| verify-kernel-seeder-parity.mjs | kernel/ and packages/bare-os-seeder/kernel/ diverged — Pear seeder would ship the wrong tree |\n| smoke:bare-manifest | bare-module-manifest.json imports or optional deps inconsistent with the smoke script |\n\nHOLEPUNCH CATALOG AND BARE MANIFEST (MAINTAINERS)\n\n- npm run gen:bare-catalog — Refreshes docs/bare-holepunch-catalog.json from upstream metadata (network).\n- npm run gen:bare-catalog:check — Same as above in check mode for CI.\n- npm run sync:bare-manifest — Applies catalog data to packages/bare-os-booter/lib/bare-module-manifest.json <../packages/bare-os-booter/lib/bare-module-manifest.json> and related booter optionalDependencies.\n- npm run smoke:bare-manifest — Import smoke test for manifest entries.\n\nSee docs/README.md <../docs/README.md> and developer-guide ch.12 <../developer-guide/12-bare-modules-and-pear-ecosystem.md>.\n\nRELEASE CHECKLIST\n\nscripts/release-checklist.mjs <../scripts/release-checklist.mjs> is a maintainer aid to sanity-check versioning, artifacts, or release steps before tagging (run node scripts/release-checklist.mjs from the repo root when preparing a release). It complements—not replaces—human review and Pear staging.\n\nINSTALL AND TEST\n\n git clone https://git.ssh.surf/snxraven/bare-operating-system.git\n cd bare-operating-system\n npm ci\n npm test\n\n- booter tests use Node for Hyperdrive + Bare for identity crypto (test.identity.js).\n\nRUNNING SEEDER AND BOOTER (NODE)\n\nFrom packages/bare-os-seeder:\n\n node index.js\n\nFrom packages/bare-os-booter:\n\n node index.js\n\nDefault Corestore paths are ~/.bare-os/corestore/seeder and ~/.bare-os/corestore/booter (override base with BARE_OS_HOST_DATA, or set BARE_OS_SEED_STORE / BARE_OS_BOOT_STORE). See each packages lib/paths.js.\n\nRUNNING WITH PEAR (RECOMMENDED FOR “REAL” BEHAVIOR)\n\nFrom repo root:\n\n npm run os:seeder\n npm run os:booter # second terminal\n\nThese run scripts/ensure-pear-node-modules.mjs first so Pears module resolution sees workspace dependencies the same way npm ci does at the repo root—without that shim, pear run from a package directory can miss hoisted node_modules. Do not run pear run os:seeder — os:seeder is an npm script name, not a Pear link.\n\nPEAR CHANNELS, STAGING, AND PEAR:// LINKS\n\nAfter pear stage / pear release, Pear prints a pear://… link per app. Consumers normally run those keys—not arbitrary git checkouts—unless they use dev mode pear run --dev ..\n\nConcrete keys and re-staging steps (seeder/booter channels, versioned links, host env for OTA): PEAR-RUN.md <../PEAR-RUN.md>. That file also documents *BARE_OS_PEAR_, HTTP allow/deny lists, TLS pin env vars, and ctx.bare** toggles mirrored from the host.\n\nENVIRONMENT VARIABLES (CHEAT SHEET)\n\n| Variable | Component | Meaning |\n| BARE_OS_KERNEL_ROOT | Seeder | Override kernel tree path |\n| BARE_OS_HOST_DATA | paths | Host state base (default ~/.bare-os) |\n| BARE_OS_SEED_STORE | Seeder | Corestore directory |\n| BARE_OS_BOOT_STORE | Booter | Booter Corestore directory |\n| BARE_OS_BOOT_TIMEOUT_MS | Booter | Boot deadline (default 60000) |\n| BARE_OS_NO_SPLASH | Booter | Disable TTY splash |\n| BARE_OS_SKIP_REPL | Booter | Non-interactive kernel |\n| BARE_OS_FISH | Booter | Set 0 to disable fish readline |\n| HYPERSWARM_BOOTSTRAP | Booter / HDMS | Comma-separated bootstrap nodes |\n\nThe booter also copies many *BARE_OS_ toggles from the host into the guest session (pipeline caps, boot strictness, audit, Pear metadata, BARE_OS_VFS_WATCH, BARE_OS_BOOT_ALLOWLIST**, etc.). See docs/reference/environment-and-posix-appendix.md <../docs/reference/environment-and-posix-appendix.md#14-environment-variables-complete-list> for the full list.\n\nLayers in plain language: host env (Pear shell, CI, your laptop) seeds values into shellEnv; the guest sees them as normal environment variables and in /proc/self/environ (filtered). When debugging, ask: was this variable set on the host before launching the booter?\n\nTHEMES, LS_COLORS, AND REAL TERMINALS\n\nThemes are not just aesthetics—they keep ls --color, the fish-style prompt, and host emulator configs aligned so you do not debug “broken colors” when the real issue is a truecolor vs 256-color mismatch.\n\n- ~/.barerc supports theme <preset> (e.g. theme nord) plus export / alias. The active preset fills *BARE_OS_COLOR_ and LS_COLORS unless you set LS_COLORS yourself or BARE_OS_LS_COLORS_LOCKED=1. Use BARE_OS_COLOR_DEPTH (256, 16, or ansi**) on constrained terminals.\n- barerc reload, theme, dircolors — see Chapter 4 <04-the-booter-runtime.md> and man theme.\n- docs/themes/README.md <../docs/themes/README.md> — preset packs and sample Alacritty / Warp YAML (in-house).\n\nFORMATTING\n\n npm run format\n npm run lint\n\nPrettier config: no semicolons, single quotes (.prettierrc).\n\nTROUBLESHOOTING\n\n| Symptom | Likely cause |\n| Booter exits at timeout | No seeder peer on bare-os-v1 topic |\n| /bin/foo missing under Pear | Forgot npm run build -w bare-os-coreutils before staging |\n| autopass / module not found in Pear | Hoist/ensure-pear-node-modules / static imports in HDMS |\n| test is not defined in user script | Bug in user JS—should log and continue (kernel runner catches) |\n| Double cron or log spam | Session restarted without stopBareInitd — should run on REPL cleanup |\n| CI fails gen:bare-catalog:check | Regenerate catalog and commit |\n| verify-kernel-seeder-parity fails | Copy kernel/ → packages/bare-os-seeder/kernel/ per release docs |\n\nFURTHER READING\n\n- docs/reference/README.md <../docs/reference/README.md> — file-by-file reference (authoritative for paths)\n- README.md <../README.md> — short overview\n- Preface <00-preface.md> — thesis and contributor paths\n- Handbook Chapter 3 <03-protocol-and-disk.md> — boot failures on the wire\n\nNext: Chapter 8 — Git on Bare OS <08-git-on-bare-os.md>\n\nRelated: Handbook home <README.md> · CHANGELOG — ctx API <../packages/bare-os-booter/CHANGELOG.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","07","operations","and","development","release"],"seeAlso":[{"name":"handbook-08-git-on-bare-os","section":7},{"name":"handbook-06-kernel-and-binaries","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/07-operations-and-development.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-08-git-on-bare-os","section":7,"title":"Chapter 8 — Git on Bare OS","synopsis":["man 7 handbook-08-git-on-bare-os","Handbook chapter (plain text from handbook/08-git-on-bare-os.md)"],"description":"CHAPTER 8 — GIT ON BARE OS\n\nTime to read: about 8 minutes. Prerequisites: Chapter 4 — VFS <04-the-booter-runtime.md> (path routing), Chapter 7 <07-operations-and-development.md> for env vars.\n\nThe git command in this project is not the GNU Git binary. It is a small CLI in the booter package that calls isomorphic-git <https://isomorphic-git.org/> — a JavaScript implementation with a fixed set of APIs, not parity with every git subcommand you might know from a desktop Linux install.\n\nWHY DELEGATION EXISTS\n\nHyperdrive-resident /bin utilities are built as concatenated scripts and loaded with AsyncFunction. They cannot use Node import to pull in isomorphic-git. When you type git, the booter short-circuits to git-cli.js via a normal ESM import at host level—same pattern as delegated curl, wget, and systemctl. Storage still targets VFS paths (personal drive under $HOME, writable HDMS mounts), not arbitrary host paths.\n\nHOW IT RUNS\n\n- Delegation: When you type git (or an absolute path like /bin/git whose basename is git), the booter loads git-cli.js with a normal ESM import. That avoids the Hyperdrive /bin model, where utilities are concatenated and evald without import, which cannot load npm packages.\n- Storage: Repositories live on the VFS (personal drive under $HOME, or writable HDMS mounts). isomorphic-git expects a Node-style fs.promises surface; the booter provides createGitFsFromVfs, which maps those calls onto Hyperdrive-backed paths. Empty directories use a hidden marker file (.bareos_empty) because Hyperdrive does not always mirror POSIX directory semantics.\n\nNETWORK MODES (CLONE, FETCH, PUSH)\n\n- On Node, HTTP defaults to isomorphic-git/http/node (simple-get), loaded via import.meta.resolve when available so package subpaths resolve reliably (including under Pear).\n- If that fails to load, or when you set BARE_OS_GIT_HTTP=web, the CLI uses isomorphic-git/http/web, which expects a global fetch. The booter statically imports the web client so Pears bundler can wire isomorphic-git/http/web (dynamic imports from git-cli.js used to fail with “Cannot find referrer”). Node 18+ and browsers already provide fetch; Pear/Bare often does not, so the booter loads bare-fetch (Holepunch) and assigns globalThis.fetch (plus Request / Response / Headers) before using the web client.\n- TLS, proxies, and corporate inspection still depend on the host; certificate errors may surface even when the VFS layer is fine.\n\nMental model: git network I/O is host-shaped; repository bytes are drive-shaped.\n\nEXPECTATIONS AND CONSTRAINTS\n\n- Use git --help inside Bare OS for the supported subcommand list.\n- Unsupported subcommands print a short message; for full API behavior, see the isomorphic-git documentation <https://isomorphic-git.org/docs/en/next/alphabetic>.\n- Very large repos may stress memory and replication more than desktop Git with packfiles on a local disk—this is still a research stack.\n\nGIT-PEAR AND PEAR METADATA\n\n/bin/git-pear is a small coreutils utility that prints or exports Pear-oriented hints (PEAR_CHANNEL, BARE_OS_PEAR_CHANNEL, BARE_OS_PEAR_RELEASE) for scripts that clone or tag against a Pear release channel. It complements git (which remains the isomorphic-git CLI) and is documented in man git-pear after a coreutils build.\n\ngip (when installed on the host) is described in the Developer guide — Kernel + Pear cookbook <../developer-guide/11-kernel-pear-cookbook.md> as a host-side companion for publishing drives; inside the guest image, prefer git + git-pear for VFS-local workflows.\n\nNext: Chapter 9 — POSIX utilities, shell, VFS <09-posix-utilities-shell-and-vfs.md>\n\nRelated: Handbook home <README.md> · PEAR-RUN.md <../PEAR-RUN.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","08","git","on","bare","os"],"seeAlso":[{"name":"handbook-09-posix-utilities-shell-and-vfs","section":7},{"name":"handbook-07-operations-and-development","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/08-git-on-bare-os.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-09-posix-utilities-shell-and-vfs","section":7,"title":"Chapter 9 — POSIX-style utilities, shell builtins, and VFS alignment","synopsis":["man 7 handbook-09-posix-utilities-shell-and-vfs","Handbook chapter (plain text from handbook/09-posix-utilities-shell-and-vfs.md)"],"description":"CHAPTER 9 — POSIX-STYLE UTILITIES, SHELL BUILTINS, AND VFS ALIGNMENT\n\nTime to read: reference chapter (skim §12, use §5 as catalog). Prerequisites: Chapter 4 <04-the-booter-runtime.md>, Chapter 6 <06-kernel-and-binaries.md>.\n\nWHY THIS CHAPTER EXISTS\n\nIf you come from Linux or macOS, Bare OS feels like a small Unix: ls, grep, sed, pipelines, and man. Under the hood it is JavaScript utilities on a two-drive VFS with simulated pipes. This chapter is the honest catalog: what matches POSIX.1-2017 XCU <https://pubs.opengroup.org/onlinepubs/9699919799/toc.htm> closely, what is Issue 7inspired, and what is stubbed or bounded so the runtime stays predictable.\n\nNormative reference: Open Group Issue 7 — use the online utilities index for intended semantics; Bare behavior may intentionally diverge where Hyperdrive or the single-process runtime makes full compliance impossible.\n\nPHILOSOPHY: “ISSUE 7-ISH” IN ONE PARAGRAPH\n\nWe borrow names and muscle memory from POSIX because that makes scripts portable in spirit. We do not promise bitwise compatibility with GNU coreutils, binary sh compatibility, or kernel semantics (no real fork, no real FIFOs on disk). When in doubt, read src/<cmd>.js and the environment / POSIX appendix <../docs/reference/environment-and-posix-appendix.md#14a-posix-userland-appendix-implemented-vs-gaps>—the appendix is the checklist view; this chapter is the narrative view.\n\n1. EXECUTIVE SUMMARY: WHAT IS _NOT_ POSIX HERE\n\n| Expectation (full POSIX) | Bare OS reality |\n| sh grammar (full POSIX) | Line-at-a-time shell: builtins + /bin; lists with ; (outside compound statements), &&, \\| pipelines; bounded if … fi; bounded while / for (iteration cap BARE_OS_SHELL_LOOP_MAX, default 10000); bounded case … esac (BARE_OS_SHELL_CASE_MAX_BRANCHES, default 32). Optional bounded $(…) when BARE_OS_SHELL_CMDSUBST=1 (see §3). No subshells or full sh grammar. |\n| Processes, fork, pipes as OS primitives | Pipelines are simulated by capturing console.log (and merged console.error when 2>&1 is used) into the next command. |\n| chown / chgrp / real UIDs across users | Single-session identity; metadata carries uid/gid for display and checks. |\n| FIFOs, mknod, real devices | No kernel FIFOs or mknod; mkfifo creates in-memory channels under /run/bare-os/ipc/<name> (see bare-os-ipc.js). |\n| xargs full POSIX/GNU surface | Bounded implementation: ctx.runBinCommand only; -0, -n (and -nN); stdin/token/invocation caps (see src/xargs.js). |\n| getconf / live sysconf | Fixed name table + -a; values are Bare constants, not host kernel queries (see src/getconf.js). |\n| Byte-identical sed / awk / grep | JavaScript engines; regex and edge cases differ from GNU or strict POSIX. |\n\nFor the /bin build contract (no import, AsyncFunction load), see Chapter 6 <06-kernel-and-binaries.md>.\n\n> Key idea — two drives, one namespace: utilities almost never care which Hyperdrive backs a path; the VFS routes $HOME, /tmp, and /var/log to personal prefixes and everything else to the system image. See Chapter 4 <04-the-booter-runtime.md>.\n\n2. VFS: DIRECTORIES, METADATA, AND EMPTY FOLDERS\n\npackages/bare-os-booter/lib/vfs.js <../packages/bare-os-booter/lib/vfs.js> exposes a unified path space over the system and personal Hyperdrives (see Chapter 4 <04-the-booter-runtime.md>).\n\n> Key idea — .bareos_empty: empty directories are marked with a hidden sentinel so git and mkdir -p agree on tree shape. Hyperdrive is not POSIX-shaped by default.\n\n2.1 EMPTY DIRECTORIES (.BAREOS_EMPTY)\n\nHyperdrive does not always behave like a POSIX directory tree. Empty directories are represented by a hidden marker file .bareos_empty, consistent with git-fs-adapter.js <../packages/bare-os-booter/lib/git-fs-adapter.js> and Chapter 8 — Git <08-git-on-bare-os.md>. readdir on the raw VFS may list that name; git paths filter it.\n\n2.2 MKDIR AND RMDIR\n\n- vfs.mkdir(path, { recursive, mode }) — creates directories by writing dirname/.bareos_empty. Optional mode sets permission bits on the marker; lstat on the directory derives S_IFDIR from that metadata (with execute bits implied where read bits are set, so paths stay traversable). -p / --parents and -m are implemented by /bin/mkdir.\n- vfs.rmdir(path) — removes a directory only if it has no entries other than .bareos_empty (and removes the marker).\n\n2.3 PSEUDO /PROC, /SYS, /RUN, /DEV, AND SESSION /TMP\n\n- /proc, /sys, /run, /dev — read-only synthetic trees except /dev/null and /dev/zero accept writes that are discarded (see Chapter 4 <04-the-booter-runtime.md>). Other pseudo writeFile / unlink / chmod paths fail as documented there. Extra Linux-shaped stubs include /proc/cpuinfo, /proc/loadavg, /proc/net/dev, /proc/diskstats, /proc/bare_os/ (stable aliases + index.json), /proc/bare_os_quotas, /proc/bare_os_resources, /proc/bare_os_features, /proc/bare_os_session_stats, /proc/bare_os_swarm, /proc/bare_os_replication, /proc/bare_os_capabilities (and /proc/bare_os_capabilities.json), /proc/bare_os_bootstrap, /proc/bare_os_union, /proc/bare_os_seed_handshake, /proc/bare_os_virtual_registry, /proc/self/exe, /proc/self/fd/02, /sys/class/net/lo, /sys/devices/virtual, /sys/fs/bare_os/build_id, */run/bare-os/virtual/, /run/bare-os/unit-journal/.ndjson, and /dev/urandom (each readFile of urandom returns a bounded buffer; not suitable for cryptography unless BARE_OS_URANDOM_CRYPTO is left at default). Optional union write denials use BARE_OS_VFS_UNION_WRITE_DENY* (see kernel extensions <../docs/reference/kernel-extensions.md>).\n- /tmp — writable on the personal drive under /.bare-os/tmp/<HOME-basename>/…, isolated like $HOME and /var/log.\n\n2.4 CHMOD (OCTAL AND SYMBOLIC)\n\n/bin/chmod accepts:\n\n- Octal modes (e.g. 644, 0755) — passed through to vfs.chmod (permission bits; type bits come from the existing entry).\n- Symbolic modes (e.g. u+rw, go-w) — a supported subset of POSIX symbolic chmod; see packages/bare-os-coreutils/src/chmod.js.\n\n/bin/chown and /bin/chgrp update metadata.bareOs on the personal drive via vfs.chown (same writable scope as chmod); root vs owner rules apply, but this is still a single-session runtime (not a multi-user host kernel).\n\n2.5 COPY AND MOVE\n\n- cp — -R/-r recursive copy; follows the same marker convention (skips copying .bareos_empty as a separate “file” where appropriate).\n- mv — Hyperdrive has no atomic rename; the general case is copy-tree + vfs.rm on the source. A single regular file to a non-directory destination uses readFile → writeFile → unlink on the source (same semantics, slightly less overhead than recursive rm).\n\n3. SHELL LISTS, PIPELINES, AND BUILTINS (PACKAGES/BARE-OS-BOOTER/LIB/SHELL.JS)\n\nTop-level syntax: the line is split on ; into separate lists (semicolons inside compound blocks do not end the outer statement). if then [ else ] fi uses the same && / || / pipeline rules inside the condition and each branch; the condition is true when the last evaluated command in that &&/|| list exits 0. while list; do list; done and for name in words ; do list; done repeat the body while respecting BARE_OS_SHELL_LOOP_MAX. case word in pattern) list ;; … esac matches the first glob pattern (token-safe); branch count is capped by BARE_OS_SHELL_CASE_MAX_BRANCHES. Each list is an AND-OR chain: pipelines separated by && or ||, evaluated left-to-right with POSIX-style short-circuiting (ctx.exitCode — treat missing as 0). Within a pipeline, | connects stages as before (simulated stdin between utilities).\n\nBackground / jobs (subset): a trailing & on a top-level list runs that list asynchronously (microtask). jobs lists recent jobs; fg awaits the selected (or latest) job; wait awaits one job by id (or %id) or all background jobs; bg is a stub (no stopped-job resume). This is not POSIX job control (no real processes or signals).\n\nHere-string / here-document: <<< word feeds the expanded word as stdin to the first command in the pipeline. A line that ends with << DELIMITER (optional '...' / \"...\" around the delimiter) collects following lines from readLine('> ') until a line equals DELIMITER, then uses that body as stdin ($ expansion is skipped for a single-quoted delimiter name).\n\nPipeline limits: simulated pipe capture is bounded. Defaults: BARE_OS_PIPELINE_MAX_BYTES (2MiB), BARE_OS_PIPELINE_MAX_LINES (50000), BARE_OS_PIPELINE_MAX_STAGES (32). With BARE_OS_SHELL_STREAMING=1, effective byte and line caps are multiplied by BARE_OS_SHELL_STREAMING_MULT (default 4, max 16) so large captures remain bounded but less tight. Exceeding a limit fails the pipeline with exit status 1 and an error on stderr. Current caps and FIFO stats also surface in /proc/bare_os_quotas and ctx.bareOsRuntimeCaps.quotas.\n\nCommand substitution (bounded): when BARE_OS_SHELL_CMDSUBST=1, words may contain $(…) (one level balanced, nesting depth capped). The inner line runs via execLine; console.log output becomes the substituted text, trimmed to BARE_OS_SHELL_CMDSUBST_MAX_BYTES (default 8192). This is not full POSIX sh command substitution.\n\nCaptured stdout (ctx.bareOsStdoutCaptured): stages whose console.log output is captured into the simulated pipe (or into a > / >> redirect) run with bareOsStdoutCaptured: true on the shallow ctx clone passed to runBinCommand (see bareOsPipelineChildCtx in shell.js). ls uses this to print one name per line in short format, similar to GNU ls when stdout is not a terminal, so grep, sort, and wc receive one entry per line. Each console.log call still becomes one output line (trailing newline added by the shell capture).\n\nexecLine nesting: host BARE_OS_EXEC_MAX_DEPTH (default 64) caps recursive execLine calls (e.g. cron, ExecStartPost); exceeding it fails with a clear error.\n\nStderr redirection: 2> / 2>> redirect console.error for the command (same byte/line caps as stdout when captured for a pipe). 2>&1 merges stderr into the stdout capture stream so both appear in the simulated pipe input for the next stage (and in a stdout redirect when it is the last command in the list).\n\nLast exit status: after each full execLine evaluation, vfs.env.BARE_OS_EXIT_STATUS is updated (decimal string). Words expand $? and ${?} from that value (default 0 if unset), similar to POSIX $?.\n\nBeyond alias, unalias, cd, export, login, logout, exit:\n\n| Builtin | Behavior |\n| unset | Removes variables from vfs.env; refuses readonly names (POSIX-style error). |\n| readonly | Marks names readonly; readonly NAME=value sets and locks. Blocks export and leading assignments on readonly keys. |\n| umask | With an argument, sets env.UMASK (octal string); without, prints the current mask (default 022 if unset). |\n| : | No-op (exit status 0). |\n| command | -v / -V: prints builtin name or resolved PATH location via resolveBinInPath. Otherwise runs runBinCommand with the remaining words (external commands only for that path). |\n| type | type NAME — “builtin” vs resolved /bin/... path or “not found”. |\n\n~/.barerc remains restricted ( export, alias, unalias, comments only) — see Chapter 4 <04-the-booter-runtime.md>.\n\n4. BOOTER CTX HELPERS\n\n- ctx.runBinCommand(argv) — same resolution as the shells external dispatch: host delegates (git, curl, wget, systemctl / bare-initctl / journalctl) run first (see HTTP: curl and wget <../docs/reference/http-curl-and-wget.md>), then explicit paths, then *.js in $PWD, then PATH on the system drive only. Used by /bin/time to run another utility and report wall time. The shell may set ctx.bareOsStdoutCaptured** on the clone when stdout is captured (§3).\n- resolveBinInPath(ctx, name) in kernel-runner.js — used by command -v / type.\n- ctx.vfs.watch(logicalPath) — Hyperdrive-backed paths only; returns { watcher, destroy, … } when ctx.bareOsRuntimeCaps.features.vfsWatch is true (disable with host BARE_OS_VFS_WATCH=0).\n- ctx.bareOsBinWrite(Uint8Array|string) (optional) — raw output hook for NUL-terminated lines and binary-safe writes when host process.stdout.write is missing; used by printenv -0, find -print0, dirname -z, and tests (see bareOsEmitRaw in packages/bare-os-coreutils/lib/runtime.js).\n- ctx.bareOsIpc — in-memory FIFOs under /run/bare-os/ipc/<name>; when features.ipcRpcJson is true, pushJson, takeJson, and stats support bounded JSON envelopes (see bare-os-ipc.js).\n- ctx.bareOsSubscribeBootEvent, ctx.bareOsEmitBootEvent, ctx.bareOsAwaitInitdUnits, ctx.bareOsSubscribeHdmsLifecycle — automation hooks (see Developer guide §2 <../developer-guide/02-the-context-object.md>).\n\n5. /BIN UTILITIES (CATALOG)\n\nSources: packages/bare-os-coreutils/src/<name>.js. Authoritative sorted list: packages/bare-os-coreutils/lib/commands.mjs (COREUTILS_COMMANDS), consumed by build.mjs.\n\n5.1 FILESYSTEM AND LINKS\n\n> Key idea — mutate the personal tree: chmod, chown, touch, rm, and most writes target personal or HDMS paths; /bin on the system image stays read-only.\n\n| Command | Notes |\n| mkdir | -p / --parents, -m MODE (octal; stored on .bareos_empty; directory lstat shows S_IFDIR with those bits). |\n| rmdir | Empty directories only (marker-aware). |\n| rm | -r/-R/--recursive, -f/--force, -d/--dir (empty directory only), --. |\n| cp | -R/-r/--recursive for trees; -u/--update, -v/--verbose, -p/--preserve (timestamps); -L/-P symlink follow. |\n| mv | Multi-source → directory; recursive directory moves via copy + delete. |\n| ln | Symbolic links only (-s): hard links are not supported on Hyperdrive entries. |\n| stat | -c / --format= with %n %N %s %Y %A %U %G %u %g %F (see source for full set). |\n| readlink | -n; output via console.log (newline behavior may differ from GNU). |\n| basename | -a, -s / suffix operand. |\n| dirname | Multiple paths; -z NUL-terminated output when host process.stdout.write exists. |\n| mkfifo | /run/bare-os/ipc/NAME only; in-memory channel (readFile/writeFile/unlink). |\n| ls | -l -a -1 -t -S -r, --sort= (time, size, none), --format=single-column, --color= (always, never, auto); honors LS_COLORS. One name per line when stdout is captured (pipelines). |\n| dircolors | -p, -b; BARE_OS_DIRCOLORS merges at theme apply. |\n| theme | list, current, set, apply — presets; persists in ~/.barerc. |\n\n5.2 TEXT AND BINARY VIEWING\n\n> Key idea — engines, not forks: sed, awk, and grep run in-process JavaScript; large bodies live in *lib/-engine.js** prepended at build time.\n\n| Command | Notes |\n| cat | -n / -b, -A / -vET, - stdin operand; prefers host process.stdout.write when present (avoids extra log newline). |\n| env | -i / --ignore-environment, NAME=value assignments, then utility via ctx.runBinCommand (temporarily swaps vfs.env / ctx.env). |\n| touch | -a / -m, -d / -r; vfs.writeFile with explicit mtimeMs/ctimeMs (no separate atime). |\n| cut | -d delimiter, -f field list (numeric and ranges). |\n| tr | -d delete set, or set1 set2 mapping (byte/char oriented). |\n| od | Hex-ish dump (fixed width); not full POSIX od flag matrix. |\n| tee | -a append; duplicates stdin to files and stdout. |\n| sed | Large subset — see §6. |\n| awk | Substantial interpreter — see §7. |\n| grep | -F, -i, -v, -w, -x, -n, -c, -l, -o, -m, -r/-R with --include, --exclude, --exclude-dir (glob count capped by BARE_OS_GREP_FILTER_MAX, default 32), -A/-B/-C, --color=never / always / auto, -e, -f, etc.; JS RegExp (not PCRE / full GNU). |\n| base64 | -d/--decode, -w line wrap; decode uses bareOsEmitRaw when console.log would corrupt binary. |\n| base32 | RFC 4648 encode/decode; decode path same raw-output contract as base64. |\n| basenc | --base16 (hex) encode/decode only; other alphabets not implemented. |\n| realpath | -m/--canonicalize-missing; prints vfs.resolveLogical. |\n| sha256sum | GNU-style lines via globalThis.crypto.subtle.digest('SHA-256', …). |\n| sha1sum, sha512sum | Same line format when subtle.digest supports SHA-1 / SHA-512. |\n| md5sum | Bundled lib/md5.js (no Web Crypto MD5). |\n| sum | SysV default or -r BSD 16-bit checksum + 512-byte block counts. |\n| uniq | -c, -d, -u on adjacent lines (sort input first for POSIX-style behavior). |\n| paste | -d delimiter list, -s serial (one files lines joined per output row). |\n| split | -l lines or -b bytes per chunk; output basename + alphabetic suffix; max files BARE_OS_SPLIT_MAX_FILES ( getconf default 10000). |\n| tac, rev | Reverse line order / reverse characters per line. |\n| expand, unexpand | Uniform tab width (-t / -tN); spaces ↔ tabs. |\n| fold | -w fixed column wrap (no word-aware reflow). |\n| fmt | Simple paragraph reflow (-w); blank-line-separated paragraphs. |\n| comm | Two sorted files; columns with -1/-2/-3 suppress. |\n| join | -t, -1, -2 on sorted inputs; relational merge on join field. |\n| pr | Minimal columnate / -n line numbers / -s separator. |\n| yes | Repeated line until BARE_OS_YES_MAX_LINES ( getconf: default 100000); host may pass through from process.env. |\n| shuf | In-memory shuffle; input line cap BARE_OS_SHUF_MAX_LINES (default 50000). Uses Math.random. |\n| factor | Trial division; safe integers. |\n| expr | Integers with *+ - / %, comparisons, string = / !=; not full POSIX expr**. |\n| tsort | Topological sort; exits 1 on cycles. |\n| numfmt | --to=iec (1024) or --to=si (1000) human scales. |\n\n5.2A TTY TEXT EDITOR (EDIT / NANO)\n\n| Command | Notes |\n| edit | Full-screen in-terminal editor over ctx.vfs: multi-line buffer, search / goto / save-as, optional syntax highlighting. Requires stdout.isTTY; exits with a clear error if stdin/stdout is not a TTY. Source: src/edit.js with preamble lib/edit-ansi.js, edit-highlight.js, edit-buffer.js, edit-key-parse.js, edit-tui.js. |\n| nano | Same built artifact as edit (build.mjs maps nano → src/edit.js and the same preamble). /bin/nano is installed for muscle memory; the default shell alias nano → edit (see defaultShellAliases in shell.js) makes nano invoke that binary. man edit and man nano describe flags and keys. |\n\n5.2B HTTP CLIENTS (CURL / WGET)\n\ncurl and wget are booter-delegated CLIs, not coreutils engines. They implement Fetch-based subsets of the familiar tools; the /bin/curl and /bin/wget files on the system image exist for ls /bin / which parity and are stubs if ever executed without delegation.\n\n| Topic | Where |\n| Delegation order, fetch resolution, policy env | Reference — HTTP: curl and wget <../docs/reference/http-curl-and-wget.md> |\n| Flag parity | CLI_PARITY.md <../packages/bare-os-booter/CLI_PARITY.md> |\n| Online help | Chapter 10 — Manpages <10-manpages-and-online-help.md> (man curl, man wget) |\n| Security / allowlists | Developer guide — Security and trust <../developer-guide/09-security-and-trust.md> |\n\n5.3 DISCOVERY AND MEASUREMENT\n\n> Key idea — bounded automation: find -exec, xargs, yes, and shuf carry hard caps so runaway scripts cannot allocate unbounded memory; see getconf -a and environment appendix <../docs/reference/environment-and-posix-appendix.md>.\n\n| Command | Notes |\n| find | -maxdepth, -mindepth, -depth, -name / -iname, -path, -regex (matches full path as a JavaScript regex), -type f/d/l, -empty, -exec / -ok utility … {} … ; (requires ctx.runBinCommand; capped by BARE_OS_FIND_EXEC_MAX, default 64; -ok runs only when BARE_OS_FIND_OK=1), -print0 (uses host process.stdout.write when available). |\n| du | -k for 1024-byte blocks; otherwise 512-byte units; -h human-readable byte totals; -s acknowledged (one total per operand, same as default here). |\n| cksum | POSIX / Open Group CRC + length + name (matches common cksum on BSD/macOS for the same bytes). |\n| printf | Subset of printf(1) conversions (%s, %d, %o, %x, etc.). |\n| logname | Prints LOGNAME / USER / guest. |\n| time | Times ctx.runBinCommand for the rest of the line; prints real to stderr. |\n| tail | -n, -c, + offsets, -f/--follow ( vfs.watch when enabled, else poll; BARE_OS_TAIL_F_POLL_MS, BARE_OS_TAIL_F_MAX_ROUNDS); stdin and multi-file -f not supported. |\n| head | -n, -c, -NUM. |\n| sort | -n, -r, -u, -f, -k / -t, -c / -C (check ordered input), -s (stable), -o FILE (output path; place before operands), - stdin operand; clustered flags (e.g. -nru). |\n| wc | -l, -w, -c (default: all three); - stdin. |\n| date | -u, +FORMAT subset (%Y %m %d %H %M %S %s %z %a %b, %%). |\n| test | -eq/-ne/-lt/-le/-gt/-ge (signed integers), -h/-L, -f/-d/-e, -z/-n, string = / !=. |\n| df | Synthetic 1K-blocks row for Bare (-h human-readable); not real block devices. Optional scale hint from /proc/bare_os_quotas. Use --help for usage (-h is not help). |\n| truncate| -s SIZE absolute length only; pads with zeros when growing. |\n| unlink | Single operand; vfs.unlink. |\n| install | [-m MODE] SOURCE DEST — copy one file and optional chmod. |\n| sync | No-op success (no host flush hook). |\n| dir, vdir | Delegate to ctx.runBinCommand(['ls','-C',…]) / ['ls','-l',…]. |\n| arch | PROCESSOR_ARCHITECTURE, MACHINE, or BARE_OS_ARCH; else unknown. |\n| groups | GROUPS env or primary GROUP. |\n| hostid | Eight hex digits from HOSTID or hash of BARE_OS_SESSION_ID. |\n| nproc | Count processor: lines in /proc/cpuinfo or BARE_OS_NPROC override. --all accepted (same count here). |\n| uptime | /proc/uptime and /proc/loadavg when present. |\n| users, who | Session USER / LOGNAME; who prints a minimal table from env. |\n\n5.4 GETCONF AND XARGS (BARE SUBSETS)\n\n| Command | Behavior |\n| getconf | getconf NAME prints a value from a fixed table (PATH_MAX, _POSIX_VERSION, *BARE_OS_PIPELINE_, BARE_OS_FIND_EXEC_MAX, BARE_OS_YES_MAX_LINES, BARE_OS_SHUF_MAX_LINES, BARE_OS_SPLIT_MAX_FILES, …). getconf -a prints all known names (each name then value on the following line). Unknown names exit 1. Overrides for yes, shuf, split, find -exec, and nproc also honor matching vfs.env** keys when the booter passes them through from the host (see environment variables reference <../docs/reference/environment-and-posix-appendix.md#14-environment-variables-complete-list>). |\n| xargs | Reads bareStdin(ctx); splits on whitespace or -0 null bytes; runs await ctx.runBinCommand([utility, …initial, …batch]) per batch. Flags: -0/--null, -n N/--max-args N (capped), -I repl (substitute in utility argv; implies -n 1 unless -n is set). Hard limits on stdin size, token count, args per run, and invocations per process—see src/xargs.js. |\n\nAll other commands from build.mjs not listed here follow the summaries in Chapter 6 <06-kernel-and-binaries.md> or their *src/.js** files.\n\nExports for tests / tools: splitTokensBySemicolon, splitTokensByAndOr (same module as tokenize).\n\n6. SED IMPLEMENTATION\n\nEngine: packages/bare-os-coreutils/lib/sed-engine.js (prepended before src/sed.js at build time).\n\nCLI: sed supports -n, -E/-r, -z (NUL-separated “lines”; max records BARE_OS_SED_NULL_MAX_RECORDS, default 100000), multiple -e, -f, and operands as files or stdin.\n\nBroadly supported: line addresses (#, $, /re/, ranges, first~step), s/// with common flags (g, p, digit), y///, d/D/p/P/n/N, hold space (h/H/g/G/x), b/t/:label, q, r/w, =, l, a/i/c (backslash forms). r reads paths via a preload scan + vfs.readFile; w appends via vfs.writeFile.\n\nNot guaranteed: full GNU sed extensions, every POSIX corner case (e.g. all s flag combinations, locale collation), or s delimiter edge cases identical to every implementation.\n\n7. AWK IMPLEMENTATION\n\nEngine: packages/bare-os-coreutils/lib/awk-engine.js (prepended before src/awk.js).\n\nCLI: -F, -v name=value (implemented as a synthetic BEGIN assignment), -f, program string, then optional input files (stdin if none).\n\nBroadly supported: BEGIN/END, regex and expression patterns, print/printf with redirection to files, if/while/for/for (i in arr), arrays, next/exit, many builtins (length, substr, index, split, sprintf, sub/gsub, match, int, tolower/toupper, rand/srand), ENVIRON[\"VAR\"], user-defined function.\n\nKnown limitations: / in expressions is always a regex literal in the lexer (division is ambiguous in real awk — use spaces or refactor); getline from files is incomplete; print to files is queued and flushed per statement batch — fine for typical scripts but not identical to every awk I/O timing. Not gawk-compatible for extensions.\n\n8. COREUTILS BUILD: PREAMBLE MAP\n\nbuild.mjs <../packages/bare-os-coreutils/build.mjs> concatenates:\n\n1. lib/runtime.js\n2. Optional extra libs from the preamble map: md5sum → lib/md5.js, sed → lib/sed-engine.js, awk → lib/awk-engine.js, jq → lib/jq-engine.js, man → lib/man-render.js, ls / dircolors → lscolors bundles, edit / nano → *lib/edit-.js** TUI stack\n3. src/<cmd>.js (nano uses src/edit.js)\n\nThere is still no import in *src/.js — large utilities are vendored as plain script chunks in lib/**.\n\n9. WHERE TO READ NEXT\n\n- Chapter 6 — Kernel and /bin summary <06-kernel-and-binaries.md>\n- Chapter 4 — Shell and VFS routing <04-the-booter-runtime.md>\n- Chapter 10 — Manual pages (man) and online help <10-manpages-and-online-help.md>\n- Booter reference §12.612.9 <../docs/reference/package-bare-os-booter.md> and coreutils §12.10 <../docs/reference/package-bare-os-coreutils-and-ci.md#1210-package-bare-os-coreutils> — file-level inventory\n- bare-os-coreutils README <../packages/bare-os-coreutils/README.md> — build and command contract\n\nNext: Chapter 10 — Manual pages <10-manpages-and-online-help.md>\n\nRelated: Kernel extensions <../docs/reference/kernel-extensions.md> · Handbook home <README.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","09","posix","utilities","shell","and","vfs","style","builtins","alignment"],"seeAlso":[{"name":"handbook-10-manpages-and-online-help","section":7},{"name":"handbook-08-git-on-bare-os","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/09-posix-utilities-shell-and-vfs.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"handbook-10-manpages-and-online-help","section":7,"title":"Chapter 10 — Manual pages (man) and online help","synopsis":["man 7 handbook-10-manpages-and-online-help","Handbook chapter (plain text from handbook/10-manpages-and-online-help.md)"],"description":"CHAPTER 10 — MANUAL PAGES (MAN) AND ONLINE HELP\n\nTime to read: about 10 minutes. Prerequisites: Chapter 6 <06-kernel-and-binaries.md> (coreutils build), Chapter 7 <07-operations-and-development.md>.\n\nBare OS ships a man(1)-style viewer backed by a JSON manual database on the system Hyperdrive, not troff, mandoc, or groff. This matches the projects model: utilities are AsyncFunction scripts, and documentation must load without a host typesetter.\n\nPURPOSE\n\n- Familiar UX: Users expect man ls, man -k pattern (apropos), and man -f name (whatis).\n- Shippable: Pages live at /share/man/man.json (staged from kernel/share/man/man.json), merged at build time from *packages/bare-os-coreutils/man/pages/.json**.\n- Verifiable: The build fails if any /bin command from lib/commands.mjs <../packages/bare-os-coreutils/lib/commands.mjs> lacks a page.\n\nSession environment: many boot knobs are *BARE_OS_** variables copied from the host (HTTP policy, IPC token/fan-out, TLS pin list, audit, boot trace, …). The canonical list is in developer-guide §2 — The context object <../developer-guide/02-the-context-object.md> and packages/bare-os-booter/CHANGELOG.md <../packages/bare-os-booter/CHANGELOG.md>.\n\nSECTIONS\n\n| Section | Content |\n| 1 | User commands — every name in COREUTILS_COMMANDS, including man itself. |\n| 1 | bare-os-shell — one manual for all interactive shell builtins (cd, export, …), so we do not maintain dozens of one-line stubs. |\n| 7 | Handbook — every *handbook/.md file (including 00-preface.md, README.md, 01-introduction.md, …) is merged at build time as man(7) (POSIX “miscellaneous”). TOC: man handbook or man 7 bare-os-handbook (alias handbook). Per-file pages use names like handbook-00-preface, handbook-01-introduction, … mermaid** diagrams are omitted in the terminal view; open the Markdown in the repo for figures. |\n| 7 | Developer guide — every *developer-guide/.md file is merged the same way. TOC: man devguide or man 7 bare-os-developer-guide (aliases developer-guide, devguide). Chapters: man devguide-01-two-runtimes-host-vs-image**, … |\n\ngit is not a /bin script (it is delegated in the booter to git-cli.js), but it still has a section 1 page git in the same database.\n\nCLI SURFACE (/BIN/MAN)\n\n| Invocation | Behavior |\n| man | Short usage and pointer to man -l. |\n| man name | Show manual for name (any section if the name is unique, e.g. man ls or man handbook). |\n| man 1 name / man 7 name | Require that section; fails if the page lives in another section (e.g. man 7 ls fails). |\n| man -l | List every page under category headings (/bin, git/shell, handbook, developer guide), then name(section) alphabetically within each group. |\n| man -k word | Apropos: pages whose keywords / title / name match word (substring, case-insensitive). |\n| man -f name | Whatis: one-line name(section) - title for an exact name match. |\n\nEnvironment\n\n| Variable | Effect |\n| MANWIDTH | Wrap width for prose (default 72, minimum 40). |\n\nExit status\n\n| Code | Meaning |\n| 0 | Success (page shown or list empty for man -k with no matches). |\n| 1 | Page not found or man.json missing on the system drive. |\n| 2 | Invalid usage. |\n\nJSON PAGE MODEL\n\nAuthoritative schema: packages/bare-os-coreutils/man/schema.json <../packages/bare-os-coreutils/man/schema.json>.\n\nEach man/pages/<name>.json describes one page:\n\n- name, section, title — NAME header.\n- synopsis — string array (usage lines).\n- description — multi-sentence DESCRIPTION.\n- options — { \"flag\": string, \"meaning\": string }[].\n- environment, files — optional string arrays.\n- exitStatus, diagnostics — optional string arrays.\n- seeAlso — { \"name\": string, \"section\": number }[].\n- bareOsNotes — optional string; POSIX / GNU divergence.\n- keywords — lowercase tokens for man -k.\n- aliases — optional alternate lookup names (e.g. sh-builtins → bare-os-shell).\n- stub — if true, the command is a stub or intentionally limited.\n- examples — optional array of { \"caption\"?: string, \"code\": string } (cheat.shstyle: short label + copy-paste command; code may use newlines for multi-line snippets). Rendered under an EXAMPLES heading after OPTIONS. bare-os-shell builtins may also carry per-builtin examples with the same shape.\n- descriptionMode — \"wrap\" (default) or \"preserve\". Handbook pages use preserve so line breaks and tables stay readable.\n\nman -k also indexes caption text from examples so searches like “clone” can surface git.\n\nThe merged man.json adds schemaVersion, generatedAt, pages, index (name → page index), and apropos (keyword → page indices) for fast lookup.\n\nBUILD PIPELINE\n\n1. npm run build -w bare-os-coreutils runs build.mjs, which calls scripts/build-man-db.mjs.\n2. build-man-db.mjs loads every man/pages/<cmd>.json for COREUTILS_COMMANDS, plus git.json and bare-os-shell.json, then invokes scripts/ingest-handbook-for-man.mjs for handbook chapters.\n3. ingest-handbook-for-man.mjs (see packages/bare-os-coreutils/scripts/ingest-handbook-for-man.mjs <../packages/bare-os-coreutils/scripts/ingest-handbook-for-man.mjs>) reads *handbook/.md, converts Markdown to plain text for the terminal: headings become spaced title lines, list items flatten, inline code/backticks and links are stripped to readable text, fenced blocks indent as literal text except mermaid fences (omitted). Each file becomes one man(7)** page with auto keywords.\n4. build-man-db.mjs validates the merged database, writes kernel/share/man/man.json, and mirrors to packages/bare-os-seeder/kernel/share/man/man.json.\n5. The seeder stages kernel/ recursively; kernel/share/... → /share/... on the system drive (packages/bare-os-seeder/index.js <../packages/bare-os-seeder/index.js>).\n6. /bin/man reads ctx.drive.get('/share/man/man.json'). There is no embedded fallback in v1 — the image must include the merged file.\n\nRELATIONSHIP TO HELP\n\n/bin/help prints a compact one-screen list of builtins and /bin names (including edit and nano)—fast orientation. man is the long-form reference: flags, exit status, EXAMPLES, and merged handbook / developer-guide chapters.\n\nUser story: help when you are exploring; man <cmd> before scripting; man handbook or man 7 handbook-00-preface when you want narrative docs inside the guest.\n\nAuthoring split: change help when builtins or binary names change; change man JSON when command behavior changes; change handbook/ for prose—rebuild coreutils to refresh man(7).\n\nAUTHORING WORKFLOW\n\n1. Narrative docs — edit *handbook/.md or developer-guide/.md*; run a coreutils build so ingest runs.\n2. Per-command pages — add or edit packages/bare-os-coreutils/man/pages/<name>.json.\n3. Run npm run build -w bare-os-coreutils (or node packages/bare-os-coreutils/scripts/build-man-db.mjs).\n4. New /bin commands: add name.json, lib/commands.mjs entry, and src/<name>.js — the build fails until the page exists.\n\nFUTURE WORK\n\n- Interactive PAGER (keypress paging on TTY) beyond PAGER=bare-slice section breaks.\n- man -w is implemented (prints /share/man/man.json); per-page anchor paths remain future work.\n- HTML export for Pear / browser shells.\n- Section 7 overview pages and i18n.\n\nRelated: Chapter 9 <09-posix-utilities-shell-and-vfs.md> · Handbook home <README.md> · CHANGELOG <../packages/bare-os-booter/CHANGELOG.md>\n\n_Experimental research software, not a production OS. Apache-2.0 — LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["handbook","bare-os","documentation","narrative","chapter","10","manpages","and","online","help","manual","pages","man"],"seeAlso":[{"name":"handbook-09-posix-utilities-shell-and-vfs","section":7},{"name":"man","section":1}],"bareOsNotes":"Generated at build time from handbook/10-manpages-and-online-help.md. Diagrams in ```mermaid blocks are omitted; open the Markdown in the repo for figures.","listCategory":"handbook"},{"name":"bare-os-developer-guide","section":7,"title":"Bare OS developer guide — index and reading order","synopsis":["man 7 bare-os-developer-guide","Developer guide chapter (developer-guide/README.md)"],"description":"BARE OS — DEVELOPER GUIDE\n\nWelcome. This guide is the how-to companion for writing software on and for Bare OS: scripts that run inside the replicated system image, utilities under /bin, the session kernel, and—when you need full JavaScript modules—the host Pear packages that implement the booter and seeder.\n\nThe handbook <../handbook/README.md> explains _why_ the system is shaped the way it is (Hyperdrive, two drives, swarm boot). The docs/reference <../docs/reference/README.md> inventory lists _where_ every file lives. This guide focuses on _what you actually type_: entrypoint signatures, the ctx object, why import does not work in drive-resident scripts, and how the coreutils build turns sources into /bin commands.\n\nThis project is experimental research software. APIs described here follow the current code in packages/bare-os-booter and packages/bare-os-coreutils; when in doubt, read the cited paths.\n\nctx API versions: see packages/bare-os-booter/CHANGELOG.md <../packages/bare-os-booter/CHANGELOG.md> for bareOsCtxApiVersion history and booter alignment. TypeScript-oriented authors can reference lib/bare-os-ctx.d.ts <../packages/bare-os-booter/lib/bare-os-ctx.d.ts>.\n\nFeature-bit governance: ADR 001 — Kernel feature bit governance <adr/001-kernel-feature-bits-governance.md>.\n\nWHO THIS IS FOR\n\n- You want to drop a hello.js on your personal drive and run it from the shell without misunderstanding the execution model.\n- You plan to add or change a /bin utility and need the no-import contract and build steps.\n- You are modifying the booter or seeder Pear apps and need to separate “host ESM” from “in-image AsyncFunction.”\n- You are debugging async function run(ctx, argv) or start(ctx) and need a map of ctx.\n\nREADING ORDER\n\n| Chapter | Topic |\n| 01 — Two runtimes: host vs in-image <01-two-runtimes-host-vs-image.md> | Pear/Node packages vs Hyperdrive JS evaluated with AsyncFunction; trust boundaries |\n| 02 — The context object (ctx) <02-the-context-object.md> | vfs, drive, console, identity hooks, execLine, runBinCommand, … |\n| 03 — Kernel: /boot/init.js <03-kernel-boot-init.md> | async function start(ctx); readline loop; calling the shell |\n| 04 — User scripts and PATH resolution <04-user-scripts-and-path.md> | run(ctx, argv), shebangs, *.js in cwd, ./ paths, /bin |\n| 05 — Modules and import <05-modules-and-imports.md> | Why ESM does not apply to in-image scripts; bundling and alternatives |\n| 06 — Extending /bin (coreutils) <06-extending-bin-coreutils.md> | commands.mjs, build.mjs, preamble, man pages |\n| 07 — Apps beyond the shell <07-apps-beyond-the-shell.md> | What an “app” means here; initd, cron, git, custom kernels (overview) |\n| 08 — Testing and debugging <08-testing-and-debugging.md> | npm test, Brittle, Pear dev, common failure modes |\n| 09 — Security and trust <09-security-and-trust.md> | System vs personal drive; eval boundaries |\n| 10 — Glossary and FAQ <10-glossary-and-faq.md> | Quick definitions; frequent questions |\n| 11 — Kernel + Pear cookbook <11-kernel-pear-cookbook.md> | Boot allowlist, timers, socket IPC, vfs.watch, HDMS hooks, Git-in-Pear, release metadata |\n| 12 — Bare modules and Pear ecosystem <12-bare-modules-and-pear-ecosystem.md> | ctx.bare, manifest, drive bundles, Holepunch bare-* mirror vs guaranteed keys |\n\nRELATED DOCS\n\n- Handbook home <../handbook/README.md>\n- Chapter 4 — Booter runtime <../handbook/04-the-booter-runtime.md>\n- Chapter 6 — Kernel and binaries <../handbook/06-kernel-and-binaries.md>\n- Chapter 7 — Operations and development <../handbook/07-operations-and-development.md>\n- Chapter 9 — POSIX utilities and shell <../handbook/09-posix-utilities-shell-and-vfs.md>\n- Chapter 11 — Kernel + Pear cookbook <11-kernel-pear-cookbook.md>\n- Chapter 12 — Bare modules and Pear ecosystem <12-bare-modules-and-pear-ecosystem.md>\n- bare-os-coreutils README <../packages/bare-os-coreutils/README.md>\n- bare-os-booter README <../packages/bare-os-booter/README.md>\n\n_License: Apache-2.0 — see LICENSE <../LICENSE>._","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","bare","os","index","and","reading","order"],"seeAlso":[{"name":"devguide-01-two-runtimes-host-vs-image","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/README.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","aliases":["developer-guide","devguide"],"listCategory":"devguide"},{"name":"devguide-01-two-runtimes-host-vs-image","section":7,"title":"Chapter 1 — Two runtimes: host (Pear/Node) vs in-image (AsyncFunction)","synopsis":["man 7 devguide-01-two-runtimes-host-vs-image","Developer guide chapter (developer-guide/01-two-runtimes-host-vs-image.md)"],"description":"CHAPTER 1 — TWO RUNTIMES: HOST (PEAR/NODE) VS IN-IMAGE (ASYNCFUNCTION)\n\nIf you only remember one thing from this guide, remember this: Bare OS runs two different kinds of JavaScript, and they follow different rules.\n\nTHE CONFUSION IN ONE SENTENCE\n\nYou might paste a file into your home directory on the personal Hyperdrive that starts with import fs from 'node:fs' and expect it to run like a Node script. It will not. That file is loaded as a string and executed with the JavaScript AsyncFunction constructor—not as an ES module. There is no module graph, no import resolution, and no automatic node_modules on the drive.\n\nThe booter and seeder Pear packages, by contrast, are normal ESM projects: they use import, npm dependencies, and Pear bundling. They run on the host and _host_ the environment that evaluates in-image code.\n\nWhen the bare-os npm module is available on that host, the booter may attach a read-only ctx.bareOsHostStats snapshot (loadavg, cpus, networkInterfaces, …)—still not a general “run Node in the image” escape hatch; see Chapter 2 <02-the-context-object.md>.\n\nMENTAL MODEL: WHO LOADS WHOM\n\n- Host code lives under packages/bare-os-booter/, packages/bare-os-seeder/, etc. It is trusted in the sense that you built or installed it; it opens Corestore, Hyperswarm, Hyperdrive, and constructs ctx.\n- In-image code is bytes on a drive (/boot/init.js, /bin/cat, ~/mytool.js). The booter reads those bytes as UTF-8 strings and passes them to new AsyncFunction(...) (see kernel-runner.js <../packages/bare-os-booter/lib/kernel-runner.js>).\n\nIN-IMAGE EXECUTION (THE ASYNCFUNCTION CONTRACT)\n\nTwo entry shapes matter:\n\n| Entry | Where it lives | Parameters | How it is invoked |\n| async function start(ctx) | /boot/init.js on the system drive | ctx | runKernelFromSource wraps the source and calls start(ctx) |\n| async function run(ctx, argv) (optional for user scripts) | /bin/ always; or a .js file resolved from the shell | ctx, argv (string array) | runScriptFromSource runs the file body, then awaits run(ctx, argv) if defined |\n\nThe booter injects ctx and argv. Kernel start is required; for shell scripts, top-level statements may stand alone, or you may define run like /bin utilities. Top-level import is invalid in that evaluated string because the engine is not loading an ES module—it is compiling a function body.\n\nShebang lines (#!/usr/bin/env bare) are stripped before compile (stripShebang <../packages/bare-os-booter/lib/kernel-runner.js>) so the first token the parser sees is valid JavaScript.\n\nHOST EXECUTION (PEAR / NODE PACKAGES)\n\nWhen you edit packages/bare-os-booter/index.js, you are writing normal JavaScript for Node or Bare under Pear:\n\n- Use import Hyperdrive from 'hyperdrive'.\n- Add dependencies in package.json.\n- Use async I/O against real host APIs.\n\nWeb Encoding globals: some Bare/Pear builds do not define global TextEncoder / TextDecoder. Booter and in-image code should use b4a for UTF-8 instead (e.g. b4a.from(str, 'utf8'), b4a.toString(buf, 'utf8')), matching curl-cli.js <../packages/bare-os-booter/lib/curl-cli.js>. Relying on new TextEncoder() in booter lib/*.js can break at runtime (for example when statting or reading pseudo files under /proc or /sys).\n\nThis code creates ctx and passes it into the kernel. It does not run inside the simulated /bin environment unless you explicitly call runBinCommand(ctx, argv) with the same ctx the shell uses.\n\nTRUST: SYSTEM DRIVE VS PERSONAL DRIVE\n\n- The system drive is the replicated OS image: /boot, /bin, /etc, /share. You should treat its contents as integrity-checked by replication from peers you chose to trust (same discovery key / topic as the rest of the project).\n- The personal drive holds $HOME, /.bare, user files, crontab, etc. It is writable by the session. User scripts you write live here by default.\n\nA script you place in ~/exploit.js is your code; the booter will still AsyncFunction-evaluate it with full ctx power. That is convenient and dangerous—see Chapter 9 <09-security-and-trust.md>.\n\nWHEN TO USE WHICH RUNTIME\n\n| Goal | Use |\n| Add a new /bin command shipped with the OS image | In-image pattern: coreutils src/*.js + build (Chapter 6) |\n| One-off automation in your home directory | In-image script (top-level and/or optional run); no import (Chapters 45) |\n| Change how networking, HDMS, or the REPL works | Host booter package (ESM) |\n| Publish or replicate the system image | Host seeder package |\n\nSEE ALSO\n\n- Chapter 2 — The context object <02-the-context-object.md>\n- Handbook — Booter runtime <../handbook/04-the-booter-runtime.md>\n- Handbook — Kernel and binaries <../handbook/06-kernel-and-binaries.md>\n\n← Developer guide home <README.md> · Context object → <02-the-context-object.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","01","two","runtimes","host","vs","image","chapter","pear","node"],"seeAlso":[{"name":"devguide-02-the-context-object","section":7},{"name":"bare-os-developer-guide","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/01-two-runtimes-host-vs-image.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-02-the-context-object","section":7,"title":"Chapter 2 — The context object (ctx)","synopsis":["man 7 devguide-02-the-context-object","Developer guide chapter (developer-guide/02-the-context-object.md)"],"description":"CHAPTER 2 — THE CONTEXT OBJECT (CTX)\n\nEvery in-image entrypoint—start(ctx) for the kernel or run(ctx, argv) for commands—receives a single ctx object assembled by the booter before runKernelFromSource or runScriptFromSource runs. This chapter maps the fields you can rely on, how they behave, and where they are defined in source.\n\nAuthoritative construction happens in packages/bare-os-booter/index.js <../packages/bare-os-booter/index.js> inside executeKernel, then a few fields are replaced or augmented when the REPL session is created (readLine, console, execLine, writeScreen).\n\nDESIGN GOAL\n\nctx is the narrow interface between:\n\n- the host (Hyperdrive handles, swarm, identity, stdio adapters), and\n- unprivileged-looking session code (kernel loop, /bin utilities, user scripts).\n\nIt is intentionally not a full Node process object. Think of it as the “syscall table” for Bare OS userland.\n\nSTABLE FIELDS (TYPICAL SESSION)\n\nThe following are set on ctx before the kernel starts (unless noted as overwritten later):\n\n| Field | Role |\n| bareOsCtxApiVersion | String semver for the documented ctx contract (e.g. 1.10.0). Bump in bare-os-ctx-api.js <../packages/bare-os-booter/lib/bare-os-ctx-api.js> when you make breaking changes to stable fields. |\n| bareOsRuntimeCaps | Frozen snapshot from bare-os-runtime-caps.js <../packages/bare-os-booter/lib/bare-os-runtime-caps.js>: ctxApiVersion, simulated pipeline limits, pseudoFsPaths, and features (including jobControl, shellHereString, bootReadyPseudoFs, vfsChown, auditLog, initdRequiresWants, seederRpcExtended, bareCtxModules, bareDriveBundles, …). |\n| bareOsPublishBootReady(patch) | Kernel-only: merge patch into the session boot-ready state exposed as /run/bare-os/boot.json and /run/bare-os/ready. The booter pre-seeds imageDigest, pearChannel, pearRelease from host env when set (see BARE_OS_IMAGE_DIGEST, BARE_OS_PEAR_CHANNEL, BARE_OS_PEAR_RELEASE, PEAR_CHANNEL). |\n| bareOsSessionStats | Mutable { execLineCount, pipelineBytesTotal } mirrored in /proc/bare_os_session_stats. |\n| bareOsBootStartedMs | Epoch milliseconds when the booter started building the session (used for synthetic /proc/uptime). |\n| bareOsSkipRepl | true when BARE_OS_SKIP_REPL=1 (non-interactive stdin); kernels may shorten banners. |\n| bareOsAdvertisedKernelBits / bareOsSeedCapabilityBits | Unsigned bitmasks: effective stock features (minus env-disabled bits such as crypto urandom) and last seed bare_os.capabilities bits, if any. |\n| bareOsSystemRevision | Frozen { currentId, pendingId, slot } from host env (*BARE_OS_SYSTEM_REVISION_**) for Pear-style OTA hints. |\n| bareOsRegisterSuspendHook / bareOsRegisterResumeHook | Register callbacks; bareOsInvokeSuspendHooks / bareOsInvokeResumeHooks run them (host may call around Bare.suspend / Bare.wakeup). |\n| bareOsRequestKernelReload() | Throws BARE_OS_KERNEL_RELOAD when BARE_OS_KERNEL_HOT_RELOAD=1 so the booter re-reads /boot/init.js. |\n| bareOsRunImageScript(path) | async — runs trusted JS from the system image; paths must be under /lib/bare-os/extensions/ (used by kernel.ext.d). |\n| disk | Disk bundle used during boot (includes drives and helpers); advanced use |\n| drive | System Hyperdrive (ctx.drive is the OS image: /bin, /boot, …) |\n| personalDrive | Personal Hyperdrive (mutable per-user state; VFS maps $HOME to /.bare-os/home/<HOME-basename>/… and session /var/log to /.bare-os/var/log/<basename>/… so guest vs unlocked trees do not share the same keys) |\n| vfs | Path layer: resolves logical paths, routes to system vs personal drive, implements mkdir, readFile, etc. See vfs.js <../packages/bare-os-booter/lib/vfs.js> |\n| env | Shell environment object (HOME, PATH, USER, …), same object as vfs.env. Mutated by builtins (export, cd updates PWD, identity unlock updates user fields). After each execLine, BARE_OS_EXIT_STATUS holds the last commands exit code as a decimal string (POSIX $? parity); use $? or ${?} in shell words for expansion. |\n| b4a | b4a module (byte helpers); used to convert Hyperdrive buffers to strings |\n| bare _(optional)_ | Frozen map of host-loaded (and optionally drive-bundled) npm modules for in-image use (ctx.bare.b4a, ctx.bare.protomux, …). Absent when BARE_OS_BARE_MODULES=0. See bare-module-manifest.json <../packages/bare-os-booter/lib/bare-module-manifest.json> and Chapter 12 <12-bare-modules-and-pear-ecosystem.md>. |\n| topic | Topic key helper from protocol package (rarely needed in user scripts) |\n| console | Initially the raw global; replaced with session-bound log/error that respect the REPL and fish-style UI |\n| readLine | Placeholder async function; replaced with session readLine(prompt) that reads a line from stdin (or returns null when session ends) |\n| writeScreen | REPL helper for screen-oriented output; starts as no-op, then wired |\n| runHdms(argv) | Entry for hdms CLI when HDMS controller is active |\n| onIdentityUnlocked / onIdentityGuest | Hooks for HDMS lifecycle (bootstrap nodes, teardown) |\n| requestBooterExit(code) | Ends the session from /bin/exit or equivalent |\n| applyUnlock / applyRegister / applyLogin / applyLogout / saveVault | Identity and vault operations used by login, logout, savevault |\n| shellAliases | Populated when the shell loads default or ~/.barerc aliases |\n| bareOsApplyTheme() / bareOsListThemes() | Re-apply BARE_OS_THEME / LS_COLORS / BARE_OS_DIRCOLORS to vfs.env (including BARE_OS_COLOR_DEPTH downgrades for *BARE_OS_COLOR_). Used by /bin/theme** and documented for custom tooling (see bare-os-theme-presets.js <../packages/bare-os-booter/lib/bare-os-theme-presets.js>). |\n| runBinCommand(argv) | Runs a command with the same resolution rules as the interactive shell (used by time, xargs, and similar) |\n| registerKernelShutdownHook(fn) | Register an async or sync function to run when the REPL session ends, before stopBareInitd and initd disposers. Pair with registerBareInitdDisposer(fn) in bare-initd.js <../packages/bare-os-booter/lib/bare-initd.js> when you need teardown after shutdown hooks but still inside stopBareInitd (intervals, sync cleanup). |\n| bareOsSubscribeBootEvent(fn) / bareOsEmitBootEvent(ev) | Subscribe to or emit structured boot lifecycle events (same shape as BARE_OS_BOOT_TRACE=ndjson records). |\n| bareOsSubscribeHdmsLifecycle(fn) | After HDMS activate / before deactivate, run callbacks with { kind, labels? }. |\n| bareOsAwaitInitdUnits(names, timeoutMs) | Resolves when all listed initd units are active (polls getBareServiceRuntime); returns false on timeout. |\n| bareOsGetResourceStatus() | Returns a plain object snapshot (pipeline limits, exec depth, IPC stats(), session counters, swarm peer count)—mirrors /proc/bare_os_resources. |\n| bareOsRegisterVirtualFile(name, reader, opts?) | Registers /run/bare-os/virtual/<name> content; reader may be a function or { read }; may return string or Uint8Array (sync or async). Optional opts: etag, mime (default text/plain), ttlMs (optional cache hint). Gated by runtime cap virtualRegisterFiles. |\n| bareOsSandboxRunScript(source, argv?, opts?) | Runs script source with a restricted ctx (personal-drive writes only; identity/virtual registration disabled). Respects raceWithAbortAndTimeout opts. Disable with BARE_OS_SANDBOX_SCRIPT=0. See Chapter 9 <09-security-and-trust.md>. |\n| bareOsBootFileSha256Hex(buf) | sha256 hex for boot manifest checks (BARE_OS_BOOT_MANIFEST + /etc/bare-os/boot.manifest.json on the stock kernel). |\n| bareOsRegisterBootPhaseHook(phase, fn) / bareOsInvokeBootPhaseHooks(ev) | Hooks around stock kernel/init.js phases; ev includes phase, when (before / after), label. phase may be * or before:rc style. |\n| bareOsInvalidateVirtualFile(name) / bareOsUpdateVirtualFileMeta(name, patch) | Virtual files under /run/bare-os/virtual/; patch may update etag / version. |\n| bareOsRequestPearReload(opts?) | async — returns { requested, hint, env }; with { persistRequest: true } writes ~/.bare-os/pear-reload.request and may process.emit('bare-os:pear-reload', …) on Node. |\n| bareOsVerifyBootManifestSignature(manifestBytes, signatureBytes, publicKeyHex?) | Ed25519 verify helper used when BARE_OS_BOOT_MANIFEST_SIGN=1; public key from arg or BARE_OS_BOOT_MANIFEST_PUBKEY_HEX. |\n| bareOsRequestMirror(opts?) / bareOsExportPersonalSnapshot(opts?) | async host bridges returning { ok, hint }; on Node emit bare-os:mirror-request / bare-os:export-personal-snapshot. |\n| bareOsPearIpcEmit(channel, payload) | boolean — forwards structured payload to the host when registered (bare-os:pear-ipc on Node). Align channel names with your pear-ipc <https://github.com/holepunchto/pear-ipc> consumer. |\n| bareOsHostStats _(optional)_ | When the bare-os npm module loads on the host, a frozen snapshot: hostname, loadavg, cpus, networkInterfaces, optional memoryUsage, peerCount (swarm peers during session build), atMs. |\n| httpFetch _(optional)_ | When the booter can build a policy-wrapped fetch, it sets this field; delegated curl / wget prefer resolveBareOsFetchFn, which uses ctx.httpFetch first, then ctx.bare.fetch (including /lib/bare/bundles merge, with .default unwrap), then globalThis.fetch. On hosts without native fetch, ensureBareFetchGlobals may install bare-fetch or bare-https. Optional HTTP allow/deny (BARE_OS_HTTP_ALLOWLIST, BARE_OS_HTTP_DENYLIST) and audit hooks when BARE_OS_AUDIT is on. See HTTP: curl and wget <../docs/reference/http-curl-and-wget.md>. |\n\nKernel boot composition lives on the system image (/boot/init.js, /etc/bare-os/rc, /etc/bare-os/rc.d/, optional /etc/bare-os/rc.local, optional /etc/bare-os/kernel.d/ (same digit-prefix rules as rc.d), optional /etc/bare-os/profile / *rc.profile., /etc/bare-os/onboot), not on ctx—extend the image or hooks like registerKernelShutdownHook rather than adding boot fields to the context object. The booter seeds ctx.env from the host for BARE_OS_PIPELINE_, BARE_OS_SHELL_STREAMING, BARE_OS_SHELL_STREAMING_MULT, BARE_OS_SHELL_CMDSUBST, BARE_OS_SHELL_CMDSUBST_MAX_BYTES, boot profile / audit / IPC / HTTP policy keys (BARE_OS_IPC_CHANNEL_MAX_BYTES, …), BARE_OS_VFS_WATCH, BARE_OS_VFS_UNION_PREFIXES, BARE_OS_VFS_UNION_WRITE_DENY, BARE_OS_VFS_BIN_CACHE, BARE_OS_IMAGE_DIGEST, Pear channel fields, BARE_OS_BOOT_MANIFEST, BARE_OS_BOOT_MANIFEST_SIGN, BARE_OS_BOOT_MANIFEST_PUBKEY_HEX, BARE_OS_BOOT_POLICY, BARE_OS_SANDBOX_SCRIPT, BARE_OS_SANDBOX_WORKER, BARE_OS_INITD_MAX_PARALLEL, BARE_OS_INITD_JOURNAL_MAX_LINES, BARE_OS_URANDOM_CRYPTO, BARE_OS_TELEMETRY_NDJSON, BARE_OS_SEED_RPC_HANDSHAKE, BARE_OS_SEED_CAP_STRICT, BARE_OS_SEED_CAP_FAIL, BARE_OS_BLIND_BOOTSTRAP_URL, BARE_OS_BLIND_BOOTSTRAP_JSON, BARE_OS_MIRROR_READ_KEY, BARE_OS_FIND_EXEC_MAX, BARE_OS_YES_MAX_LINES, BARE_OS_SHUF_MAX_LINES, BARE_OS_SPLIT_MAX_FILES, BARE_OS_NPROC, TERM, COLORTERM, PEAR_CHANNEL, and the rest of the passthrough table in environment appendix §14 <../docs/reference/environment-and-posix-appendix.md#14-environment-variables-complete-list>; always sets BARE_OS_BOOT_PROFILE_RESOLVED and BARE_OS_SESSION_ID. When ctx.httpFetch handles curl, check optional init.bareOsCurlTls (insecure, caPem, pinnedSha256) for --cacert / -k* semantics.\n\nAfter createVfs <../packages/bare-os-booter/lib/vfs.js>, ctx.vfs.watch(logicalPath) returns a Hyperdrive watcher when BARE_OS_VFS_WATCH is not disabled. ctx.bareOsIpc exposes FIFO push/take (optional per-channel byte caps from BARE_OS_IPC_CHANNEL_MAX_BYTES), optional JSON-RPC pushJson/takeJson (max line size, optional RPC token), fanoutPublish/fanoutSubscribe, createDuplexBridge, duplexJsonRoundTrip (one JSON request / one JSON reply over a duplex side — useful for unit-to-unit or guesthelper protocols without pulling bare-rpc into /bin), and stats (see bare-os-ipc.js <../packages/bare-os-booter/lib/bare-os-ipc.js>).\n\nInitd / long-running services: prefer duplexJsonRoundTrip or pushJson/takeJson for structured messages with byte limits already enforced by IPC options. A dedicated bare-rpc dependency is optional on the host or in ctx.bare if you need richer framing; the stock image documents the FIFO-level building blocks only.\n\nAfter createKernelReplSession <../packages/bare-os-booter/lib/repl-session.js> returns:\n\n- ctx.execLine(line, opts?) runs a full shell line (tokenize, builtins, pipelines, /bin resolution). Optional opts: { signal?: AbortSignal, timeoutMs?: number } (deadline for the shell pipeline work).\n- ctx.readLine(prompt, opts?) prompts and reads user input; same optional opts for abort/timeout.\n- ctx.runBinCommand(argv, opts?) passes through abort/timeout to the delegated command runner.\n- ctx.vfs.readFile(path, opts?) and ctx.vfs.writeFile(path, buf, opts?) accept signal/timeoutMs in opts (writeFile merges with executable).\n- ctx.console is session-scoped.\n\n/run/bare-os/boot.json (via bareOsPublishBootReady) may include booterPhases: booter milestones (vfs, ctx, repl, initd, kernel_invoke) in addition to kernel phases from the stock kernel/init.js <../kernel/init.js>.\n\nFIELDS INTRODUCED DURING COMMAND EXECUTION\n\nWhen the shell runs an external command (or a pipeline stage), it may pass a shallow clone of ctx with extra fields:\n\n| Field | When |\n| shellStdin | String body for simulated stdin (pipelines and < redirection) |\n| bareOsStdoutCaptured| true when this commands stdout is captured into the simulated pipe or a > / >> redirect (see bareOsPipelineChildCtx in shell.js <../packages/bare-os-booter/lib/shell.js>). ls uses this to print one name per line, matching common GNU behavior for non-terminal output. |\n| exitCode | Utilities set ctx.exitCode for conditions (test, grep, …); the shell uses it for &&, logical OR lists, and ; sequencing (see shell.js <../packages/bare-os-booter/lib/shell.js>) |\n\nAlways use the ctx passed into run, not a global, so pipeline stdin works.\n\nWHAT IS _NOT_ ON CTX\n\n- No require, no import helper—the in-image script is not a CommonJS or ESM module.\n- No automatic fetch guarantee—depends on host/Pear globals; do not rely on it for portable /bin utilities.\n- process may exist on Bare/Node hosts but do not depend on it for utilities meant to run identically under Pear; use ctx.console and ctx.env.\n- bare-initd control is not a ctx method: use /bin/systemctl (or journalctl; bare-initctl is a legacy alias), which the booter handles via delegation—same pattern as git / curl.\n\nMINIMAL PATTERNS\n\nLog a message\n\n async function run(ctx, argv) {\n ctx.console.log('argv:', argv.join(' '))\n }\n\nRead a file via VFS\n\n async function run(ctx, argv) {\n const buf = await ctx.vfs.readFile(argv[1] || 'README.md')\n if (!buf) {\n ctx.console.error('missing file')\n return\n }\n ctx.console.log(ctx.b4a.toString(buf))\n }\n\nRun another command programmatically\n\n async function run(ctx, argv) {\n await ctx.runBinCommand(['ls', '-la', ctx.env.HOME || '.'])\n }\n\nSEE ALSO\n\n- Chapter 3 — Kernel <03-kernel-boot-init.md>\n- Chapter 4 — User scripts <04-user-scripts-and-path.md>\n- Handbook — Identity and vault <../handbook/05-identity-vault-and-hdms.md>\n\n← Two runtimes <01-two-runtimes-host-vs-image.md> · Kernel → <03-kernel-boot-init.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","02","the","context","object","chapter"],"seeAlso":[{"name":"devguide-03-kernel-boot-init","section":7},{"name":"devguide-01-two-runtimes-host-vs-image","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/02-the-context-object.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-03-kernel-boot-init","section":7,"title":"Chapter 3 — Kernel: /boot/init.js and start(ctx)","synopsis":["man 7 devguide-03-kernel-boot-init","Developer guide chapter (developer-guide/03-kernel-boot-init.md)"],"description":"CHAPTER 3 — KERNEL: /BOOT/INIT.JS AND START(CTX)\n\nThe kernel in Bare OS is not a microkernel and not a scheduler. It is a JavaScript file on the system Hyperdrive at /boot/init.js, loaded as UTF-8 text and executed with runKernelFromSource in kernel-runner.js <../packages/bare-os-booter/lib/kernel-runner.js>. The booter expects a top-level:\n\n async function start(ctx) {\n // ...\n }\n\nThere is no argv at the kernel layer—the sessions command line is whatever the interactive user types after boot, handled through ctx.readLine and ctx.execLine.\n\nWHAT THE STOCK KERNEL DOES\n\nThe repositorys default kernel (kernel/init.js <../kernel/init.js>) is intentionally small:\n\n1. Print /etc/os-release and optional /etc/motd (errors logged, not fatal).\n2. Optional profile snippet /etc/bare-os/rc.profile.<name> when BARE_OS_BOOT_PROFILE or the first line of /etc/bare-os/profile names a safe profile string.\n3. Run /etc/bare-os/rc, then sorted digit-prefixed */etc/bare-os/rc.d/, then optional /etc/bare-os/rc.local, then sorted digit-prefixed /etc/bare-os/kernel.d/ (same naming rules as rc.d), then optional /etc/bare-os/kernel.ext.d/.json** extension lists (see Handbook ch.6 <../handbook/06-kernel-and-binaries.md>).\n4. Print session banner (from /etc/bare-os/banner, /etc/issue, or a built-in hint).\n5. If ctx.bareOsSkipRepl: run every non-empty, non-# line from BARE_OS_ONBOOT (newline-separated), or if that env is unset, the same from /etc/bare-os/onboot in file order, via execLine; then fall through to the loop (where readLine returns null immediately).\n6. Loop forever:\n- line = await ctx.readLine('')\n- If line == null, break (session end / EOF).\n- Skip empty lines.\n- status = await ctx.execLine(line) inside try/catch (console.error on failure).\n- If status === 'exit', break.\n\nSet BARE_OS_BOOT_TRACE=1 (or true) in the environment to log boot phase timings on stderr as [boot] phase: Nms. Use BARE_OS_BOOT_TRACE=json for one JSON object per phase ({\"phase\":\"…\",\"ms\":n}) on stderr. The same phases are also delivered to ctx.bareOsSubscribeBootEvent subscribers as NDJSON-shaped objects. The booter emits additional *booter: phases (vfs, ctx, repl, initd, kernel_invoke) and records them under booterPhases in /run/bare-os/boot.json. BARE_OS_BOOT_ALLOWLIST=1 with /etc/bare-os/boot.allow restricts the first token of lines in trusted rc/onboot snippets. Inspect ctx.bareOsRuntimeCaps for pipeline limits, quotas, pseudo paths, and features (including httpDelegate, gitDelegate, systemctlDelegate, vfsWatch, ipcFanout**).\n\nOptional BARE_OS_KERNEL_SELFTEST=1 runs built-in checks after boot snippets (add BARE_OS_SELFTEST_FORMAT=tap for CI). You can pass { signal, timeoutMs } as a second argument to ctx.execLine, ctx.readLine, ctx.runBinCommand, and VFS readFile/writeFile for bounded waits—see Chapter 2 <02-the-context-object.md>.\n\nSo the “OS personality” is mostly the shell (execShellLine behind execLine) plus /bin.\n\nWHY READLINE USES AN EMPTY PROMPT STRING\n\nThe stock kernel passes '' as the prompt. The actual prompt rendering (fish-style or plain) is owned by the REPL session implementation in repl-session.js <../packages/bare-os-booter/lib/repl-session.js>. If you build a custom kernel, you can pass a different prompt string, but many sessions ignore it in favor of their own UI.\n\nUSING EXECLINE VS CALLING RUNBINCOMMAND DIRECTLY\n\n| API | Behavior |\n| await ctx.execLine('ls -la') | Full shell semantics: tokenization, aliases, builtins (cd, export, …), ; / && / logical-OR lists, pipelines, redirections, then /bin |\n| await ctx.runBinCommand(['ls', '-la']) | Direct utility invocation—no shell parsing, no aliases |\n\nUse execLine when you want users to type natural shell commands from your kernel loop. Use runBinCommand when you already have an argv array and want to avoid re-parsing.\n\nSESSION TERMINATION\n\n- The exit builtin (or /bin/exit) ultimately calls ctx.requestBooterExit(code), which forces readLine to return null on subsequent calls and ends the loop.\n- BARE_OS_SKIP_REPL=1 makes readLine return null immediately—useful for non-interactive smoke tests. Pair with BARE_OS_ONBOOT (one or more newline-separated lines) or /etc/bare-os/onboot so the stock kernel runs trusted execLine snippets before idle exit.\n\nCUSTOM KERNELS: PRACTICAL TIPS\n\n1. Keep the loop async—never block on synchronous host APIs that might hang the Pear app.\n2. Catch errors around execLine so a typo does not tear down the whole session unless you want that.\n3. Do not assume import—the kernel source is the same AsyncFunction model as /bin (Chapter 1).\n4. To add startup services, prefer hooks already wired in the booter (startBareInitd) or a small kernel that calls runBinCommand after banner—see Chapter 7 <07-apps-beyond-the-shell.md>.\n5. To run code when the session ends, use ctx.registerKernelShutdownHook(fn) (runs before initd disposers); see Chapter 2 — ctx <02-the-context-object.md>.\n6. After login, ~/.barerc is reloaded automatically via applyUnlockedEnv—see Handbook — Identity <../handbook/05-identity-vault-and-hdms.md>. The stock init.js does not re-print the boot banner; use onIdentityUnlocked or a custom kernel loop if you want that.\n\nREPLACING THE KERNEL IN THE IMAGE\n\nKernel text is staged from the repos kernel/ tree when you run the seeder (or copied into packages/bare-os-seeder/kernel/ for Pear). After editing kernel/init.js, re-seed or rebuild the vendored tree so peers receive the new /boot/init.js.\n\nSEE ALSO\n\n- Chapter 2 — ctx <02-the-context-object.md>\n- Chapter 4 — User scripts <04-user-scripts-and-path.md>\n- Handbook — Kernel and binaries <../handbook/06-kernel-and-binaries.md>\n\n← Context object <02-the-context-object.md> · User scripts → <04-user-scripts-and-path.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","03","kernel","boot","init","chapter","and","start"],"seeAlso":[{"name":"devguide-04-user-scripts-and-path","section":7},{"name":"devguide-02-the-context-object","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/03-kernel-boot-init.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-04-user-scripts-and-path","section":7,"title":"Chapter 4 — User scripts and PATH resolution","synopsis":["man 7 devguide-04-user-scripts-and-path","Developer guide chapter (developer-guide/04-user-scripts-and-path.md)"],"description":"CHAPTER 4 — USER SCRIPTS AND PATH RESOLUTION\n\nThis chapter is the practical “how do I run my own .js file?” guide. Resolution logic lives in runBinCommand in kernel-runner.js <../packages/bare-os-booter/lib/kernel-runner.js>; the shell calls that function for non-builtin commands.\n\nTHE ENTRYPOINT CONTRACT (AGAIN)\n\nThe booter evaluates your file as the body of an async function with parameters ctx and argv. Top-level statements run first (like a small Node script). Optionally, define a top-level run for the same contract as /bin utilities:\n\n async function run(ctx, argv) {\n // argv[0] is conventionally the script name or command word\n }\n\nThe booter wraps the file body in:\n\n new AsyncFunction(\n 'ctx',\n 'argv',\n source + '\\nif (typeof run === \"function\") await run(ctx, argv)\\n'\n )\n\nIf run exists, it is awaited after the rest of the file. /bin commands always define run; home-directory scripts may use top-level code only (e.g. console.log(...)).\n\nRESOLUTION ORDER (SIMPLIFIED)\n\nWhen the user types a command, roughly:\n\n1. Git delegation — If the command is git (and not ./git), the booter runs the hosted git CLI instead of /bin/git bytes.\n2. Path with slash — If argv[0] contains /, treat as a path: resolve via ctx.vfs, read bytes from the routed drive, evaluate as script.\n3. Ends with .js — Resolve cmd as a logical path (e.g. foo.js in $PWD), read from VFS if found, evaluate.\n4. PATH search — For each directory in $PATH (default /bin), try unixPathResolve(dir, cmd) on the system drive only; first hit wins.\n\nImplications:\n\n- ./my.js and /home/user/my.js use VFS (personal or system as appropriate).\n- hello.js in the current directory is tried before /bin if the file exists on the routed drive.\n- ls resolves to /bin/ls on the system drive (unless shadowed by a same-named *.js in cwd—know this edge case).\n\nSHEBANG\n\nA leading line like #!/usr/bin/env bare is stripped before compilation. It is for human readers and future tooling; the booter does not exec a binary interpreter—it always uses AsyncFunction.\n\nSTDIN IN PIPELINES\n\nThe shell does not give your script a POSIX fd 0. For pipeline stages, stdin is simulated: the shell captures console.log output from the left stage as a string and passes ctx.shellStdin on a cloned ctx to the right stage. Utilities that want stdin read bareStdin(ctx) from the coreutils prelude—but user scripts on the home drive do not get that prelude unless you copy the helper into your file.\n\nMinimal stdin read in a user script:\n\n async function run(ctx, argv) {\n const stdin = typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''\n ctx.console.log('got bytes:', stdin.length)\n }\n\nENVIRONMENT AND CD\n\n- ctx.env is the same object mutated by export and cd (via vfs.chdir and PWD).\n- Paths like ~/doc are expanded by the VFS when you use vfs.readFile and friends—prefer ctx.vfs over raw drive access for user-level scripts.\n\nGIT AND SPECIAL CASES\n\n- Prefer the git command for version control; it is not the same as evaluating /bin/git as JS.\n- command -v / type use resolveBinInPath (system drive PATH only) plus builtin tables.\n\nDEBUGGING “NOT FOUND”\n\n1. unknown command: foo — Not in PATH on system drive and not a resolvable *.js / path.\n2. not found: ./foo.js — VFS could not read the path (typo, wrong drive, or missing file).\n3. Silent failure with stack in console.error — Runtime error inside run; fix the script logic.\n\nSEE ALSO\n\n- Chapter 5 — Modules <05-modules-and-imports.md>\n- Chapter 6 — Extending /bin <06-extending-bin-coreutils.md>\n- Handbook — POSIX utilities <../handbook/09-posix-utilities-shell-and-vfs.md>\n\n← Kernel <03-kernel-boot-init.md> · Modules → <05-modules-and-imports.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","04","user","scripts","and","path","chapter","resolution"],"seeAlso":[{"name":"devguide-05-modules-and-imports","section":7},{"name":"devguide-03-kernel-boot-init","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/04-user-scripts-and-path.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-05-modules-and-imports","section":7,"title":"Chapter 5 — Modules, import, and packaging (the honest version)","synopsis":["man 7 devguide-05-modules-and-imports","Developer guide chapter (developer-guide/05-modules-and-imports.md)"],"description":"CHAPTER 5 — MODULES, IMPORT, AND PACKAGING (THE HONEST VERSION)\n\nThis chapter answers the most common disappointment: “Why cant I use import in my Bare OS script?”\n\nSHORT ANSWER\n\nIn-image scripts (/boot/init.js, /bin/*, ~/tool.js) are executed as AsyncFunction bodies, not as ES modules. The JavaScript engine never runs the ESM loader for those strings. Therefore:\n\n- import x from 'y' is a syntax error in that context (top-level import is only valid in modules).\n- require is likewise unavailable unless the host injected a global (do not rely on it for portable utilities).\n\nHOW /BIN UTILITIES STILL SHARE CODE\n\nThe bare-os-coreutils build concatenates:\n\n1. lib/runtime.js (shared helpers: bareStdin, mode formatting, …)\n2. Optional preamble files (sed-engine.js, awk-engine.js, man-render.js)\n3. src/<name>.js (must contain only async function run and helpers in the same string—no import)\n\nSo “modules” become one compiled file on the drive. That is the supported pattern for shared logic in tier-1 utilities.\n\nPATTERNS THAT WORK FOR USER AND KERNEL CODE\n\n1. INLINE HELPERS\n\nFor small scripts, define functions above run:\n\n function double(n) {\n return n * 2\n }\n async function run(ctx, argv) {\n ctx.console.log(String(double(21)))\n }\n\n2. COPY-PASTE PRELUDE SNIPPETS\n\nYou may copy minimal helpers (e.g. stdin reader) from runtime.js <../packages/bare-os-coreutils/lib/runtime.js> into your script. Keep the license header in mind if you redistribute.\n\n3. LOAD ANOTHER FILE FROM THE DRIVE (ADVANCED)\n\nYou _can_ readFile a second script as a string and… you should not eval arbitrary untrusted content. For your own modules stored as ~/lib/helpers.js, a pattern is:\n\n- Store function bodies only or data (JSON), not full import syntax.\n- Or concatenate at build time on the host before uploading to Hyperdrive.\n\nThere is no built-in import() dynamic loader wired to Hyperdrive in the stock booter.\n\n4. HOST-SIDE BUNDLING\n\nIf you generate a single bundle.js on your laptop with esbuild/rollup and upload it to ~/bundle.js, that file can use no external import at runtime because everything is already bundled. This is the closest to “npm on device” without changing the booter.\n\nHOST PACKAGES (BOOTER / SEEDER): FULL ESM\n\nWhen you edit packages/bare-os-booter/index.js, you are in module land:\n\n import { runBinCommand } from './lib/kernel-runner.js'\n\nUse this for new protocols, drive encryption, alternate kernels, etc. This is not the same as writing /bin/foo.\n\nCTX.BARE — HOLEPUNCH-STYLE MODULES WITHOUT IMPORT\n\nWhen BARE_OS_BARE_MODULES is not disabled, the booter exposes ctx.bare: a frozen object whose keys are defined by bare-module-manifest.json <../packages/bare-os-booter/lib/bare-module-manifest.json>. Each entry names an npm package and a stable ctxKey (for example b4a, protomux, compactEncoding).\n\nHost resolution: the booter uses dynamic import() for each entry. Optional packages that fail to load (for example native-only modules on the wrong host) are skipped without aborting boot.\n\nDrive bundles (trusted image): the system image may include /lib/bare/manifest.json and */lib/bare/bundles/.js. Those scripts are IIFE bundles built by bare-os-bare-libs. The booter executes them with Function in the same trust class as seeded /bin utilities and copies values into ctx.bare only for keys not already set by the host. Set BARE_OS_BARE_DRIVE_BUNDLES=0** to skip this step.\n\nHardening: set BARE_OS_BARE_MODULES=0 to omit ctx.bare entirely (the property is absent on ctx). Runtime caps bareCtxModules and bareDriveBundles mirror these toggles.\n\nFull ecosystem context: Chapter 12 — Bare modules and Pear ecosystem <12-bare-modules-and-pear-ecosystem.md>.\n\nPEAR AND BARE GLOBALS\n\nUnder Pear/Bare, some globals (e.g. Bare) may exist for host exit and lifecycle. In-image utilities should still prefer ctx for I/O to stay consistent when the same script pattern is tested under different harnesses. Prefer *ctx.bare. over relying on Bare-specific package side effects when you need bare-url / bare-path** on the Pear runtime.\n\nFAQ CORNER\n\nCan I add dynamic import to the booter for user scripts?\nPossible in theory (resolve specifiers from Hyperdrive) but not implemented, and it raises security and package format questions (where do dependencies live?).\n\nCan I put node_modules on my personal drive?\nEven if you replicated bytes, the in-image loader would not resolve them as Node does. You would need a host or kernel change to load from that tree.\n\nSEE ALSO\n\n- Chapter 12 — Bare modules and Pear ecosystem <12-bare-modules-and-pear-ecosystem.md>\n- Chapter 6 — Extending /bin <06-extending-bin-coreutils.md>\n- Chapter 9 — Security <09-security-and-trust.md>\n- bare-os-coreutils README <../packages/bare-os-coreutils/README.md>\n\n← User scripts <04-user-scripts-and-path.md> · Extending /bin → <06-extending-bin-coreutils.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","05","modules","and","imports","chapter","import","packaging","the","honest","version"],"seeAlso":[{"name":"devguide-06-extending-bin-coreutils","section":7},{"name":"devguide-04-user-scripts-and-path","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/05-modules-and-imports.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-06-extending-bin-coreutils","section":7,"title":"Chapter 6 — Extending /bin (bare-os-coreutils)","synopsis":["man 7 devguide-06-extending-bin-coreutils","Developer guide chapter (developer-guide/06-extending-bin-coreutils.md)"],"description":"CHAPTER 6 — EXTENDING /BIN (BARE-OS-COREUTILS)\n\nShipping a new command in the system image means adding it to bare-os-coreutils, rebuilding, and re-seeding so /bin/<name> exists on the Hyperdrive. This is the only supported path for first-class OS utilities with shared prelude code.\n\nTHE CONTRACT (NON-NEGOTIABLE)\n\nEach command source under packages/bare-os-coreutils/src/<name>.js must:\n\n- Define async function run(ctx, argv).\n- Contain no top-level import or export—the file is concatenated into a single script string for AsyncFunction loading.\n\nShared helpers live in packages/bare-os-coreutils/lib/ and are prepended at build time, not imported. bare-os-lscolors lives in packages/bare-os-lscolors/ as a small workspace package so bare-os-booter can import it under Pear (cross-package paths into bare-os-coreutils resolve to unsupported pear://dev/... URLs).\n\nCHECKLIST FOR A NEW COMMAND FOO\n\n1. Implement packages/bare-os-coreutils/src/foo.js.\n2. Register the name in packages/bare-os-coreutils/lib/commands.mjs (COREUTILS_COMMANDS—keep sorted).\n3. Add a man page packages/bare-os-coreutils/man/pages/foo.json (build fails if missing).\n4. Optional: seed examples via scripts/seed-man-pages.mjs or edit JSON directly.\n5. Optional preamble: if foo needs a large engine file (or several helpers, like edit / nano with *lib/edit-.js), add to preamble** in build.mjs <../packages/bare-os-coreutils/build.mjs>:\n\n const preamble = {\n md5sum: ['md5.js'],\n sed: ['sed-engine.js'],\n awk: ['awk-engine.js'],\n jq: ['jq-engine.js'],\n man: ['man-render.js'],\n foo: ['foo-engine.js']\n }\n\n6. Build\n\n npm run build -w bare-os-coreutils\n\nThis runs build-man-db.mjs (manual database) and writes kernel/bin/foo plus the seeder mirror.\n\n7. Re-seed / replicate so peers get the new /bin/foo.\n\nWHAT GETS CONCATENATED\n\nFrom build.mjs <../packages/bare-os-coreutils/build.mjs>:\n\n runtime.js + [preamble files...] + src/foo.js → kernel/bin/foo\n\nruntime.js begins with a BARE_OS_BIN_API version comment (e.g. */ BARE_OS_BIN_API 1.0.0 /). Staged kernel/bin/ must contain that string so scripts/verify-kernel-seeder-parity.mjs <../../scripts/verify-kernel-seeder-parity.mjs> can catch drift; hand-written stubs (systemctl, journalctl**) carry the same pragma.\n\nruntime.js defines helpers like bareStdin, listing time formatting, etc.—read it before reimplementing utilities.\n\nEXIT STATUS\n\nPOSIX-ish utilities set ctx.exitCode (number) when they want a non-zero status. The shell uses ctx.exitCode for &&, ||, and ; lists; utilities such as grep and test set it for conditions.\n\nTESTS\n\nAdd or extend tests under packages/bare-os-booter/test.js using runBinCommand with a Hyperdrive that has the built /bin/foo bytes—follow existing grep, ls, cat patterns.\n\nDOCUMENTATION\n\n- Update man page JSON (required by build).\n- Optional: handbook chapter 9 cross-links for POSIX alignment.\n- Optional: TypeScript shapes in packages/bare-os-booter/lib/bare-os-ctx.d.ts <../packages/bare-os-booter/lib/bare-os-ctx.d.ts> (BareOsKernelContext, BareOsBinRun) for host-side editors.\n\nSEE ALSO\n\n- Chapter 5 — Modules <05-modules-and-imports.md>\n- Chapter 8 — Testing <08-testing-and-debugging.md>\n- kernel/README.md <../kernel/README.md>\n\n← Modules <05-modules-and-imports.md> · Apps beyond shell → <07-apps-beyond-the-shell.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","06","extending","bin","coreutils","chapter","bare"],"seeAlso":[{"name":"devguide-07-apps-beyond-the-shell","section":7},{"name":"devguide-05-modules-and-imports","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/06-extending-bin-coreutils.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-07-apps-beyond-the-shell","section":7,"title":"Chapter 7 — “Apps” beyond the shell (what is realistic today)","synopsis":["man 7 devguide-07-apps-beyond-the-shell","Developer guide chapter (developer-guide/07-apps-beyond-the-shell.md)"],"description":"CHAPTER 7 — “APPS” BEYOND THE SHELL (WHAT IS REALISTIC TODAY)\n\nBare OS does not have an app store, sandboxed widgets, or a second GUI runtime inside the image. An application here is usually:\n\n- a workflow built from the shell, /bin tools, and files on the personal drive; or\n- a custom kernel + utilities; or\n- a host Pear app that changes boot behavior.\n\nThis chapter orients you without over-promising.\n\nTHE DEFAULT “APP”: SHELL + /BIN + GIT\n\nMost user goals are met by:\n\n- Scripts in $HOME (run(ctx, argv)).\n- Pipelines and redirection (simulated stdin/stdout).\n- git for repositories on the VFS (see Handbook ch.8 <../handbook/08-git-on-bare-os.md>).\n\nThat is the intended application platform for end users.\n\nINITD AND BACKGROUND FLAVOR\n\nThe booter registers initd-style disposers via bare-initd.js <../packages/bare-os-booter/lib/bare-initd.js>. The stock system uses this lightly (e.g. kernel logger). Extending this usually means host booter changes: register a start function during executeKernel, not from arbitrary /bin scripts.\n\nRead bare-initd.js <../packages/bare-os-booter/lib/bare-initd.js> before adding long-running tasks—teardown must be explicit (stopBareInitd).\n\nCRON AND TIMERS\n\nbare-cron reads /etc/bare-os/crontab on the system image (if present), then the users ~/.crontab on the personal drive; invalid lines are logged and skipped. crontab installs/lists/removes the user file (requires login). Timer drop-ins under *~/.config/bare-os/timers/.timer ([Timer] OnCalendar= + ExecLine=**) merge into the same minute scheduler. See Handbook ch.4 <../handbook/04-the-booter-runtime.md> and Developer guide ch.11 <11-kernel-pear-cookbook.md>.\n\nSocket-shaped activation: initd unit drop-ins can set SocketActivationIpc=<fifo-name> so a services start() runs when something first readFiles that logical FIFO under /run/bare-os/ipc/ (see bare-initd.js).\n\nHDMS AND /MNT\n\nAfter identity unlock, optional HDMS mounts may appear under /mnt. Utilities use ctx.vfs; HDMS integration is advanced and covered narratively in the handbook (identity + HDMS chapter). User scripts should prefer vfs.readFile / writeFile over hard-coding drive objects.\n\nREPLACING THE KERNEL\n\nA heavier “app” might ship a different /boot/init.js—for example a menu-driven UI using readLine or a non-interactive worker when BARE_OS_SKIP_REPL=1. You still have the single JavaScript realm per session; there is no fork into a second Bare process from inside the image.\n\nWHEN YOU ACTUALLY NEED A NEW PEAR APP\n\nIf you need multiple OS images, custom networking, or native addons not suitable for AsyncFunction utilities, create a new Pear application that embeds or forks the booter pattern—this is host development (Chapter 1), not /bin development.\n\nSEE ALSO\n\n- Chapter 3 — Kernel <03-kernel-boot-init.md>\n- Handbook — Booter runtime <../handbook/04-the-booter-runtime.md>\n- Handbook — Identity, vault, HDMS <../handbook/05-identity-vault-and-hdms.md>\n\n← Extending /bin <06-extending-bin-coreutils.md> · Testing → <08-testing-and-debugging.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","07","apps","beyond","the","shell","chapter","what","realistic","today"],"seeAlso":[{"name":"devguide-08-testing-and-debugging","section":7},{"name":"devguide-06-extending-bin-coreutils","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/07-apps-beyond-the-shell.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-08-testing-and-debugging","section":7,"title":"Chapter 8 — Testing and debugging","synopsis":["man 7 devguide-08-testing-and-debugging","Developer guide chapter (developer-guide/08-testing-and-debugging.md)"],"description":"CHAPTER 8 — TESTING AND DEBUGGING\n\nBare OS development mixes Node (fast iteration, Hyperdrive in tests), Bare (identity crypto and Pear parity), and Pear (production-like bundling). This chapter maps how tests are organized and how to debug in-image code.\n\nWORKSPACE TESTS\n\nFrom the repo root:\n\n npm ci\n npm test\n\npretest runs npm run build -w bare-os-coreutils and node scripts/verify-kernel-seeder-parity.mjs so *kernel/bin/, kernel/share/man/man.json, and packages/bare-os-seeder/kernel/** stay aligned before booter tests.\n\nKernel self-test: with BARE_OS_KERNEL_SELFTEST=1, the stock kernel runs built-in checks (including /proc/bare_os_resources, /proc/bare_os_features, and /proc/bare_os/index.json). Use BARE_OS_SELFTEST_FORMAT=tap for CI-friendly stderr.\n\nKernel hot reload (dev): with BARE_OS_KERNEL_HOT_RELOAD=1, a custom kernel may call ctx.bareOsRequestKernelReload() to throw a controlled reload: the booter re-fetches /boot/init.js and runs start(ctx) again without tearing down the swarm session.\n\nBRITTLE: BRITTLE-NODE VS BRITTLE-BARE\n\n- brittle-node runs most of packages/bare-os-booter/test.js—Hyperdrive, VFS, shell tokenizer, runBinCommand against real /bin bytes on disk.\n- brittle-bare runs test.identity.js and protocol tests that need the Bare runtime (e.g. bare-crypto native pieces).\n\nCI installs Bare globally for parity (see .github/workflows/ci.yml). If identity tests fail locally, ensure bare is installed and on PATH.\n\nDEBUGGING USER SCRIPTS AND UTILITIES\n\n1. ctx.console.log / error — Primary visibility; errors from AsyncFunction compilation are caught in runScriptFromSource and printed with a short stack snippet.\n2. Isolate — Run a one-line shell command: command node is not available; use runBinCommand from a tiny test or invoke your script path directly.\n3. Compare with known-good — Copy the pattern from packages/bare-os-booter/test.js (readBuiltBin, put /bin/ls, etc.).\n\nPEAR DEV WORKFLOW\n\nUse the root scripts (see README <../README.md>):\n\n- npm run os:seeder and npm run os:booter (separate terminals) after ensure-pear-node-modules.\n\nPear uses bundled node_modules; if resolution fails, run node scripts/ensure-pear-node-modules.mjs as documented in scripts/README.md.\n\nCI-STYLE KERNEL CHECKS\n\n- BARE_OS_KERNEL_SELFTEST=1 — stock kernel/init.js <../kernel/init.js> runs a short execLine checklist after boot snippets.\n- BARE_OS_SELFTEST_FORMAT=tap — same self-test emits TAP lines on stderr (for parsers in CI).\n- node scripts/verify-kernel-seeder-parity.mjs — after a coreutils build, asserts kernel/ and packages/bare-os-seeder/kernel/ match and every *kernel/bin/ file includes BARE_OS_BIN_API (root pretest** runs this).\n\nCOMMON FAILURE MODES\n\n| Symptom | Likely cause |\n| unknown command | Name not on system PATH and not a resolvable *.js |\n| invalid manual database | Forgot to build coreutils after changing commands list |\n| kernel/bin missing BARE_OS_BIN_API pragma | Rebuild coreutils or add pragma to hand-maintained *kernel/bin/** stubs |\n| Identity test skips / fails on Node only | Expected—run under brittle-bare |\n| Session exits immediately | BARE_OS_SKIP_REPL=1 or readLine returns null |\n\nSEE ALSO\n\n- Handbook ch.7 — Operations <../handbook/07-operations-and-development.md>\n- bare-os-booter README <../packages/bare-os-booter/README.md>\n\n← Apps beyond shell <07-apps-beyond-the-shell.md> · Security → <09-security-and-trust.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","08","testing","and","debugging","chapter"],"seeAlso":[{"name":"devguide-09-security-and-trust","section":7},{"name":"devguide-07-apps-beyond-the-shell","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/08-testing-and-debugging.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-09-security-and-trust","section":7,"title":"Chapter 9 — Security and trust (developer mindset)","synopsis":["man 7 devguide-09-security-and-trust","Developer guide chapter (developer-guide/09-security-and-trust.md)"],"description":"CHAPTER 9 — SECURITY AND TRUST (DEVELOPER MINDSET)\n\nBare OS is research software. It is not a hardened multi-tenant OS. Still, developers should understand what is trusted and what full ctx power implies.\n\nSYSTEM DRIVE TRUST MODEL\n\nThe system Hyperdrive is the OS image. You normally obtain it by replicating from peers that share the projects discovery topology (see handbook protocol chapters). The codebase assumes you trust that image the same way you would trust an installer ISO from a vendor you chose.\n\n/bin and /boot bytes are executed as JavaScript. A malicious seeder could ship hostile /bin scripts. Mitigation is social and operational: use keys and peers you trust, verify releases, run your own seeder for development.\n\nBoot snippet tightening: with BARE_OS_BOOT_ALLOWLIST=1, the stock kernel only runs lines from trusted rc, rc.d, rc.local, kernel.d, and onboot whose first shell token appears in /etc/bare-os/boot.allow (plus builtins such as export, cd, :). Pair with BARE_OS_BOOT_STRICT=1 to exit the session on the first disallowed or failing line.\n\nBoot manifest integrity: BARE_OS_BOOT_MANIFEST=1 makes the stock kernel compare /etc/bare-os/boot.manifest.json to an expected digest (ctx.bareOsBootFileSha256Hex). BARE_OS_BOOT_MANIFEST_SIGN=1 adds Ed25519 verification of the raw manifest bytes against /etc/bare-os/boot.manifest.sig, using ctx.bareOsVerifyBootManifestSignature and BARE_OS_BOOT_MANIFEST_PUBKEY_HEX (64 hex chars). Rotation is operational: ship a new public key in host env and a matching signature file on the system image. This does not replace image trust—you still choose peers and seed sources carefully.\n\nAudit: BARE_OS_AUDIT=1 logs execLine activity to /var/log/bare-os/audit.log. BARE_OS_AUDIT_JSON=1 uses JSON lines with auditSchemaVersion: 2 on execLine, delegate, and httpFetch records; BARE_OS_AUDIT_REDACT=1 (or true) masks common secret-like VAR=value patterns; BARE_OS_AUDIT_REDACT=TOKEN,PASSWORD masks named keys.\n\nDelegated HTTP: when the booter sets ctx.httpFetch from the host fetch, BARE_OS_HTTP_ALLOWLIST and BARE_OS_HTTP_DENYLIST restrict http/https URLs for curl/wget (host-pattern globs). Failed checks throw before the request; with audit on, allow/deny outcomes can be logged.\n\nHost CLI delegates: git, curl, wget, and systemctl-family commands can be restricted with BARE_OS_DELEGATE_ALLOW (comma list; empty = all).\n\nDNS allowlist: BARE_OS_DNS_ALLOWLIST optionally constrains http(s) hostnames for curl/wget before fetch (suffix wildcard *.example.com** supported).\n\nIPC JSON-RPC: when BARE_OS_IPC_RPC_TOKEN is set, pushJson payloads must include matching bareOsIpcToken or the push throws. Line size is capped (BARE_OS_IPC_JSON_MAX_BYTES, default 256KiB).\n\nSandboxed scripts: ctx.bareOsSandboxRunScript(source, argv?, opts?) runs in-image JS with a restricted ctx: writes are limited to the personal namespace (same routing rules as isPersonalRoute), and identity / vault / virtual-file registration hooks are disabled. Disable entirely with BARE_OS_SANDBOX_SCRIPT=0. BARE_OS_SANDBOX_WORKER=1 defers execution on a fresh microtask (async boundary from the caller stack); it is not a separate thread or hardware isolate. This is still not a security boundary—treat sandboxing as a trust reducer.\n\nPERSONAL DRIVE AND USER SCRIPTS\n\nAnything you can write to $HOME can be executed if you run it—and you are the typical author. If you download a script from the network into your home directory and execLine it, you have effectively evald untrusted code with access to:\n\n- ctx.vfs (read/write personal tree),\n- identity hooks (if exposed through crafted shell lines),\n- runBinCommand (invoke all bundled utilities).\n\nThe stock shell does not sandbox run. Treat drive-resident JS like shell scripts with superpowers.\n\nWHY “ADD DYNAMIC IMPORT FROM THE INTERNET” IS DANGEROUS\n\nLoading modules from Hyperdrive or HTTP sounds convenient but creates:\n\n- Supply chain exposure (mutable remote code),\n- Ambiguous versioning (no lockfile on device),\n- Larger attack surface in the booter.\n\nThe projects conservative stance: bundle on the host or ship utilities in the system image after review.\n\nGUEST VS UNLOCKED IDENTITY\n\nDefault guest sessions have predictable HOME=/home/guest and no Ed25519 identity. Login unlocks /.bare/account and changes ctx.vfs.env (user, home, keys). Applications that handle secrets should never log passphrases or raw keys; use existing login / logout flows.\n\nREPORTING ISSUES\n\nSecurity vulnerabilities in this repo should be reported through the projects normal channels (maintainer contact / GitHub security advisories if enabled). Do not open public issues with exploit details until coordinated disclosure.\n\nSEE ALSO\n\n- Handbook — Blueprints / trust <../handbook/02-blueprints.md>\n- Chapter 5 — Modules <05-modules-and-imports.md>\n\n← Testing <08-testing-and-debugging.md> · Glossary → <10-glossary-and-faq.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","09","security","and","trust","chapter","mindset"],"seeAlso":[{"name":"devguide-10-glossary-and-faq","section":7},{"name":"devguide-08-testing-and-debugging","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/09-security-and-trust.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-10-glossary-and-faq","section":7,"title":"Chapter 10 — Glossary and FAQ","synopsis":["man 7 devguide-10-glossary-and-faq","Developer guide chapter (developer-guide/10-glossary-and-faq.md)"],"description":"CHAPTER 10 — GLOSSARY AND FAQ\n\nQuick reference and repeated questions.\n\nGLOSSARY\n\n| Term | Meaning |\n| AsyncFunction | Object.getPrototypeOf(async function () {}).constructor — used to compile in-image JS strings with parameters ctx / argv |\n| Booter | Pear/Node app (bare-os-booter) that joins Hyperswarm, replicates drives, builds ctx, runs kernel |\n| Coreutils | bare-os-coreutils package — builds /bin scripts from src/*.js + prelude |\n| ctx | Context object passed to start and run; see Chapter 2 <02-the-context-object.md> |\n| ctx.bare | Frozen map of curated npm modules for in-image scripts (manifest + optional /lib/bare bundles); Chapter 12 <12-bare-modules-and-pear-ecosystem.md> |\n| Guest | Pre-login session identity (BARE_OS_IDENTITY=guest) |\n| Hyperdrive | P2P writable/readable filesystem keyed by discovery secret |\n| In-image | Code whose source bytes live on system or personal drive and are evald via AsyncFunction |\n| Kernel | /boot/init.js — async function start(ctx) |\n| Personal drive | Per-session mutable Hyperdrive; $HOME, /.bare, user files |\n| Seeder | Pear/Node app that stages kernel/ into system Hyperdrive and serves MBR |\n| System drive | Replicated OS image (/bin, /boot, /etc, …) |\n| VFS | Virtual file system layer routing paths to drives + HDMS mounts |\n| IPC fan-out | bareOsIpc.fanoutPublish / fanoutSubscribe — multi-subscriber copies (bounded); disable with BARE_OS_IPC_FANOUT=0 |\n| HTTP policy | Optional BARE_OS_HTTP_ALLOWLIST / BARE_OS_HTTP_DENYLIST applied when the booter wraps ctx.httpFetch |\n| booterPhases | Milestones recorded in /run/bare-os/boot.json (vfs, ctx, repl, initd, kernel_invoke) alongside kernel phases |\n| ~/.barerc | Personal shell init: export, alias, theme <preset>; parsed by loadBarerc. Builtin barerc reload reapplies without logout. |\n| BARE_OS_THEME| Active color preset name; /bin/theme, ~/.barerc, and ctx.bareOsApplyTheme() refresh *BARE_OS_COLOR_ and usually LS_COLORS**. |\n| LS_COLORS | GNU-style colon-separated map consumed by ls --color; optional file via BARE_OS_DIRCOLORS and dircolors. |\n| BARE_OS_COLOR_DEPTH | truecolor (default), 256, or 16 / ansi — downgrades truecolor sequences in *BARE_OS_COLOR_** for the fish REPL only. |\n\nFAQ\n\nWhy doesnt import work in my ~/script.js?\nIn-image scripts are not ES modules. Use inlining, bundling on the host, or the coreutils concat build. See Chapter 5 <05-modules-and-imports.md>.\n\nHow do I use npm packages on the device?\nFor packages listed in bare-module-manifest.json, use ctx.bare.<key> from run / start (see Chapter 12 <12-bare-modules-and-pear-ecosystem.md>). Otherwise bundle on the host, or add code to the booter package with normal npm deps.\n\nWhats the difference between execLine and runBinCommand?\nexecLine runs the shell (aliases, builtins, pipelines). runBinCommand runs argv directly. See Chapter 3 <03-kernel-boot-init.md>.\n\nHow do I add a command to /bin?\nFollow Chapter 6 <06-extending-bin-coreutils.md>: src/foo.js, commands.mjs, man/pages/foo.json, build.\n\nCan I run TypeScript?\nNot natively on the drive. Compile to JS on the host, then ship the output.\n\nWhere is stdin for pipelines?\nShell sets ctx.shellStdin on a cloned context. Read it as a string. Coreutils use bareStdin(ctx) from prelude—user scripts must implement their own or copy the snippet. Chapter 4 <04-user-scripts-and-path.md>.\n\nHow do I exit the session from code?\nCall ctx.requestBooterExit(code) (same as exit builtin / /bin/exit).\n\nDoes ctx.exitCode control the host process exit?\nThe host exit code is managed by the booter after the kernel returns; utilities set ctx.exitCode for POSIX semantics inside the session. See booter executeKernel return path.\n\nWhat about Web APIs (fetch, localStorage)?\nNot part of the Bare OS contract for in-image code. Pear/Bare may provide some globals on the host; do not rely on them for portable /bin tools. When Node provides fetch, the booter may set ctx.httpFetch with outbound policy—see Chapter 2 <02-the-context-object.md>.\n\nWhat is bareOsSandboxRunScript?\nA reserved API that throws until a worker/isolate story lands; see Chapter 9 <09-security-and-trust.md>.\n\nHow do I match my host terminal to Bare OS colors?\nUse theme list / theme set <name> in the guest, then import the matching files under docs/themes <../docs/themes/README.md> (Alacritty, Warp, iTerm2). Host TERM and COLORTERM are passed through for capability detection.\n\nSEE ALSO\n\n- Developer guide home <README.md>\n- Handbook home <../handbook/README.md>\n- File-level reference <../docs/reference/README.md>\n\n← Security <09-security-and-trust.md> · Developer guide home <README.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","10","glossary","and","faq","chapter"],"seeAlso":[{"name":"devguide-11-kernel-pear-cookbook","section":7},{"name":"devguide-09-security-and-trust","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/10-glossary-and-faq.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-11-kernel-pear-cookbook","section":7,"title":"Chapter 11 — Kernel extensions and Pear workflows","synopsis":["man 7 devguide-11-kernel-pear-cookbook","Developer guide chapter (developer-guide/11-kernel-pear-cookbook.md)"],"description":"CHAPTER 11 — KERNEL EXTENSIONS AND PEAR WORKFLOWS\n\nThis chapter ties the Hyperdrive-resident kernel (kernel/init.js <../kernel/init.js>), ctx <./02-the-context-object.md>, and Pear/Bare distribution patterns together.\n\nBOOT COMPOSITION\n\n1. Stock phases — os-release, motd, optional rc.profile.*, rc, rc.d, rc.local, kernel.d, banner, onboot (non-interactive), optional self-test.\n2. Strict boot — BARE_OS_BOOT_STRICT=1 stops on first execLine error in trusted snippets.\n3. Allowlist — BARE_OS_BOOT_ALLOWLIST=1 plus /etc/bare-os/boot.allow <../kernel/etc/bare-os/boot.allow.example> restricts the first word of each line in those snippets (builtins like export and cd stay allowed).\n\nINIT, TIMERS, AND SOCKETS\n\n- bare-initd — User drop-ins under ~/.config/bare-os/units/<name>.unit support SocketActivationIpc=<fifo>; the units start runs after the first byte is read on that logical FIFO under /run/bare-os/ipc/….\n- Timers — Files in ~/.config/bare-os/timers/*.timer with a [Timer] section (OnCalendar= five cron fields, ExecLine=) are evaluated on the same minute tick as ~/.crontab.\n- System cron — Optional image file /etc/bare-os/crontab (see crontab.example <../kernel/etc/bare-os/crontab.example>) is merged with user crontab entries.\n\nOBSERVABILITY\n\n- ctx.bareOsSubscribeBootEvent — Same structured events as BARE_OS_BOOT_TRACE=ndjson (phase, ms, sessionId); the booter also emits *booter: phases (vfs, ctx, repl, initd, kernel_invoke**).\n- /proc/bare_os_quotas — Pipeline limits, BARE_OS_EXEC_MAX_DEPTH, IPC caps, session stats.\n- /proc/bare_os_resources / ctx.bareOsGetResourceStatus() — Unified snapshot for operators.\n- /proc/bare_os_features — Documented kernel-feature bitmask (see bare-os-protocol exports).\n- ctx.vfs.watch(path) — Hyperdrive-backed watch when BARE_OS_VFS_WATCH is not 0; returns { watcher, destroy, … }.\n\nPEAR / GIT / HTTP\n\n- Release metadata — Host can set BARE_OS_PEAR_CHANNEL, BARE_OS_PEAR_RELEASE, and BARE_OS_IMAGE_DIGEST; they appear in /run/bare-os/boot.json.\n- ctx.bareOsRequestPearReload() — Returns hints and env strings; the host pear-runtime / pear-runtime-updater must perform any real reload.\n- git-pear — /bin/git-pear help documents Git-in-Pear (gip-transport, gip-remote, git+pear:// remotes).\n- HTTP — Delegated curl / wget resolve fetch via ctx.httpFetch (policy-wrapped when the booter supplies it), then ctx.bare.fetch from host BARE_OS_BARE_MODULES and drive /lib/bare/bundles, then globalThis.fetch. ensureBareFetchGlobals may install bare-fetch or bare-https when no native fetch exists. BARE_OS_HTTP_ALLOWLIST, BARE_OS_HTTP_DENYLIST, BARE_OS_DNS_ALLOWLIST, and BARE_OS_TLS_PIN_SHA256 (and init.bareOsCurlTls for curl) narrow outbound access. Canonical doc: HTTP: curl and wget <../docs/reference/http-curl-and-wget.md>.\n\nBUILDING THE IMAGE\n\n- From the repo root, rebuild staged /bin utilities: node packages/bare-os-coreutils/build.mjs.\n- Keep kernel/ <../kernel/> and packages/bare-os-seeder/kernel/ <../packages/bare-os-seeder/kernel/> identical (node scripts/verify-kernel-seeder-parity.mjs).\n- Pear staging: use pear-build / app manifests in your Pear project; align pear.json channels with BARE_OS_PEAR_* env vars on the boot host.\n\nHDMS HOOKS\n\nUse ctx.bareOsSubscribeHdmsLifecycle to run logic when extra drives mount after unlock (kind: 'activate', labels) or before guest teardown (kind: 'deactivate').","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","11","kernel","pear","cookbook","chapter","extensions","and","workflows"],"seeAlso":[{"name":"devguide-12-bare-modules-and-pear-ecosystem","section":7},{"name":"devguide-10-glossary-and-faq","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/11-kernel-pear-cookbook.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"},{"name":"devguide-12-bare-modules-and-pear-ecosystem","section":7,"title":"Chapter 12 — Bare modules, ctx.bare, and the Pear ecosystem","synopsis":["man 7 devguide-12-bare-modules-and-pear-ecosystem","Developer guide chapter (developer-guide/12-bare-modules-and-pear-ecosystem.md)"],"description":"CHAPTER 12 — BARE MODULES, CTX.BARE, AND THE PEAR ECOSYSTEM\n\nThis chapter ties together *Holepunch bare- packages, the Pear host runtime, and how Bare OS exposes a curated subset to in-image** scripts.\n\nTHREE TIERS OF ACCESS\n\n1. /lib/bare (system image, primary) — bare-os-bare-libs builds one IIFE per manifest row into kernel/lib/bare/bundles/ (mirrored on the seeded Hyperdrive). It also copies bare-module-manifest.json into kernel/lib/bare/. manifest.json lists only bundles that esbuild could produce; failed rows still get a stub .js on disk (header comment) so the tree is complete. At boot, drive bundles run first (unless BARE_OS_BARE_DRIVE_BUNDLES=0).\n\n2. ctx.bare (host fallback) — Unless BARE_OS_BARE_HOST_IMPORTS=0, the booter then import()s any manifest packages still missing after drive merge—typically native or Bare-only packages that could not be bundled, or when the image is older than the manifest. Set BARE_OS_BARE_HOST_IMPORTS=0 for a fully image-local ctx.bare (no Pear host node_modules participation). Disable all ctx.bare with BARE_OS_BARE_MODULES=0.\n\n3. The full mirror (discoverability) — A local checkout of Holepunch repos (for example holepunchto_repos under your Pear tooling tree) lists on the order of 150+ repositories whose names start with bare-. Many are native addons, platform-specific (mobile, GUI, FFmpeg, …), or developer tools. The manifest can list them for ctx.bare, but only rows that bundle cleanly become real drive IIFEs; the rest rely on host import or stubs until you trim the manifest.\n\nMAINTENANCE WORKFLOW\n\n- Holepunch catalog (maximal npm set) — From the repo root:\n\n npm run gen:bare-catalog\n npm run sync:bare-manifest\n npm install\n\nThis refreshes docs/bare-holepunch-catalog.json <../docs/bare-holepunch-catalog.json> (every *holepunchto/bare- repo plus npm latest, minus scripts/bare-catalog-overrides.json <../scripts/bare-catalog-overrides.json>), then merges published packages into bare-module-manifest.json <../packages/bare-os-booter/lib/bare-module-manifest.json> and replaces booter optionalDependencies from that catalog (anything not includedInBooter is dropped). CI runs npm run gen:bare-catalog:check so the committed catalogs entries (and source**) stay in sync with live npm/GitHub.\n\nscripts/bare-ctx-import-overrides.json <../scripts/bare-ctx-import-overrides.json> adjusts a few packages for ctx.bare / esbuild: namespace exports (*export: ), bare-node-runtime/global** as a side-effect entry, etc. Edit this when npm packages have no default export or need a subpath.\n\n- Add or remove a ctx.bare entry by hand — Edit the manifest and booter dependencies / optionalDependencies as needed. The bundle field in the manifest is legacy metadata; bare-os-bare-libs attempts every row. Prefer the catalog + sync path for *bare- rows so ctxKey** and semver ranges stay consistent.\n\n- Refresh /lib/bare on the image — From the repo root:\n\n npm run build -w bare-os-bare-libs\n\nOptional BARE_OS_BUNDLE_TIER=core builds only manifest rows with \"tier\": \"core\" (default tier when omitted). Use all or unset for the full catalog.\n\nThen re-run the seeder so kernel/lib/bare/ is copied into the Hyperdrive (the seeder invokes this build automatically when running from a file: URL). Check manifest.json → bundleStats after a build for how many IIFEs succeeded vs stub-only.\n\n- Node vs Pear/Bare — On Node, buildBareCtxObjectFromHost skips manifest rows with nativeHint: true so optional Bare-native packages are not import()d (avoids stray failures and unhandled rejections from addons). On Pear/Bare, the full manifest is loaded in parallel.\n\n- Pear — Continue to use node scripts/ensure-pear-node-modules.mjs packages/bare-os-booter before pear run so hoisted node_modules resolve like npm (see PEAR-RUN.md <../PEAR-RUN.md>).\n\nRUNTIME CAPS\n\nctx.bareOsRuntimeCaps.features includes bareCtxModules, bareDriveBundles, and bareHostImportsForCtx so kernels can see whether host fallbacks are enabled.\n\nSEE ALSO\n\n- Chapter 5 — Modules and import <05-modules-and-imports.md>\n- Chapter 2 — The context object <02-the-context-object.md>\n- Handbook — Booter runtime <../handbook/04-the-booter-runtime.md>\n- packages/bare-os-bare-libs/README.md <../packages/bare-os-bare-libs/README.md>\n\n← Kernel + Pear cookbook <11-kernel-pear-cookbook.md> · Modules and import → <05-modules-and-imports.md>","descriptionMode":"preserve","options":[],"keywords":["developer","devguide","develop","script","asyncfunction","ctx","bare-os","guide","12","bare","modules","and","pear","ecosystem","chapter","the"],"seeAlso":[{"name":"devguide-11-kernel-pear-cookbook","section":7},{"name":"man","section":1},{"name":"bare-os-handbook","section":7}],"bareOsNotes":"Generated at build time from developer-guide/12-bare-modules-and-pear-ecosystem.md. Mermaid diagrams omitted in terminal; see repo Markdown for figures.","listCategory":"devguide"}],"index":{"arch":0,"awk":1,"base32":2,"base64":3,"basename":4,"basenc":5,"cat":6,"chgrp":7,"chmod":8,"chown":9,"cksum":10,"clear":11,"comm":12,"cmp":13,"cp":14,"crontab":15,"curl":16,"cut":17,"date":18,"df":19,"dir":20,"dirname":21,"dircolors":22,"du":23,"edit":24,"echo":25,"env":26,"exit":27,"expand":28,"expr":29,"factor":30,"false":31,"find":32,"fmt":33,"fold":34,"getconf":35,"git-pear":36,"grep":37,"groups":38,"head":39,"hdms":40,"help":41,"hostid":42,"hostname":43,"id":44,"install":45,"join":46,"jq":47,"ln":48,"login":49,"logout":50,"logname":51,"ls":52,"man":53,"md5sum":54,"mkdir":55,"mkfifo":56,"mktemp":57,"mv":58,"nano":59,"nl":60,"nproc":61,"numfmt":62,"od":63,"oidc-publish":64,"paste":65,"pathchk":66,"pr":67,"printenv":68,"printf":69,"pwd":70,"readlink":71,"realpath":72,"rev":73,"rm":74,"rmdir":75,"savevault":76,"sed":77,"seq":78,"sha1sum":79,"sha256sum":80,"sha512sum":81,"shuf":82,"sleep":83,"sort":84,"split":85,"stat":86,"sum":87,"sync":88,"tac":89,"tail":90,"tee":91,"test":92,"theme":93,"time":94,"touch":95,"tr":96,"truncate":97,"true":98,"tsort":99,"tty":100,"uname":101,"uniq":102,"unlink":103,"unexpand":104,"uptime":105,"users":106,"vdir":107,"wc":108,"wget":109,"which":110,"who":111,"whoami":112,"xargs":113,"yes":114,"bare-os-ctx-bare":115,"bare-os-shell":116,"sh-builtins":116,"systemctl":117,"bare-initctl":117,"git":118,"bare-os-handbook":119,"handbook":119,"bare-os-handbook-index":119,"handbook-00-preface":120,"handbook-01-introduction":121,"handbook-02-blueprints":122,"handbook-03-protocol-and-disk":123,"handbook-04-the-booter-runtime":124,"handbook-05-identity-vault-and-hdms":125,"handbook-06-kernel-and-binaries":126,"handbook-07-operations-and-development":127,"handbook-08-git-on-bare-os":128,"handbook-09-posix-utilities-shell-and-vfs":129,"handbook-10-manpages-and-online-help":130,"bare-os-developer-guide":131,"developer-guide":131,"devguide":131,"devguide-01-two-runtimes-host-vs-image":132,"devguide-02-the-context-object":133,"devguide-03-kernel-boot-init":134,"devguide-04-user-scripts-and-path":135,"devguide-05-modules-and-imports":136,"devguide-06-extending-bin-coreutils":137,"devguide-07-apps-beyond-the-shell":138,"devguide-08-testing-and-debugging":139,"devguide-09-security-and-trust":140,"devguide-10-glossary-and-faq":141,"devguide-11-kernel-pear-cookbook":142,"devguide-12-bare-modules-and-pear-ecosystem":143},"apropos":[{"kw":"arch","pageRef":0},{"kw":"bare-os","pageRef":0},{"kw":"coreutils","pageRef":0},{"kw":"print","pageRef":0},{"kw":"machine","pageRef":0},{"kw":"hardware","pageRef":0},{"kw":"name","pageRef":0},{"kw":"basic","pageRef":0},{"kw":"awk","pageRef":1},{"kw":"pattern","pageRef":1},{"kw":"field","pageRef":1},{"kw":"script","pageRef":1},{"kw":"scanning","pageRef":1},{"kw":"and","pageRef":1},{"kw":"processing","pageRef":1},{"kw":"language","pageRef":1},{"kw":"print","pageRef":1},{"kw":"column","pageRef":1},{"kw":"1","pageRef":1},{"kw":"separator","pageRef":1},{"kw":"sum","pageRef":1},{"kw":"numbers","pageRef":1},{"kw":"in","pageRef":1},{"kw":"first","pageRef":1},{"kw":"lines","pageRef":1},{"kw":"matching","pageRef":1},{"kw":"re","pageRef":1},{"kw":"base32","pageRef":2},{"kw":"bare-os","pageRef":2},{"kw":"coreutils","pageRef":2},{"kw":"encode","pageRef":2},{"kw":"or","pageRef":2},{"kw":"decode","pageRef":2},{"kw":"basic","pageRef":2},{"kw":"base64","pageRef":3},{"kw":"bare-os","pageRef":3},{"kw":"coreutils","pageRef":3},{"kw":"encode","pageRef":3},{"kw":"or","pageRef":3},{"kw":"decode","pageRef":3},{"kw":"a","pageRef":3},{"kw":"file","pageRef":3},{"kw":"basename","pageRef":4},{"kw":"bare-os","pageRef":4},{"kw":"coreutils","pageRef":4},{"kw":"strip","pageRef":4},{"kw":"directory","pageRef":4},{"kw":"and","pageRef":4},{"kw":"suffix","pageRef":4},{"kw":"from","pageRef":4},{"kw":"pathnames","pageRef":4},{"kw":"several","pageRef":4},{"kw":"paths","pageRef":4},{"kw":"basenc","pageRef":5},{"kw":"bare-os","pageRef":5},{"kw":"coreutils","pageRef":5},{"kw":"encode","pageRef":5},{"kw":"or","pageRef":5},{"kw":"decode","pageRef":5},{"kw":"with","pageRef":5},{"kw":"alphabet","pageRef":5},{"kw":"basic","pageRef":5},{"kw":"cat","pageRef":6},{"kw":"bare-os","pageRef":6},{"kw":"coreutils","pageRef":6},{"kw":"concatenate","pageRef":6},{"kw":"and","pageRef":6},{"kw":"print","pageRef":6},{"kw":"files","pageRef":6},{"kw":"stdout","pageRef":6},{"kw":"several","pageRef":6},{"kw":"numbered","pageRef":6},{"kw":"lines","pageRef":6},{"kw":"stdin","pageRef":6},{"kw":"explicitly","pageRef":6},{"kw":"chgrp","pageRef":7},{"kw":"bare-os","pageRef":7},{"kw":"coreutils","pageRef":7},{"kw":"metadata","pageRef":7},{"kw":"change","pageRef":7},{"kw":"file","pageRef":7},{"kw":"group","pageRef":7},{"kw":"ownership","pageRef":7},{"kw":"set","pageRef":7},{"kw":"by","pageRef":7},{"kw":"numeric","pageRef":7},{"kw":"gid","pageRef":7},{"kw":"to","pageRef":7},{"kw":"current","pageRef":7},{"kw":"session","pageRef":7},{"kw":"name","pageRef":7},{"kw":"chmod","pageRef":8},{"kw":"mode","pageRef":8},{"kw":"permission","pageRef":8},{"kw":"octal","pageRef":8},{"kw":"symbolic","pageRef":8},{"kw":"change","pageRef":8},{"kw":"file","pageRef":8},{"kw":"bits","pageRef":8},{"kw":"recursive-ish","pageRef":8},{"kw":"run","pageRef":8},{"kw":"find","pageRef":8},{"kw":"per","pageRef":8},{"kw":"user","pageRef":8},{"kw":"all","pageRef":8},{"kw":"read","pageRef":8},{"kw":"owner","pageRef":8},{"kw":"write","pageRef":8},{"kw":"chown","pageRef":9},{"kw":"bare-os","pageRef":9},{"kw":"coreutils","pageRef":9},{"kw":"metadata","pageRef":9},{"kw":"change","pageRef":9},{"kw":"file","pageRef":9},{"kw":"owner","pageRef":9},{"kw":"and","pageRef":9},{"kw":"group","pageRef":9},{"kw":"set","pageRef":9},{"kw":"numeric","pageRef":9},{"kw":"on","pageRef":9},{"kw":"a","pageRef":9},{"kw":"under","pageRef":9},{"kw":"home","pageRef":9},{"kw":"only","pageRef":9},{"kw":"leading","pageRef":9},{"kw":"colon","pageRef":9},{"kw":"keep","pageRef":9},{"kw":"cksum","pageRef":10},{"kw":"bare-os","pageRef":10},{"kw":"coreutils","pageRef":10},{"kw":"write","pageRef":10},{"kw":"file","pageRef":10},{"kw":"checksums","pageRef":10},{"kw":"and","pageRef":10},{"kw":"sizes","pageRef":10},{"kw":"checksum","pageRef":10},{"kw":"verify","pageRef":10},{"kw":"pipeline","pageRef":10},{"kw":"clear","pageRef":11},{"kw":"bare-os","pageRef":11},{"kw":"coreutils","pageRef":11},{"kw":"the","pageRef":11},{"kw":"terminal","pageRef":11},{"kw":"screen","pageRef":11},{"kw":"wipe","pageRef":11},{"kw":"comm","pageRef":12},{"kw":"bare-os","pageRef":12},{"kw":"coreutils","pageRef":12},{"kw":"compare","pageRef":12},{"kw":"two","pageRef":12},{"kw":"sorted","pageRef":12},{"kw":"files","pageRef":12},{"kw":"line","pageRef":12},{"kw":"by","pageRef":12},{"kw":"basic","pageRef":12},{"kw":"cmp","pageRef":13},{"kw":"bare-os","pageRef":13},{"kw":"coreutils","pageRef":13},{"kw":"compare","pageRef":13},{"kw":"two","pageRef":13},{"kw":"files","pageRef":13},{"kw":"basic","pageRef":13},{"kw":"cp","pageRef":14},{"kw":"bare-os","pageRef":14},{"kw":"coreutils","pageRef":14},{"kw":"copy","pageRef":14},{"kw":"files","pageRef":14},{"kw":"file","pageRef":14},{"kw":"into","pageRef":14},{"kw":"directory","pageRef":14},{"kw":"preserve","pageRef":14},{"kw":"implied","pageRef":14},{"kw":"if","pageRef":14},{"kw":"implemented","pageRef":14},{"kw":"crontab","pageRef":15},{"kw":"bare-os","pageRef":15},{"kw":"coreutils","pageRef":15},{"kw":"user","pageRef":15},{"kw":"manipulation","pageRef":15},{"kw":"list","pageRef":15},{"kw":"jobs","pageRef":15},{"kw":"install","pageRef":15},{"kw":"from","pageRef":15},{"kw":"file","pageRef":15},{"kw":"remove","pageRef":15},{"kw":"all","pageRef":15},{"kw":"curl","pageRef":16},{"kw":"http","pageRef":16},{"kw":"https","pageRef":16},{"kw":"fetch","pageRef":16},{"kw":"download","pageRef":16},{"kw":"transfer","pageRef":16},{"kw":"a","pageRef":16},{"kw":"url","pageRef":16},{"kw":"fetch-based","pageRef":16},{"kw":"client","pageRef":16},{"kw":"not","pageRef":16},{"kw":"libcurl","pageRef":16},{"kw":"cut","pageRef":17},{"kw":"bare-os","pageRef":17},{"kw":"coreutils","pageRef":17},{"kw":"out","pageRef":17},{"kw":"selected","pageRef":17},{"kw":"fields","pageRef":17},{"kw":"of","pageRef":17},{"kw":"each","pageRef":17},{"kw":"line","pageRef":17},{"kw":"by","pageRef":17},{"kw":"delimiter","pageRef":17},{"kw":"characters","pageRef":17},{"kw":"date","pageRef":18},{"kw":"bare-os","pageRef":18},{"kw":"coreutils","pageRef":18},{"kw":"display","pageRef":18},{"kw":"or","pageRef":18},{"kw":"set","pageRef":18},{"kw":"and","pageRef":18},{"kw":"time","pageRef":18},{"kw":"rfc-ish","pageRef":18},{"kw":"output","pageRef":18},{"kw":"epoch","pageRef":18},{"kw":"seconds","pageRef":18},{"kw":"df","pageRef":19},{"kw":"bare-os","pageRef":19},{"kw":"coreutils","pageRef":19},{"kw":"report","pageRef":19},{"kw":"file","pageRef":19},{"kw":"system","pageRef":19},{"kw":"disk","pageRef":19},{"kw":"space","pageRef":19},{"kw":"usage","pageRef":19},{"kw":"basic","pageRef":19},{"kw":"dir","pageRef":20},{"kw":"bare-os","pageRef":20},{"kw":"coreutils","pageRef":20},{"kw":"list","pageRef":20},{"kw":"directory","pageRef":20},{"kw":"contents","pageRef":20},{"kw":"basic","pageRef":20},{"kw":"dirname","pageRef":21},{"kw":"bare-os","pageRef":21},{"kw":"coreutils","pageRef":21},{"kw":"return","pageRef":21},{"kw":"directory","pageRef":21},{"kw":"portion","pageRef":21},{"kw":"of","pageRef":21},{"kw":"a","pageRef":21},{"kw":"pathname","pageRef":21},{"kw":"parent","pageRef":21},{"kw":"path","pageRef":21},{"kw":"compose","pageRef":21},{"kw":"with","pageRef":21},{"kw":"basename","pageRef":21},{"kw":"dircolors","pageRef":22},{"kw":"ls_colors","pageRef":22},{"kw":"ls","pageRef":22},{"kw":"color","pageRef":22},{"kw":"print","pageRef":22},{"kw":"from","pageRef":22},{"kw":"database","pageRef":22},{"kw":"default","pageRef":22},{"kw":"eval","pageRef":22},{"kw":"in","pageRef":22},{"kw":"shell","pageRef":22},{"kw":"du","pageRef":23},{"kw":"bare-os","pageRef":23},{"kw":"coreutils","pageRef":23},{"kw":"estimate","pageRef":23},{"kw":"file","pageRef":23},{"kw":"space","pageRef":23},{"kw":"usage","pageRef":23},{"kw":"sizes","pageRef":23},{"kw":"under","pageRef":23},{"kw":"cwd","pageRef":23},{"kw":"human-readable","pageRef":23},{"kw":"edit","pageRef":24},{"kw":"nano","pageRef":24},{"kw":"editor","pageRef":24},{"kw":"tty","pageRef":24},{"kw":"syntax","pageRef":24},{"kw":"terminal","pageRef":24},{"kw":"file","pageRef":24},{"kw":"with","pageRef":24},{"kw":"highlighting","pageRef":24},{"kw":"a","pageRef":24},{"kw":"same","pageRef":24},{"kw":"via","pageRef":24},{"kw":"alias","pageRef":24},{"kw":"echo","pageRef":25},{"kw":"bare-os","pageRef":25},{"kw":"coreutils","pageRef":25},{"kw":"write","pageRef":25},{"kw":"arguments","pageRef":25},{"kw":"to","pageRef":25},{"kw":"standard","pageRef":25},{"kw":"output","pageRef":25},{"kw":"literal","pageRef":25},{"kw":"no","pageRef":25},{"kw":"newline","pageRef":25},{"kw":"if","pageRef":25},{"kw":"-n","pageRef":25},{"kw":"supported","pageRef":25},{"kw":"env","pageRef":26},{"kw":"bare-os","pageRef":26},{"kw":"coreutils","pageRef":26},{"kw":"set","pageRef":26},{"kw":"the","pageRef":26},{"kw":"environment","pageRef":26},{"kw":"for","pageRef":26},{"kw":"command","pageRef":26},{"kw":"invocation","pageRef":26},{"kw":"print","pageRef":26},{"kw":"minimal","pageRef":26},{"kw":"and","pageRef":26},{"kw":"run","pageRef":26},{"kw":"override","pageRef":26},{"kw":"one","pageRef":26},{"kw":"exit","pageRef":27},{"kw":"bare-os","pageRef":27},{"kw":"coreutils","pageRef":27},{"kw":"the","pageRef":27},{"kw":"shell","pageRef":27},{"kw":"or","pageRef":27},{"kw":"booter","pageRef":27},{"kw":"session","pageRef":27},{"kw":"leave","pageRef":27},{"kw":"with","pageRef":27},{"kw":"status","pageRef":27},{"kw":"from","pageRef":27},{"kw":"script","pageRef":27},{"kw":"expand","pageRef":28},{"kw":"bare-os","pageRef":28},{"kw":"coreutils","pageRef":28},{"kw":"convert","pageRef":28},{"kw":"tabs","pageRef":28},{"kw":"to","pageRef":28},{"kw":"spaces","pageRef":28},{"kw":"basic","pageRef":28},{"kw":"expr","pageRef":29},{"kw":"bare-os","pageRef":29},{"kw":"coreutils","pageRef":29},{"kw":"evaluate","pageRef":29},{"kw":"expressions","pageRef":29},{"kw":"basic","pageRef":29},{"kw":"factor","pageRef":30},{"kw":"bare-os","pageRef":30},{"kw":"coreutils","pageRef":30},{"kw":"numbers","pageRef":30},{"kw":"basic","pageRef":30},{"kw":"false","pageRef":31},{"kw":"bare-os","pageRef":31},{"kw":"coreutils","pageRef":31},{"kw":"return","pageRef":31},{"kw":"value","pageRef":31},{"kw":"force","pageRef":31},{"kw":"failure","pageRef":31},{"kw":"in","pageRef":31},{"kw":"pipeline","pageRef":31},{"kw":"tests","pageRef":31},{"kw":"find","pageRef":32},{"kw":"directory","pageRef":32},{"kw":"walk","pageRef":32},{"kw":"search","pageRef":32},{"kw":"files","pageRef":32},{"kw":"by","pageRef":32},{"kw":"name","pageRef":32},{"kw":"glob","pageRef":32},{"kw":"directories","pageRef":32},{"kw":"only","pageRef":32},{"kw":"max","pageRef":32},{"kw":"depth","pageRef":32},{"kw":"skip","pageRef":32},{"kw":"top","pageRef":32},{"kw":"level","pageRef":32},{"kw":"gnu-like","pageRef":32},{"kw":"-mindepth","pageRef":32},{"kw":"2","pageRef":32},{"kw":"case-insensitive","pageRef":32},{"kw":"fmt","pageRef":33},{"kw":"bare-os","pageRef":33},{"kw":"coreutils","pageRef":33},{"kw":"simple","pageRef":33},{"kw":"text","pageRef":33},{"kw":"formatter","pageRef":33},{"kw":"basic","pageRef":33},{"kw":"fold","pageRef":34},{"kw":"bare-os","pageRef":34},{"kw":"coreutils","pageRef":34},{"kw":"wrap","pageRef":34},{"kw":"each","pageRef":34},{"kw":"input","pageRef":34},{"kw":"line","pageRef":34},{"kw":"basic","pageRef":34},{"kw":"getconf","pageRef":35},{"kw":"limits","pageRef":35},{"kw":"path_max","pageRef":35},{"kw":"posix","pageRef":35},{"kw":"bare-os","pageRef":35},{"kw":"coreutils","pageRef":35},{"kw":"get","pageRef":35},{"kw":"configuration","pageRef":35},{"kw":"values","pageRef":35},{"kw":"path","pageRef":35},{"kw":"length","pageRef":35},{"kw":"limit","pageRef":35},{"kw":"list","pageRef":35},{"kw":"known","pageRef":35},{"kw":"names","pageRef":35},{"kw":"and","pageRef":35},{"kw":"git","pageRef":36},{"kw":"pear","pageRef":36},{"kw":"gip","pageRef":36},{"kw":"bare-os","pageRef":36},{"kw":"git-pear","pageRef":36},{"kw":"git-in-pear","pageRef":36},{"kw":"hints","pageRef":36},{"kw":"help","pageRef":36},{"kw":"grep","pageRef":37},{"kw":"search","pageRef":37},{"kw":"regex","pageRef":37},{"kw":"pattern","pageRef":37},{"kw":"filter","pageRef":37},{"kw":"matching","pageRef":37},{"kw":"utility","pageRef":37},{"kw":"recursive","pageRef":37},{"kw":"feel","pageRef":37},{"kw":"each","pageRef":37},{"kw":"file","pageRef":37},{"kw":"case","pageRef":37},{"kw":"insensitive","pageRef":37},{"kw":"invert","pageRef":37},{"kw":"lines","pageRef":37},{"kw":"without","pageRef":37},{"kw":"fixed","pageRef":37},{"kw":"string","pageRef":37},{"kw":"no","pageRef":37},{"kw":"count","pageRef":37},{"kw":"matches","pageRef":37},{"kw":"only","pageRef":37},{"kw":"filenames","pageRef":37},{"kw":"multiple","pageRef":37},{"kw":"patterns","pageRef":37},{"kw":"groups","pageRef":38},{"kw":"bare-os","pageRef":38},{"kw":"coreutils","pageRef":38},{"kw":"print","pageRef":38},{"kw":"group","pageRef":38},{"kw":"names","pageRef":38},{"kw":"basic","pageRef":38},{"kw":"head","pageRef":39},{"kw":"bare-os","pageRef":39},{"kw":"coreutils","pageRef":39},{"kw":"copy","pageRef":39},{"kw":"the","pageRef":39},{"kw":"first","pageRef":39},{"kw":"part","pageRef":39},{"kw":"of","pageRef":39},{"kw":"files","pageRef":39},{"kw":"10","pageRef":39},{"kw":"lines","pageRef":39},{"kw":"n","pageRef":39},{"kw":"bytes","pageRef":39},{"kw":"stdin","pageRef":39},{"kw":"hdms","pageRef":40},{"kw":"hyperswarm","pageRef":40},{"kw":"map","pageRef":40},{"kw":"distributed","pageRef":40},{"kw":"store","pageRef":40},{"kw":"when","pageRef":40},{"kw":"booter","pageRef":40},{"kw":"wires","pageRef":40},{"kw":"otherwise","pageRef":40},{"kw":"help","pageRef":41},{"kw":"summary","pageRef":41},{"kw":"builtins","pageRef":41},{"kw":"commands","pageRef":41},{"kw":"bare","pageRef":41},{"kw":"os","pageRef":41},{"kw":"quick","pageRef":41},{"kw":"index","pageRef":41},{"kw":"then","pageRef":41},{"kw":"deep","pageRef":41},{"kw":"dive","pageRef":41},{"kw":"hostid","pageRef":42},{"kw":"bare-os","pageRef":42},{"kw":"coreutils","pageRef":42},{"kw":"print","pageRef":42},{"kw":"numeric","pageRef":42},{"kw":"host","pageRef":42},{"kw":"identifier","pageRef":42},{"kw":"basic","pageRef":42},{"kw":"hostname","pageRef":43},{"kw":"bare-os","pageRef":43},{"kw":"coreutils","pageRef":43},{"kw":"set","pageRef":43},{"kw":"or","pageRef":43},{"kw":"print","pageRef":43},{"kw":"show","pageRef":43},{"kw":"host","pageRef":43},{"kw":"id","pageRef":44},{"kw":"bare-os","pageRef":44},{"kw":"coreutils","pageRef":44},{"kw":"return","pageRef":44},{"kw":"user","pageRef":44},{"kw":"identity","pageRef":44},{"kw":"who","pageRef":44},{"kw":"am","pageRef":44},{"kw":"i","pageRef":44},{"kw":"numerically","pageRef":44},{"kw":"install","pageRef":45},{"kw":"bare-os","pageRef":45},{"kw":"coreutils","pageRef":45},{"kw":"copy","pageRef":45},{"kw":"files","pageRef":45},{"kw":"and","pageRef":45},{"kw":"set","pageRef":45},{"kw":"attributes","pageRef":45},{"kw":"basic","pageRef":45},{"kw":"join","pageRef":46},{"kw":"bare-os","pageRef":46},{"kw":"coreutils","pageRef":46},{"kw":"lines","pageRef":46},{"kw":"of","pageRef":46},{"kw":"two","pageRef":46},{"kw":"files","pageRef":46},{"kw":"on","pageRef":46},{"kw":"a","pageRef":46},{"kw":"common","pageRef":46},{"kw":"field","pageRef":46},{"kw":"basic","pageRef":46},{"kw":"jq","pageRef":47},{"kw":"json","pageRef":47},{"kw":"query","pageRef":47},{"kw":"filter","pageRef":47},{"kw":"jqjs","pageRef":47},{"kw":"command-line","pageRef":47},{"kw":"processor","pageRef":47},{"kw":"language","pageRef":47},{"kw":"subset","pageRef":47},{"kw":"pretty-print","pageRef":47},{"kw":"field","pageRef":47},{"kw":"slurp","pageRef":47},{"kw":"array","pageRef":47},{"kw":"compact","pageRef":47},{"kw":"ln","pageRef":48},{"kw":"bare-os","pageRef":48},{"kw":"coreutils","pageRef":48},{"kw":"link","pageRef":48},{"kw":"files","pageRef":48},{"kw":"symlink","pageRef":48},{"kw":"hard","pageRef":48},{"kw":"if","pageRef":48},{"kw":"supported","pageRef":48},{"kw":"login","pageRef":49},{"kw":"identity","pageRef":49},{"kw":"passphrase","pageRef":49},{"kw":"begin","pageRef":49},{"kw":"a","pageRef":49},{"kw":"session","pageRef":49},{"kw":"on","pageRef":49},{"kw":"the","pageRef":49},{"kw":"system","pageRef":49},{"kw":"unlock","pageRef":49},{"kw":"existing","pageRef":49},{"kw":"register","pageRef":49},{"kw":"new","pageRef":49},{"kw":"logout","pageRef":50},{"kw":"session","pageRef":50},{"kw":"end","pageRef":50},{"kw":"save","pageRef":50},{"kw":"vault","pageRef":50},{"kw":"hint","pageRef":50},{"kw":"logname","pageRef":51},{"kw":"bare-os","pageRef":51},{"kw":"coreutils","pageRef":51},{"kw":"return","pageRef":51},{"kw":"the","pageRef":51},{"kw":"user","pageRef":51},{"kw":"s","pageRef":51},{"kw":"login","pageRef":51},{"kw":"name","pageRef":51},{"kw":"ls","pageRef":52},{"kw":"list","pageRef":52},{"kw":"directory","pageRef":52},{"kw":"dir","pageRef":52},{"kw":"contents","pageRef":52},{"kw":"long","pageRef":52},{"kw":"hidden","pageRef":52},{"kw":"one","pageRef":52},{"kw":"per","pageRef":52},{"kw":"line","pageRef":52},{"kw":"multiple","pageRef":52},{"kw":"paths","pageRef":52},{"kw":"man","pageRef":53},{"kw":"manual","pageRef":53},{"kw":"help","pageRef":53},{"kw":"documentation","pageRef":53},{"kw":"apropos","pageRef":53},{"kw":"whatis","pageRef":53},{"kw":"cheat","pageRef":53},{"kw":"examples","pageRef":53},{"kw":"display","pageRef":53},{"kw":"on-line","pageRef":53},{"kw":"pages","pageRef":53},{"kw":"open","pageRef":53},{"kw":"page","pageRef":53},{"kw":"handbook","pageRef":53},{"kw":"toc","pageRef":53},{"kw":"section","pageRef":53},{"kw":"7","pageRef":53},{"kw":"chapter","pageRef":53},{"kw":"by","pageRef":53},{"kw":"all","pageRef":53},{"kw":"narrow","pageRef":53},{"kw":"terminal","pageRef":53},{"kw":"md5sum","pageRef":54},{"kw":"bare-os","pageRef":54},{"kw":"coreutils","pageRef":54},{"kw":"compute","pageRef":54},{"kw":"md5","pageRef":54},{"kw":"checksums","pageRef":54},{"kw":"basic","pageRef":54},{"kw":"mkdir","pageRef":55},{"kw":"bare-os","pageRef":55},{"kw":"coreutils","pageRef":55},{"kw":"make","pageRef":55},{"kw":"directories","pageRef":55},{"kw":"one","pageRef":55},{"kw":"dir","pageRef":55},{"kw":"parents","pageRef":55},{"kw":"mode","pageRef":55},{"kw":"mkfifo","pageRef":56},{"kw":"bare-os","pageRef":56},{"kw":"coreutils","pageRef":56},{"kw":"stub","pageRef":56},{"kw":"make","pageRef":56},{"kw":"fifo","pageRef":56},{"kw":"special","pageRef":56},{"kw":"files","pageRef":56},{"kw":"mktemp","pageRef":57},{"kw":"bare-os","pageRef":57},{"kw":"coreutils","pageRef":57},{"kw":"create","pageRef":57},{"kw":"a","pageRef":57},{"kw":"temporary","pageRef":57},{"kw":"file","pageRef":57},{"kw":"or","pageRef":57},{"kw":"directory","pageRef":57},{"kw":"dir","pageRef":57},{"kw":"mv","pageRef":58},{"kw":"bare-os","pageRef":58},{"kw":"coreutils","pageRef":58},{"kw":"move","pageRef":58},{"kw":"or","pageRef":58},{"kw":"rename","pageRef":58},{"kw":"files","pageRef":58},{"kw":"into","pageRef":58},{"kw":"dir","pageRef":58},{"kw":"nano","pageRef":59},{"kw":"edit","pageRef":59},{"kw":"editor","pageRef":59},{"kw":"alias","pageRef":59},{"kw":"for","pageRef":59},{"kw":"terminal","pageRef":59},{"kw":"file","pageRef":59},{"kw":"open","pageRef":59},{"kw":"a","pageRef":59},{"kw":"nl","pageRef":60},{"kw":"bare-os","pageRef":60},{"kw":"coreutils","pageRef":60},{"kw":"line","pageRef":60},{"kw":"numbering","pageRef":60},{"kw":"utility","pageRef":60},{"kw":"number","pageRef":60},{"kw":"all","pageRef":60},{"kw":"lines","pageRef":60},{"kw":"nproc","pageRef":61},{"kw":"bare-os","pageRef":61},{"kw":"coreutils","pageRef":61},{"kw":"print","pageRef":61},{"kw":"number","pageRef":61},{"kw":"of","pageRef":61},{"kw":"processing","pageRef":61},{"kw":"units","pageRef":61},{"kw":"basic","pageRef":61},{"kw":"numfmt","pageRef":62},{"kw":"bare-os","pageRef":62},{"kw":"coreutils","pageRef":62},{"kw":"convert","pageRef":62},{"kw":"numbers","pageRef":62},{"kw":"basic","pageRef":62},{"kw":"od","pageRef":63},{"kw":"bare-os","pageRef":63},{"kw":"coreutils","pageRef":63},{"kw":"octal","pageRef":63},{"kw":"dump","pageRef":63},{"kw":"hex","pageRef":63},{"kw":"vibe","pageRef":63},{"kw":"oidc","pageRef":64},{"kw":"pear","pageRef":64},{"kw":"http","pageRef":64},{"kw":"bare-os","pageRef":64},{"kw":"oidc-publish","pageRef":64},{"kw":"client-credentials","pageRef":64},{"kw":"helper","pageRef":64},{"kw":"help","pageRef":64},{"kw":"paste","pageRef":65},{"kw":"bare-os","pageRef":65},{"kw":"coreutils","pageRef":65},{"kw":"merge","pageRef":65},{"kw":"lines","pageRef":65},{"kw":"of","pageRef":65},{"kw":"files","pageRef":65},{"kw":"basic","pageRef":65},{"kw":"pathchk","pageRef":66},{"kw":"bare-os","pageRef":66},{"kw":"coreutils","pageRef":66},{"kw":"check","pageRef":66},{"kw":"pathname","pageRef":66},{"kw":"portability","pageRef":66},{"kw":"portable","pageRef":66},{"kw":"path","pageRef":66},{"kw":"pr","pageRef":67},{"kw":"bare-os","pageRef":67},{"kw":"coreutils","pageRef":67},{"kw":"paginate","pageRef":67},{"kw":"or","pageRef":67},{"kw":"columnate","pageRef":67},{"kw":"basic","pageRef":67},{"kw":"printenv","pageRef":68},{"kw":"bare-os","pageRef":68},{"kw":"coreutils","pageRef":68},{"kw":"print","pageRef":68},{"kw":"environment","pageRef":68},{"kw":"variables","pageRef":68},{"kw":"one","pageRef":68},{"kw":"variable","pageRef":68},{"kw":"all","pageRef":68},{"kw":"printf","pageRef":69},{"kw":"bare-os","pageRef":69},{"kw":"coreutils","pageRef":69},{"kw":"format","pageRef":69},{"kw":"and","pageRef":69},{"kw":"print","pageRef":69},{"kw":"no","pageRef":69},{"kw":"newline","pageRef":69},{"kw":"pwd","pageRef":70},{"kw":"bare-os","pageRef":70},{"kw":"coreutils","pageRef":70},{"kw":"return","pageRef":70},{"kw":"working","pageRef":70},{"kw":"directory","pageRef":70},{"kw":"name","pageRef":70},{"kw":"where","pageRef":70},{"kw":"am","pageRef":70},{"kw":"i","pageRef":70},{"kw":"readlink","pageRef":71},{"kw":"bare-os","pageRef":71},{"kw":"coreutils","pageRef":71},{"kw":"print","pageRef":71},{"kw":"symbolic","pageRef":71},{"kw":"link","pageRef":71},{"kw":"targets","pageRef":71},{"kw":"symlink","pageRef":71},{"kw":"target","pageRef":71},{"kw":"realpath","pageRef":72},{"kw":"bare-os","pageRef":72},{"kw":"coreutils","pageRef":72},{"kw":"print","pageRef":72},{"kw":"resolved","pageRef":72},{"kw":"logical","pageRef":72},{"kw":"path","pageRef":72},{"kw":"resolve","pageRef":72},{"kw":"under","pageRef":72},{"kw":"home","pageRef":72},{"kw":"rev","pageRef":73},{"kw":"bare-os","pageRef":73},{"kw":"coreutils","pageRef":73},{"kw":"reverse","pageRef":73},{"kw":"lines","pageRef":73},{"kw":"characterwise","pageRef":73},{"kw":"basic","pageRef":73},{"kw":"rm","pageRef":74},{"kw":"bare-os","pageRef":74},{"kw":"coreutils","pageRef":74},{"kw":"remove","pageRef":74},{"kw":"files","pageRef":74},{"kw":"file","pageRef":74},{"kw":"tree","pageRef":74},{"kw":"rmdir","pageRef":75},{"kw":"bare-os","pageRef":75},{"kw":"coreutils","pageRef":75},{"kw":"remove","pageRef":75},{"kw":"empty","pageRef":75},{"kw":"directories","pageRef":75},{"kw":"dir","pageRef":75},{"kw":"savevault","pageRef":76},{"kw":"vault","pageRef":76},{"kw":"encrypt","pageRef":76},{"kw":"backup","pageRef":76},{"kw":"snapshot","pageRef":76},{"kw":"of","pageRef":76},{"kw":"personal","pageRef":76},{"kw":"drive","pageRef":76},{"kw":"encrypted","pageRef":76},{"kw":"sed","pageRef":77},{"kw":"stream","pageRef":77},{"kw":"edit","pageRef":77},{"kw":"substitute","pageRef":77},{"kw":"editor","pageRef":77},{"kw":"first","pageRef":77},{"kw":"per","pageRef":77},{"kw":"line","pageRef":77},{"kw":"global","pageRef":77},{"kw":"in-place","pageRef":77},{"kw":"if","pageRef":77},{"kw":"supported","pageRef":77},{"kw":"print","pageRef":77},{"kw":"5","pageRef":77},{"kw":"only","pageRef":77},{"kw":"delete","pageRef":77},{"kw":"blank","pageRef":77},{"kw":"lines","pageRef":77},{"kw":"seq","pageRef":78},{"kw":"bare-os","pageRef":78},{"kw":"coreutils","pageRef":78},{"kw":"print","pageRef":78},{"kw":"sequences","pageRef":78},{"kw":"of","pageRef":78},{"kw":"numbers","pageRef":78},{"kw":"1","pageRef":78},{"kw":"10","pageRef":78},{"kw":"step","pageRef":78},{"kw":"sha1sum","pageRef":79},{"kw":"bare-os","pageRef":79},{"kw":"coreutils","pageRef":79},{"kw":"compute","pageRef":79},{"kw":"sha-1","pageRef":79},{"kw":"checksums","pageRef":79},{"kw":"basic","pageRef":79},{"kw":"sha256sum","pageRef":80},{"kw":"checksum","pageRef":80},{"kw":"bare-os","pageRef":80},{"kw":"coreutils","pageRef":80},{"kw":"compute","pageRef":80},{"kw":"sha-256","pageRef":80},{"kw":"checksums","pageRef":80},{"kw":"files","pageRef":80},{"kw":"stdin","pageRef":80},{"kw":"sha512sum","pageRef":81},{"kw":"bare-os","pageRef":81},{"kw":"coreutils","pageRef":81},{"kw":"compute","pageRef":81},{"kw":"sha-512","pageRef":81},{"kw":"checksums","pageRef":81},{"kw":"basic","pageRef":81},{"kw":"shuf","pageRef":82},{"kw":"bare-os","pageRef":82},{"kw":"coreutils","pageRef":82},{"kw":"shuffle","pageRef":82},{"kw":"lines","pageRef":82},{"kw":"basic","pageRef":82},{"kw":"sleep","pageRef":83},{"kw":"bare-os","pageRef":83},{"kw":"coreutils","pageRef":83},{"kw":"suspend","pageRef":83},{"kw":"execution","pageRef":83},{"kw":"for","pageRef":83},{"kw":"an","pageRef":83},{"kw":"interval","pageRef":83},{"kw":"pause","pageRef":83},{"kw":"seconds","pageRef":83},{"kw":"sort","pageRef":84},{"kw":"bare-os","pageRef":84},{"kw":"coreutils","pageRef":84},{"kw":"lines","pageRef":84},{"kw":"lexicographic","pageRef":84},{"kw":"numeric","pageRef":84},{"kw":"unique","pageRef":84},{"kw":"verify","pageRef":84},{"kw":"sorted","pageRef":84},{"kw":"write","pageRef":84},{"kw":"to","pageRef":84},{"kw":"file","pageRef":84},{"kw":"split","pageRef":85},{"kw":"bare-os","pageRef":85},{"kw":"coreutils","pageRef":85},{"kw":"a","pageRef":85},{"kw":"file","pageRef":85},{"kw":"into","pageRef":85},{"kw":"pieces","pageRef":85},{"kw":"basic","pageRef":85},{"kw":"stat","pageRef":86},{"kw":"bare-os","pageRef":86},{"kw":"coreutils","pageRef":86},{"kw":"display","pageRef":86},{"kw":"file","pageRef":86},{"kw":"status","pageRef":86},{"kw":"metadata","pageRef":86},{"kw":"sum","pageRef":87},{"kw":"bare-os","pageRef":87},{"kw":"coreutils","pageRef":87},{"kw":"checksum","pageRef":87},{"kw":"and","pageRef":87},{"kw":"count","pageRef":87},{"kw":"blocks","pageRef":87},{"kw":"basic","pageRef":87},{"kw":"sync","pageRef":88},{"kw":"bare-os","pageRef":88},{"kw":"coreutils","pageRef":88},{"kw":"flush","pageRef":88},{"kw":"file","pageRef":88},{"kw":"system","pageRef":88},{"kw":"buffers","pageRef":88},{"kw":"basic","pageRef":88},{"kw":"tac","pageRef":89},{"kw":"bare-os","pageRef":89},{"kw":"coreutils","pageRef":89},{"kw":"concatenate","pageRef":89},{"kw":"and","pageRef":89},{"kw":"print","pageRef":89},{"kw":"lines","pageRef":89},{"kw":"in","pageRef":89},{"kw":"reverse","pageRef":89},{"kw":"basic","pageRef":89},{"kw":"tail","pageRef":90},{"kw":"follow","pageRef":90},{"kw":"log","pageRef":90},{"kw":"bare-os","pageRef":90},{"kw":"coreutils","pageRef":90},{"kw":"copy","pageRef":90},{"kw":"the","pageRef":90},{"kw":"last","pageRef":90},{"kw":"part","pageRef":90},{"kw":"of","pageRef":90},{"kw":"a","pageRef":90},{"kw":"file","pageRef":90},{"kw":"lines","pageRef":90},{"kw":"bytes","pageRef":90},{"kw":"tee","pageRef":91},{"kw":"bare-os","pageRef":91},{"kw":"coreutils","pageRef":91},{"kw":"duplicate","pageRef":91},{"kw":"standard","pageRef":91},{"kw":"input","pageRef":91},{"kw":"copy","pageRef":91},{"kw":"stdout","pageRef":91},{"kw":"to","pageRef":91},{"kw":"file","pageRef":91},{"kw":"test","pageRef":92},{"kw":"bare-os","pageRef":92},{"kw":"coreutils","pageRef":92},{"kw":"evaluate","pageRef":92},{"kw":"a","pageRef":92},{"kw":"condition","pageRef":92},{"kw":"file","pageRef":92},{"kw":"exists","pageRef":92},{"kw":"directory","pageRef":92},{"kw":"string","pageRef":92},{"kw":"equal","pageRef":92},{"kw":"theme","pageRef":93},{"kw":"colors","pageRef":93},{"kw":"ls_colors","pageRef":93},{"kw":"prompt","pageRef":93},{"kw":"switch","pageRef":93},{"kw":"bare","pageRef":93},{"kw":"os","pageRef":93},{"kw":"color","pageRef":93},{"kw":"list","pageRef":93},{"kw":"presets","pageRef":93},{"kw":"to","pageRef":93},{"kw":"nord","pageRef":93},{"kw":"palette","pageRef":93},{"kw":"re-apply","pageRef":93},{"kw":"after","pageRef":93},{"kw":"manual","pageRef":93},{"kw":"env","pageRef":93},{"kw":"edits","pageRef":93},{"kw":"time","pageRef":94},{"kw":"bare-os","pageRef":94},{"kw":"coreutils","pageRef":94},{"kw":"a","pageRef":94},{"kw":"simple","pageRef":94},{"kw":"command","pageRef":94},{"kw":"wall","pageRef":94},{"kw":"touch","pageRef":95},{"kw":"bare-os","pageRef":95},{"kw":"coreutils","pageRef":95},{"kw":"change","pageRef":95},{"kw":"file","pageRef":95},{"kw":"timestamps","pageRef":95},{"kw":"or","pageRef":95},{"kw":"create","pageRef":95},{"kw":"files","pageRef":95},{"kw":"empty","pageRef":95},{"kw":"set","pageRef":95},{"kw":"time","pageRef":95},{"kw":"match","pageRef":95},{"kw":"another","pageRef":95},{"kw":"tr","pageRef":96},{"kw":"bare-os","pageRef":96},{"kw":"coreutils","pageRef":96},{"kw":"translate","pageRef":96},{"kw":"or","pageRef":96},{"kw":"delete","pageRef":96},{"kw":"characters","pageRef":96},{"kw":"uppercase","pageRef":96},{"kw":"chars","pageRef":96},{"kw":"truncate","pageRef":97},{"kw":"bare-os","pageRef":97},{"kw":"coreutils","pageRef":97},{"kw":"shrink","pageRef":97},{"kw":"or","pageRef":97},{"kw":"extend","pageRef":97},{"kw":"file","pageRef":97},{"kw":"size","pageRef":97},{"kw":"basic","pageRef":97},{"kw":"true","pageRef":98},{"kw":"bare-os","pageRef":98},{"kw":"coreutils","pageRef":98},{"kw":"return","pageRef":98},{"kw":"value","pageRef":98},{"kw":"always","pageRef":98},{"kw":"success","pageRef":98},{"kw":"tsort","pageRef":99},{"kw":"bare-os","pageRef":99},{"kw":"coreutils","pageRef":99},{"kw":"topological","pageRef":99},{"kw":"sort","pageRef":99},{"kw":"basic","pageRef":99},{"kw":"tty","pageRef":100},{"kw":"bare-os","pageRef":100},{"kw":"coreutils","pageRef":100},{"kw":"return","pageRef":100},{"kw":"user","pageRef":100},{"kw":"s","pageRef":100},{"kw":"terminal","pageRef":100},{"kw":"name","pageRef":100},{"kw":"am","pageRef":100},{"kw":"i","pageRef":100},{"kw":"a","pageRef":100},{"kw":"uname","pageRef":101},{"kw":"bare-os","pageRef":101},{"kw":"coreutils","pageRef":101},{"kw":"return","pageRef":101},{"kw":"operating","pageRef":101},{"kw":"system","pageRef":101},{"kw":"name","pageRef":101},{"kw":"kernel-ish","pageRef":101},{"kw":"info","pageRef":101},{"kw":"uniq","pageRef":102},{"kw":"bare-os","pageRef":102},{"kw":"coreutils","pageRef":102},{"kw":"report","pageRef":102},{"kw":"or","pageRef":102},{"kw":"filter","pageRef":102},{"kw":"adjacent","pageRef":102},{"kw":"duplicate","pageRef":102},{"kw":"lines","pageRef":102},{"kw":"unique","pageRef":102},{"kw":"sorted","pageRef":102},{"kw":"counts","pageRef":102},{"kw":"unlink","pageRef":103},{"kw":"bare-os","pageRef":103},{"kw":"coreutils","pageRef":103},{"kw":"remove","pageRef":103},{"kw":"a","pageRef":103},{"kw":"file","pageRef":103},{"kw":"basic","pageRef":103},{"kw":"unexpand","pageRef":104},{"kw":"bare-os","pageRef":104},{"kw":"coreutils","pageRef":104},{"kw":"convert","pageRef":104},{"kw":"spaces","pageRef":104},{"kw":"to","pageRef":104},{"kw":"tabs","pageRef":104},{"kw":"basic","pageRef":104},{"kw":"uptime","pageRef":105},{"kw":"bare-os","pageRef":105},{"kw":"coreutils","pageRef":105},{"kw":"show","pageRef":105},{"kw":"basic","pageRef":105},{"kw":"users","pageRef":106},{"kw":"bare-os","pageRef":106},{"kw":"coreutils","pageRef":106},{"kw":"print","pageRef":106},{"kw":"login","pageRef":106},{"kw":"names","pageRef":106},{"kw":"basic","pageRef":106},{"kw":"vdir","pageRef":107},{"kw":"bare-os","pageRef":107},{"kw":"coreutils","pageRef":107},{"kw":"verbose","pageRef":107},{"kw":"directory","pageRef":107},{"kw":"listing","pageRef":107},{"kw":"basic","pageRef":107},{"kw":"wc","pageRef":108},{"kw":"bare-os","pageRef":108},{"kw":"coreutils","pageRef":108},{"kw":"word","pageRef":108},{"kw":"line","pageRef":108},{"kw":"and","pageRef":108},{"kw":"byte","pageRef":108},{"kw":"or","pageRef":108},{"kw":"character","pageRef":108},{"kw":"count","pageRef":108},{"kw":"lines","pageRef":108},{"kw":"words","pageRef":108},{"kw":"bytes","pageRef":108},{"kw":"only","pageRef":108},{"kw":"stdin","pageRef":108},{"kw":"wget","pageRef":109},{"kw":"download","pageRef":109},{"kw":"http","pageRef":109},{"kw":"https","pageRef":109},{"kw":"fetch","pageRef":109},{"kw":"mirror","pageRef":109},{"kw":"non-interactive","pageRef":109},{"kw":"network","pageRef":109},{"kw":"fetch-based","pageRef":109},{"kw":"not","pageRef":109},{"kw":"gnu","pageRef":109},{"kw":"wget2","pageRef":109},{"kw":"save","pageRef":109},{"kw":"with","pageRef":109},{"kw":"default","pageRef":109},{"kw":"name","pageRef":109},{"kw":"in","pageRef":109},{"kw":"cwd","pageRef":109},{"kw":"choose","pageRef":109},{"kw":"output","pageRef":109},{"kw":"path","pageRef":109},{"kw":"directory","pageRef":109},{"kw":"prefix","pageRef":109},{"kw":"stdout","pageRef":109},{"kw":"resume","pageRef":109},{"kw":"partial","pageRef":109},{"kw":"file","pageRef":109},{"kw":"which","pageRef":110},{"kw":"bare-os","pageRef":110},{"kw":"coreutils","pageRef":110},{"kw":"locate","pageRef":110},{"kw":"a","pageRef":110},{"kw":"command","pageRef":110},{"kw":"resolve","pageRef":110},{"kw":"on","pageRef":110},{"kw":"path","pageRef":110},{"kw":"who","pageRef":111},{"kw":"bare-os","pageRef":111},{"kw":"coreutils","pageRef":111},{"kw":"show","pageRef":111},{"kw":"is","pageRef":111},{"kw":"logged","pageRef":111},{"kw":"on","pageRef":111},{"kw":"basic","pageRef":111},{"kw":"whoami","pageRef":112},{"kw":"bare-os","pageRef":112},{"kw":"coreutils","pageRef":112},{"kw":"display","pageRef":112},{"kw":"effective","pageRef":112},{"kw":"user","pageRef":112},{"kw":"id","pageRef":112},{"kw":"xargs","pageRef":113},{"kw":"arguments","pageRef":113},{"kw":"bare-os","pageRef":113},{"kw":"coreutils","pageRef":113},{"kw":"construct","pageRef":113},{"kw":"argument","pageRef":113},{"kw":"lists","pageRef":113},{"kw":"and","pageRef":113},{"kw":"invoke","pageRef":113},{"kw":"utility","pageRef":113},{"kw":"pass","pageRef":113},{"kw":"lines","pageRef":113},{"kw":"as","pageRef":113},{"kw":"one","pageRef":113},{"kw":"per","pageRef":113},{"kw":"run","pageRef":113},{"kw":"workaround","pageRef":113},{"kw":"for","pageRef":113},{"kw":"complex","pageRef":113},{"kw":"scripts","pageRef":113},{"kw":"yes","pageRef":114},{"kw":"bare-os","pageRef":114},{"kw":"coreutils","pageRef":114},{"kw":"output","pageRef":114},{"kw":"a","pageRef":114},{"kw":"string","pageRef":114},{"kw":"repeatedly","pageRef":114},{"kw":"basic","pageRef":114},{"kw":"bare_os_bare_modules","pageRef":115},{"kw":"bare_os_bare_drive_bundles","pageRef":115},{"kw":"ctx.bare","pageRef":115},{"kw":"bare-module-manifest","pageRef":115},{"kw":"bare-os-bare-libs","pageRef":115},{"kw":"bare-os-ctx-bare","pageRef":115},{"kw":"ctx","pageRef":115},{"kw":"bare","pageRef":115},{"kw":"library","pageRef":115},{"kw":"and","pageRef":115},{"kw":"drive","pageRef":115},{"kw":"bundles","pageRef":115},{"kw":"shell","pageRef":116},{"kw":"builtin","pageRef":116},{"kw":"cd","pageRef":116},{"kw":"export","pageRef":116},{"kw":"alias","pageRef":116},{"kw":"bare-os-shell","pageRef":116},{"kw":"sh-builtins","pageRef":116},{"kw":"bare","pageRef":116},{"kw":"os","pageRef":116},{"kw":"interactive","pageRef":116},{"kw":"builtins","pageRef":116},{"kw":"pipeline","pageRef":116},{"kw":"simulated","pageRef":116},{"kw":"redirect","pageRef":116},{"kw":"out","pageRef":116},{"kw":"append","pageRef":116},{"kw":"use","pageRef":116},{"kw":"for","pageRef":116},{"kw":"children","pageRef":116},{"kw":"temp","pageRef":116},{"kw":"var","pageRef":116},{"kw":"one","pageRef":116},{"kw":"command","pageRef":116},{"kw":"bare-initd","pageRef":117},{"kw":"initctl","pageRef":117},{"kw":"service","pageRef":117},{"kw":"supervisor","pageRef":117},{"kw":"cron","pageRef":117},{"kw":"systemd","pageRef":117},{"kw":"systemctl","pageRef":117},{"kw":"control","pageRef":117},{"kw":"systemd-like","pageRef":117},{"kw":"subset","pageRef":117},{"kw":"list","pageRef":117},{"kw":"units","pageRef":117},{"kw":"restart","pageRef":117},{"kw":"scheduler","pageRef":117},{"kw":"tail","pageRef":117},{"kw":"errors","pageRef":117},{"kw":"git","pageRef":118},{"kw":"version control","pageRef":118},{"kw":"repository","pageRef":118},{"kw":"clone","pageRef":118},{"kw":"commit","pageRef":118},{"kw":"isomorphic-git","pageRef":118},{"kw":"bare","pageRef":118},{"kw":"os","pageRef":118},{"kw":"front-end","pageRef":118},{"kw":"new","pageRef":118},{"kw":"repo","pageRef":118},{"kw":"status","pageRef":118},{"kw":"over","pageRef":118},{"kw":"http","pageRef":118},{"kw":"needs","pageRef":118},{"kw":"remote","pageRef":118},{"kw":"fetch","pageRef":118},{"kw":"config","pageRef":118},{"kw":"local","pageRef":118},{"kw":"log","pageRef":118},{"kw":"one","pageRef":118},{"kw":"line","pageRef":118},{"kw":"handbook","pageRef":119},{"kw":"bare-os","pageRef":119},{"kw":"documentation","pageRef":119},{"kw":"narrative","pageRef":119},{"kw":"chapter","pageRef":119},{"kw":"bare","pageRef":119},{"kw":"os","pageRef":119},{"kw":"table","pageRef":119},{"kw":"contents","pageRef":119},{"kw":"and","pageRef":119},{"kw":"reading","pageRef":119},{"kw":"order","pageRef":119},{"kw":"bare-os-handbook","pageRef":119},{"kw":"of","pageRef":119},{"kw":"handbook","pageRef":120},{"kw":"bare-os","pageRef":120},{"kw":"documentation","pageRef":120},{"kw":"narrative","pageRef":120},{"kw":"chapter","pageRef":120},{"kw":"00","pageRef":120},{"kw":"preface","pageRef":120},{"kw":"why","pageRef":120},{"kw":"bare","pageRef":120},{"kw":"exists","pageRef":120},{"kw":"handbook-00-preface","pageRef":120},{"kw":"os","pageRef":120},{"kw":"handbook","pageRef":121},{"kw":"bare-os","pageRef":121},{"kw":"documentation","pageRef":121},{"kw":"narrative","pageRef":121},{"kw":"chapter","pageRef":121},{"kw":"01","pageRef":121},{"kw":"introduction","pageRef":121},{"kw":"what","pageRef":121},{"kw":"bare","pageRef":121},{"kw":"handbook-01-introduction","pageRef":121},{"kw":"1","pageRef":121},{"kw":"os","pageRef":121},{"kw":"is","pageRef":121},{"kw":"handbook","pageRef":122},{"kw":"bare-os","pageRef":122},{"kw":"documentation","pageRef":122},{"kw":"narrative","pageRef":122},{"kw":"chapter","pageRef":122},{"kw":"02","pageRef":122},{"kw":"blueprints","pageRef":122},{"kw":"architecture","pageRef":122},{"kw":"and","pageRef":122},{"kw":"trust","pageRef":122},{"kw":"handbook-02-blueprints","pageRef":122},{"kw":"2","pageRef":122},{"kw":"handbook","pageRef":123},{"kw":"bare-os","pageRef":123},{"kw":"documentation","pageRef":123},{"kw":"narrative","pageRef":123},{"kw":"chapter","pageRef":123},{"kw":"03","pageRef":123},{"kw":"protocol","pageRef":123},{"kw":"and","pageRef":123},{"kw":"disk","pageRef":123},{"kw":"mbr","pageRef":123},{"kw":"swarmdisk","pageRef":123},{"kw":"handbook-03-protocol-and-disk","pageRef":123},{"kw":"3","pageRef":123},{"kw":"handbook","pageRef":124},{"kw":"bare-os","pageRef":124},{"kw":"documentation","pageRef":124},{"kw":"narrative","pageRef":124},{"kw":"chapter","pageRef":124},{"kw":"04","pageRef":124},{"kw":"the","pageRef":124},{"kw":"booter","pageRef":124},{"kw":"runtime","pageRef":124},{"kw":"ctx","pageRef":124},{"kw":"vfs","pageRef":124},{"kw":"shell","pageRef":124},{"kw":"kernel","pageRef":124},{"kw":"services","pageRef":124},{"kw":"handbook-04-the-booter-runtime","pageRef":124},{"kw":"4","pageRef":124},{"kw":"handbook","pageRef":125},{"kw":"bare-os","pageRef":125},{"kw":"documentation","pageRef":125},{"kw":"narrative","pageRef":125},{"kw":"chapter","pageRef":125},{"kw":"05","pageRef":125},{"kw":"identity","pageRef":125},{"kw":"vault","pageRef":125},{"kw":"and","pageRef":125},{"kw":"hdms","pageRef":125},{"kw":"handbook-05-identity-vault-and-hdms","pageRef":125},{"kw":"5","pageRef":125},{"kw":"handbook","pageRef":126},{"kw":"bare-os","pageRef":126},{"kw":"documentation","pageRef":126},{"kw":"narrative","pageRef":126},{"kw":"chapter","pageRef":126},{"kw":"06","pageRef":126},{"kw":"kernel","pageRef":126},{"kw":"and","pageRef":126},{"kw":"binaries","pageRef":126},{"kw":"bin","pageRef":126},{"kw":"utilities","pageRef":126},{"kw":"handbook-06-kernel-and-binaries","pageRef":126},{"kw":"6","pageRef":126},{"kw":"handbook","pageRef":127},{"kw":"bare-os","pageRef":127},{"kw":"documentation","pageRef":127},{"kw":"narrative","pageRef":127},{"kw":"chapter","pageRef":127},{"kw":"07","pageRef":127},{"kw":"operations","pageRef":127},{"kw":"and","pageRef":127},{"kw":"development","pageRef":127},{"kw":"release","pageRef":127},{"kw":"handbook-07-operations-and-development","pageRef":127},{"kw":"7","pageRef":127},{"kw":"handbook","pageRef":128},{"kw":"bare-os","pageRef":128},{"kw":"documentation","pageRef":128},{"kw":"narrative","pageRef":128},{"kw":"chapter","pageRef":128},{"kw":"08","pageRef":128},{"kw":"git","pageRef":128},{"kw":"on","pageRef":128},{"kw":"bare","pageRef":128},{"kw":"os","pageRef":128},{"kw":"handbook-08-git-on-bare-os","pageRef":128},{"kw":"8","pageRef":128},{"kw":"handbook","pageRef":129},{"kw":"bare-os","pageRef":129},{"kw":"documentation","pageRef":129},{"kw":"narrative","pageRef":129},{"kw":"chapter","pageRef":129},{"kw":"09","pageRef":129},{"kw":"posix","pageRef":129},{"kw":"utilities","pageRef":129},{"kw":"shell","pageRef":129},{"kw":"and","pageRef":129},{"kw":"vfs","pageRef":129},{"kw":"style","pageRef":129},{"kw":"builtins","pageRef":129},{"kw":"alignment","pageRef":129},{"kw":"handbook-09-posix-utilities-shell-and-vfs","pageRef":129},{"kw":"9","pageRef":129},{"kw":"posix-style","pageRef":129},{"kw":"handbook","pageRef":130},{"kw":"bare-os","pageRef":130},{"kw":"documentation","pageRef":130},{"kw":"narrative","pageRef":130},{"kw":"chapter","pageRef":130},{"kw":"10","pageRef":130},{"kw":"manpages","pageRef":130},{"kw":"and","pageRef":130},{"kw":"online","pageRef":130},{"kw":"help","pageRef":130},{"kw":"manual","pageRef":130},{"kw":"pages","pageRef":130},{"kw":"man","pageRef":130},{"kw":"handbook-10-manpages-and-online-help","pageRef":130},{"kw":"developer","pageRef":131},{"kw":"devguide","pageRef":131},{"kw":"develop","pageRef":131},{"kw":"script","pageRef":131},{"kw":"asyncfunction","pageRef":131},{"kw":"ctx","pageRef":131},{"kw":"bare-os","pageRef":131},{"kw":"guide","pageRef":131},{"kw":"bare","pageRef":131},{"kw":"os","pageRef":131},{"kw":"index","pageRef":131},{"kw":"and","pageRef":131},{"kw":"reading","pageRef":131},{"kw":"order","pageRef":131},{"kw":"bare-os-developer-guide","pageRef":131},{"kw":"developer","pageRef":132},{"kw":"devguide","pageRef":132},{"kw":"develop","pageRef":132},{"kw":"script","pageRef":132},{"kw":"asyncfunction","pageRef":132},{"kw":"ctx","pageRef":132},{"kw":"bare-os","pageRef":132},{"kw":"guide","pageRef":132},{"kw":"01","pageRef":132},{"kw":"two","pageRef":132},{"kw":"runtimes","pageRef":132},{"kw":"host","pageRef":132},{"kw":"vs","pageRef":132},{"kw":"image","pageRef":132},{"kw":"chapter","pageRef":132},{"kw":"pear","pageRef":132},{"kw":"node","pageRef":132},{"kw":"devguide-01-two-runtimes-host-vs-image","pageRef":132},{"kw":"1","pageRef":132},{"kw":"in-image","pageRef":132},{"kw":"developer","pageRef":133},{"kw":"devguide","pageRef":133},{"kw":"develop","pageRef":133},{"kw":"script","pageRef":133},{"kw":"asyncfunction","pageRef":133},{"kw":"ctx","pageRef":133},{"kw":"bare-os","pageRef":133},{"kw":"guide","pageRef":133},{"kw":"02","pageRef":133},{"kw":"the","pageRef":133},{"kw":"context","pageRef":133},{"kw":"object","pageRef":133},{"kw":"chapter","pageRef":133},{"kw":"devguide-02-the-context-object","pageRef":133},{"kw":"2","pageRef":133},{"kw":"developer","pageRef":134},{"kw":"devguide","pageRef":134},{"kw":"develop","pageRef":134},{"kw":"script","pageRef":134},{"kw":"asyncfunction","pageRef":134},{"kw":"ctx","pageRef":134},{"kw":"bare-os","pageRef":134},{"kw":"guide","pageRef":134},{"kw":"03","pageRef":134},{"kw":"kernel","pageRef":134},{"kw":"boot","pageRef":134},{"kw":"init","pageRef":134},{"kw":"chapter","pageRef":134},{"kw":"and","pageRef":134},{"kw":"start","pageRef":134},{"kw":"devguide-03-kernel-boot-init","pageRef":134},{"kw":"3","pageRef":134},{"kw":"js","pageRef":134},{"kw":"developer","pageRef":135},{"kw":"devguide","pageRef":135},{"kw":"develop","pageRef":135},{"kw":"script","pageRef":135},{"kw":"asyncfunction","pageRef":135},{"kw":"ctx","pageRef":135},{"kw":"bare-os","pageRef":135},{"kw":"guide","pageRef":135},{"kw":"04","pageRef":135},{"kw":"user","pageRef":135},{"kw":"scripts","pageRef":135},{"kw":"and","pageRef":135},{"kw":"path","pageRef":135},{"kw":"chapter","pageRef":135},{"kw":"resolution","pageRef":135},{"kw":"devguide-04-user-scripts-and-path","pageRef":135},{"kw":"4","pageRef":135},{"kw":"developer","pageRef":136},{"kw":"devguide","pageRef":136},{"kw":"develop","pageRef":136},{"kw":"script","pageRef":136},{"kw":"asyncfunction","pageRef":136},{"kw":"ctx","pageRef":136},{"kw":"bare-os","pageRef":136},{"kw":"guide","pageRef":136},{"kw":"05","pageRef":136},{"kw":"modules","pageRef":136},{"kw":"and","pageRef":136},{"kw":"imports","pageRef":136},{"kw":"chapter","pageRef":136},{"kw":"import","pageRef":136},{"kw":"packaging","pageRef":136},{"kw":"the","pageRef":136},{"kw":"honest","pageRef":136},{"kw":"version","pageRef":136},{"kw":"devguide-05-modules-and-imports","pageRef":136},{"kw":"5","pageRef":136},{"kw":"developer","pageRef":137},{"kw":"devguide","pageRef":137},{"kw":"develop","pageRef":137},{"kw":"script","pageRef":137},{"kw":"asyncfunction","pageRef":137},{"kw":"ctx","pageRef":137},{"kw":"bare-os","pageRef":137},{"kw":"guide","pageRef":137},{"kw":"06","pageRef":137},{"kw":"extending","pageRef":137},{"kw":"bin","pageRef":137},{"kw":"coreutils","pageRef":137},{"kw":"chapter","pageRef":137},{"kw":"bare","pageRef":137},{"kw":"devguide-06-extending-bin-coreutils","pageRef":137},{"kw":"6","pageRef":137},{"kw":"bare-os-coreutils","pageRef":137},{"kw":"developer","pageRef":138},{"kw":"devguide","pageRef":138},{"kw":"develop","pageRef":138},{"kw":"script","pageRef":138},{"kw":"asyncfunction","pageRef":138},{"kw":"ctx","pageRef":138},{"kw":"bare-os","pageRef":138},{"kw":"guide","pageRef":138},{"kw":"07","pageRef":138},{"kw":"apps","pageRef":138},{"kw":"beyond","pageRef":138},{"kw":"the","pageRef":138},{"kw":"shell","pageRef":138},{"kw":"chapter","pageRef":138},{"kw":"what","pageRef":138},{"kw":"realistic","pageRef":138},{"kw":"today","pageRef":138},{"kw":"devguide-07-apps-beyond-the-shell","pageRef":138},{"kw":"7","pageRef":138},{"kw":"is","pageRef":138},{"kw":"developer","pageRef":139},{"kw":"devguide","pageRef":139},{"kw":"develop","pageRef":139},{"kw":"script","pageRef":139},{"kw":"asyncfunction","pageRef":139},{"kw":"ctx","pageRef":139},{"kw":"bare-os","pageRef":139},{"kw":"guide","pageRef":139},{"kw":"08","pageRef":139},{"kw":"testing","pageRef":139},{"kw":"and","pageRef":139},{"kw":"debugging","pageRef":139},{"kw":"chapter","pageRef":139},{"kw":"devguide-08-testing-and-debugging","pageRef":139},{"kw":"8","pageRef":139},{"kw":"developer","pageRef":140},{"kw":"devguide","pageRef":140},{"kw":"develop","pageRef":140},{"kw":"script","pageRef":140},{"kw":"asyncfunction","pageRef":140},{"kw":"ctx","pageRef":140},{"kw":"bare-os","pageRef":140},{"kw":"guide","pageRef":140},{"kw":"09","pageRef":140},{"kw":"security","pageRef":140},{"kw":"and","pageRef":140},{"kw":"trust","pageRef":140},{"kw":"chapter","pageRef":140},{"kw":"mindset","pageRef":140},{"kw":"devguide-09-security-and-trust","pageRef":140},{"kw":"9","pageRef":140},{"kw":"developer","pageRef":141},{"kw":"devguide","pageRef":141},{"kw":"develop","pageRef":141},{"kw":"script","pageRef":141},{"kw":"asyncfunction","pageRef":141},{"kw":"ctx","pageRef":141},{"kw":"bare-os","pageRef":141},{"kw":"guide","pageRef":141},{"kw":"10","pageRef":141},{"kw":"glossary","pageRef":141},{"kw":"and","pageRef":141},{"kw":"faq","pageRef":141},{"kw":"chapter","pageRef":141},{"kw":"devguide-10-glossary-and-faq","pageRef":141},{"kw":"developer","pageRef":142},{"kw":"devguide","pageRef":142},{"kw":"develop","pageRef":142},{"kw":"script","pageRef":142},{"kw":"asyncfunction","pageRef":142},{"kw":"ctx","pageRef":142},{"kw":"bare-os","pageRef":142},{"kw":"guide","pageRef":142},{"kw":"11","pageRef":142},{"kw":"kernel","pageRef":142},{"kw":"pear","pageRef":142},{"kw":"cookbook","pageRef":142},{"kw":"chapter","pageRef":142},{"kw":"extensions","pageRef":142},{"kw":"and","pageRef":142},{"kw":"workflows","pageRef":142},{"kw":"devguide-11-kernel-pear-cookbook","pageRef":142},{"kw":"developer","pageRef":143},{"kw":"devguide","pageRef":143},{"kw":"develop","pageRef":143},{"kw":"script","pageRef":143},{"kw":"asyncfunction","pageRef":143},{"kw":"ctx","pageRef":143},{"kw":"bare-os","pageRef":143},{"kw":"guide","pageRef":143},{"kw":"12","pageRef":143},{"kw":"bare","pageRef":143},{"kw":"modules","pageRef":143},{"kw":"and","pageRef":143},{"kw":"pear","pageRef":143},{"kw":"ecosystem","pageRef":143},{"kw":"chapter","pageRef":143},{"kw":"the","pageRef":143},{"kw":"devguide-12-bare-modules-and-pear-ecosystem","pageRef":143}]}