laya-router
2026Solo build — open source (AGPL)
Open source: mistype a command and it opens or runs what you meant. Edit distance for spelling, a small decision model for meaning (“music app” → Spotify), and it learns from your picks.
- Python
- Bash
- systemd
- Hugging Face

spotfy opens Spotify. cd projcts goes to ~/Projects. gti psuh offers git push in an arrow-key menu. music app offers Spotify or Spotube. It hooks bash's command_not_found_handle, so it only ever sees lines bash couldn't run.
How it decides
| Step | What | Why |
|---|---|---|
| Spelling | Edit distance over desktop apps (and initials like yt, vsc), folders, $PATH commands and builtins |
Edit distance is near-perfect at spelling; a model isn't |
| Arguments | Fixes the command and a misspelled subcommand (git, systemctl, docker, npm… plus your history) | |
| Meaning | "web browser", "text editor" → apps whose description matches, ranked by the Laya decision model | The model is good at meaning, bad at letters |
| Learning | Every pick, or "none of these", is remembered | It stops asking once it knows |
It only acts without asking when there's one clear match or you've confirmed the same fix three times, and goes quiet for lines you keep rejecting.
Dashboard
laya dashboard shows what it fixed, what it learned (with a forget button), typos it had no answer for, a box to try typos safely, settings and an accuracy check. It listens on localhost only, needs a random token for every call, and stops itself when closed. The router is socket-activated and exits after 15 idle minutes.