A bash-like easter egg terminal widget for websites. Drop one script tag in — users unlock it with the Konami code.
No package manager needed. Copy the built file into your project:
dist/firelin.min.js
Then include it in your HTML. Two integration patterns are supported, check Setup Guide for all settings and options.
<script defer src="/dist/firelin.min.js"></script>Loads the script once, configures the widget on load. Safe to paste into any <head>.
<script>
(function (d, s, id, config) {
var js,
el = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src =
"https://cdn.jsdelivr.net/npm/firelin-terminal/dist/firelin.min.js";
js.defer = true;
el.parentNode.insertBefore(js, el);
js.onload = function () {
if (window.FirelinTerminal) {
window.FirelinTerminal.create(config);
}
};
})(document, "script", "firelin-terminal-js", {
theme: "phosphor",
title: "mysite — bash",
osName: "mysite",
user: "guest",
welcomeMessage: "Welcome! Type help to get started.",
history: ["ls /projects", "whoami"],
packages: {
preload: ["hello"], // auto-install from public registry on first load
local: [
// private commands — never published to public registry
{
name: "myapp",
description: "My company commands",
version: "1.0.0",
src: "/js/myapp-cmd.js",
commands: ["myapp"],
},
],
},
});
</script>The terminal is hidden by default and revealed through:
| Method | Trigger |
|---|---|
| Desktop | ↑ ↑ ↓ ↓ ← → ← → B A (Konami code) |
| Mobile | Swipe up, up, down, down, left, right, left, right — then double-tap |
| CSS class | Any element with class shell clicked by the user |
<!-- Button that opens the terminal -->
<button class="shell">Open terminal</button>| Command | Description |
|---|---|
help |
List available commands |
man <cmd> |
Show manual page for a command |
ls [path] |
List directory contents |
cd [path] |
Change directory |
pwd |
Print working directory |
cat <file> |
Print file contents |
tail <file> |
Print last lines of a file |
find <path> [name] |
Search for files |
grep <pattern> <file> |
Search file contents |
touch <file> |
Create empty file |
mkdir <dir> |
Create directory |
cp <src> <dest> |
Copy file or directory |
mv <src> <dest> |
Move / rename |
rm [-r] <path> |
Remove file or directory |
nano <file> |
Basic text editor |
whoami |
Print current user |
su [user] |
Switch user |
top |
Live process table |
ping <host> |
Ping a host |
curl <url> |
Fetch a URL |
print <text> |
Print text to terminal |
theme [name] |
Switch color theme |
clear |
Clear terminal output |
apt <subcommand> |
Package manager |
| Key | Action |
|---|---|
↑ / ↓ |
Browse command history |
Tab |
Autocomplete command or path |
Ctrl+C |
Cancel running command (SIGINT) |
example/index.html shows both integration methods with live demos. Serve it locally alongside the built widget:
npm run dev
# then open http://localhost:8080/example/npm install # install dev dependencies
npm run dev # start dev server with hot reload
npm run build # produce dist/v1/firelin.widget.min.jsBuilt with vanilla JS + Webpack. No runtime dependencies.
GPL-3.0 — see LICENSE.
