Wouldn't launching a browser within a bare-bones X11 session in some kind of kiosk mode during system initialization be a proper solution?
Your project is essentially an incomplete implementation of a shell where all commands are builtins, and the interactivity is limited by what you directly programmed in JavaScript.
What you are trying to make is a lot harder than you think, you first need to emulate a CPU and go from there, not read whatever user types and try to behave like a Linux system, which ChatGPT can do already.