This project is a continuation of Fake Linux Terminal. The aim is to create a persistent Unix-like system in the browser. With the help from some backend code.
-
~/.bashrcand/etc/bashrcfiles -
$PS1variable- functions in prompt (backticks)
-
$PATHvariable -
$IFSvariable -
$?variable -
$PWDvariable -
:and.shorcuts - subshells
- double-quote expressions
- variable assignments
- arrays
- pipes
- redirects (
>,>>, and<) - JavaScript programs using web workers
- Bash scripts
- custom intepreters with shebang
- variable expansions:
-
${DATABASE_URL:="localhost"} -
USER_ID=${1:?"Error, arg missing!"} -
${VAR:-default} -
${VAR-default} -
${var+alternative} -
${var:+alternative} -
${VAR/x/y}- replace -
${VAR//x/y}- replace all -
${TEXT:4}${TEXT:0:4}- slice -
${FILE%.*}- remove traling non-greedy -
${PATH%%:*}remove traling greedy -
${PATH##*/}- remove greedy before -
EXTENSION=${FILE#*.}- remove before -
${NAME^}- camel case -
${NAME^^}- upper case -
LEN=${#NAME}- string length -
${!POINTER}- indirect variable
-
- run in background
& - process substitution
<(command)and>(command) - extract commands like
catorgrepinto scripts in/bin - glob patterns
- arrays
- for loop
- command arguments
- sort the matches
- single quotes around a pattern
- patterns with
~or a variable in them - skip dotfiles unless the pattern starts with a dot
-
*/to match directories only
-
testcommand - aliases
- functions
-
name() { ...; }andfunction name { ...; } - positional parameters
$1,$#,$*,$@scoped to the call - visible in subshells, pipelines and command substitution
- redirects on the call,
f > file -
return -
shift
-
- order: keywords => aliases => function => builtins => executables
-
printf -
kill -
exit -
ps -
type -
if -
&&/|| -
pushd/popd -
while,until -
for -
while read line -
case/esac -
$0-$9 -
$@/$*/$# -
read -p "contunue? (y/n) " - history
- export
- unset
- completion
-
envcommand - scripts in fs as REPLs
-
/bin/jsrepl and interpreter -
/bin/bashas subshell -
/bin/phpusing uniter demo -
/bin/head -
/bin/tail -
/bin/wc -
/bin/cut -
/bin/uniq -
/bin/sort -
/bin/tr -
/bin/cp -
/bin/mv -
/bin/readlink -
/bin/touch -
/bin/chgrp -
/bin/du -
/bin/tee -
/bin/xargs -
/bin/basename -
/bin/dirname -
/bin/mktemp -
/bin/whoami -
/bin/who -
/bin/date -
/bin/uname -
/bin/hostname -
/bin/js -
/bin/lolcat -
/bin/fortune -
/bin/python -
/bin/sleep -
/bin/vi(jsvi) -
/bin/nano(micro - add to npm)
-
- permissions (enforced on the server somehow)
- login (guest without password)
-
/etc/issue -
/etc/motd -
/etc/group -
CTRL+Dstop the process
fetch(neofetch)rfc(RFC viewer usingless)lessrecord- save commands URL hashcreditshelp
The Bash module is covered by unit tests that run in Node with Vitest:
npm test # run the suite once
npm run test:watch # re-run on change
npm run coverage # run with a coverage report in coverage/They run on a real LightningFS backed by memory, so file modes, symlinks and error codes
behave as they do in the browser. The worker IPC is tested by standing in for the Web Worker
and talking to the shell's mitty Host over the same channel the worker prelude uses — see
test/helpers/. Anything that needs a real browser (the worker prelude itself, jQuery
Terminal) is left to end-to-end tests.
- Bash expands aliases before processing keyboards, which allows changing syntax. By design Hacking Cafe will only expand aliases as commands.
$@works the same as"$@"(it may change).- An error a JavaScript program catches from
require()arrives with itsname,messageand the main thread'sstack, but not custom properties —e.codeis undefined, so match on the message to tellENOENTfrom a real failure.
If you want to acquire a commercial license, you can contact me via jcubic@jcubic.pl.
Copyright (c) 2026 Jakub T. Jankiewicz <https://jakub.jankiewicz.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>