{"id":49038820,"url":"https://github.com/lifo-sh/lifo","last_synced_at":"2026-05-05T18:01:42.863Z","repository":{"id":340106624,"uuid":"1164569280","full_name":"lifo-sh/lifo","owner":"lifo-sh","description":"A browser-native operating system. Unix/Linux reimagined where the browser IS the kernel and Web APIs ARE syscalls. 60+ commands, bash-like shell, virtual filesystem, and IndexedDB persistence.","archived":false,"fork":false,"pushed_at":"2026-03-19T05:58:59.000Z","size":63245,"stargazers_count":471,"open_issues_count":8,"forks_count":31,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-28T08:30:18.482Z","etag":null,"topics":["browser","linux","sandbox"],"latest_commit_sha":null,"homepage":"https://lifo.sh","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifo-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-23T08:32:23.000Z","updated_at":"2026-03-27T17:18:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lifo-sh/lifo","commit_stats":null,"previous_names":["lifo-sh/lifo-sh"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lifo-sh/lifo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifo-sh%2Flifo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifo-sh%2Flifo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifo-sh%2Flifo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifo-sh%2Flifo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifo-sh","download_url":"https://codeload.github.com/lifo-sh/lifo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifo-sh%2Flifo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32661193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","linux","sandbox"],"created_at":"2026-04-19T14:00:38.531Z","updated_at":"2026-05-05T18:01:42.857Z","avatar_url":"https://github.com/lifo-sh.png","language":"TypeScript","funding_links":[],"categories":["Operating Systems"],"sub_categories":[],"readme":"# Lifo\n\nA Linux-like operating system that runs natively in the browser. Not a VM, not an emulator -- a reimagination of Unix where the browser runtime is the kernel and browser APIs are the system calls.\n\n```\n┌──────────────────────────────────────────────────┐\n│                  Terminal UI                      │  xterm.js + Tokyo Night theme\n├──────────────────────────────────────────────────┤\n│                    Shell                          │  bash-like interpreter\n├──────────────────────────────────────────────────┤\n│            Command Registry / $PATH              │  ES module command map\n├───────────┬────────────┬─────────────────────────┤\n│ Coreutils │ Net Cmds   │ User Packages           │  each cmd = async function\n├───────────┴────────────┴─────────────────────────┤\n│          Node.js Compatibility Layer             │  thin wrappers over OS APIs\n├──────────────────────────────────────────────────┤\n│           Virtual Filesystem (VFS)               │  in-memory + IndexedDB persistence\n├──────────────────────────────────────────────────┤\n│              Kernel API Layer                    │  unified browser API wrappers\n├──────────────────────────────────────────────────┤\n│               Browser APIs                       │  fetch, streams, OPFS, etc.\n└──────────────────────────────────────────────────┘\n```\n\n## Getting Started\n\n```bash\npnpm install\npnpm dev\n```\n\nOpen http://localhost:5173 in a modern browser. You'll be greeted with a fully functional terminal.\n\n```bash\npnpm build        # Production build\npnpm test         # Run test suite\npnpm typecheck    # Type check without emitting\n```\n\n## What's Inside\n\n### Kernel\n\n- **Virtual Filesystem (VFS)** -- synchronous in-memory INode tree with full POSIX-like semantics (read, write, stat, mkdir, symlinks, hard links, permissions)\n- **Virtual Providers** -- `/proc` exposes system info (uptime, meminfo, cpuinfo, version) and `/dev` provides device files (null, zero, random, urandom)\n- **Persistence** -- IndexedDB-backed filesystem persistence with serialization/deserialization of the entire INode tree\n\n### Shell\n\nA bash-like shell with:\n\n- Full **lexer/parser/interpreter** pipeline producing an AST\n- **Pipes** (`ls | grep foo | wc -l`), **redirects** (`\u003e`, `\u003e\u003e`, `\u003c`, `2\u003e`, `\u0026\u003e`)\n- **Logical operators** (`\u0026\u0026`, `||`), **sequences** (`;`), **background** (`\u0026`)\n- **Variable expansion** (`$VAR`, `${VAR:-default}`), **command substitution** (`$(...)`)\n- **Glob expansion** (`*.txt`, `**/*.js`), **tilde expansion** (`~`), **brace expansion** (`{a,b,c}`)\n- **Tab completion** for commands, files, and directories\n- **Command history** with reverse search\n- **Job control** (Ctrl+C, `fg`, `bg`, `jobs`)\n- **Builtins**: `cd`, `pwd`, `export`, `alias`, `source`, `read`, `test`, `echo`, and more\n\n### 60+ Commands\n\n| Category | Commands |\n|---|---|\n| **Filesystem** | `ls`, `cat`, `cp`, `mv`, `rm`, `mkdir`, `rmdir`, `touch`, `ln`, `stat`, `find`, `tree`, `du`, `df`, `chmod`, `file`, `basename`, `dirname`, `realpath`, `mktemp` |\n| **Text** | `grep`, `sed`, `awk`, `head`, `tail`, `sort`, `uniq`, `wc`, `cut`, `tr`, `diff`, `nl`, `rev` |\n| **I/O** | `printf`, `tee`, `xargs`, `yes` |\n| **Network** | `curl`, `wget`, `ping`, `dig` |\n| **System** | `ps`, `top`, `kill`, `env`, `uname`, `whoami`, `hostname`, `uptime`, `free`, `date`, `cal`, `bc`, `sleep`, `watch`, `which`, `man`, `help` |\n| **Archive** | `tar`, `gzip`, `gunzip`, `zip`, `unzip` |\n| **Runtime** | `node` (run JS with Node.js compat layer), `pkg` (package manager) |\n\n### Node.js Compatibility Layer\n\nRun JavaScript files with `node script.js` or `node -e \"code\"`. The compatibility layer maps 15 Node.js standard library modules to browser APIs:\n\n`fs`, `path`, `events`, `buffer`, `util`, `os`, `process`, `http`, `child_process`, `stream`, `url`, `timers`, `crypto`, `console`\n\n### Package Manager\n\n```bash\npkg install \u003curl\u003e    # Install a package from URL\npkg remove \u003cname\u003e    # Uninstall a package\npkg list             # List installed packages\npkg info \u003cname\u003e      # Show package details\n```\n\n## Filesystem Hierarchy\n\n```\n/\n├── home/user/          # User home directory ($HOME)\n├── tmp/                # Temporary files (in-memory)\n├── etc/                # System configuration\n├── var/log/            # System logs\n├── usr/bin/            # Installed package binaries\n├── proc/               # Virtual: system info (cpuinfo, meminfo, uptime)\n├── dev/                # Virtual: devices (null, zero, random, urandom)\n└── bin/                # Core commands\n```\n\n## Tech Stack\n\n- **TypeScript** (strict mode, ESM throughout)\n- **Vite** for builds\n- **xterm.js** + WebGL addon for terminal rendering\n- **Vitest** for testing\n- **Target**: Chrome 110+, Firefox 110+, Safari 16.4+\n\n## Project Structure\n\n```\nsrc/\n├── main.ts              # Boot sequence\n├── kernel/              # VFS, persistence, virtual providers\n├── shell/               # Lexer, parser, interpreter, expander, completer\n├── commands/            # All 60+ commands organized by category\n├── node-compat/         # Node.js standard library shims\n├── pkg/                 # Package manager\n├── terminal/            # xterm.js wrapper\n└── utils/               # Path, args, glob, colors, encoding, archive\ntests/                   # Mirrors src/ structure with full coverage\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifo-sh%2Flifo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifo-sh%2Flifo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifo-sh%2Flifo/lists"}