BrowserShell is a Manifest V3 Chrome extension with four layers:

Content script → Overlay iframe → Shell executor → Chrome API
                     ↕
              Page inject scripts (DOM commands)

Components

LayerLocationRole
Content scriptsrc/content/overlay.tsInjects Quake-style iframe on every page
Terminal hostsrc/terminal/host.tsxterm.js UI, input, history, links
Shell executorsrc/shell/executor.tsParser, pipes, aliases, dispatch
Commandssrc/commands/86 handlers with defineCommand() metadata
Chrome APIsrc/chrome/api.tsMockable wrapper over chrome.*
VFSsrc/vfs/Virtual paths for tabs, bookmarks, history, …
Backgroundsrc/background/Privileged actions (downloads, toggle)

Command registration

Every command exports a Command object:

export const tabs = defineCommand({
  name: 'tabs',
  description: 'List open tabs',
  usage: 'tabs [--json]',
  examples: ['tabs', 'tabs --json'],
  category: 'tabs',
  async handler(args, ctx) { /* ... */ },
});

Registered in src/commands/manifest.ts and validated by tests.

Testing

154 tests with a mock ChromeAPI and happy-dom for DOM commands. No live browser required for CI.

Building

npm run build

Produces a loadable extension in dist/. See CONTRIBUTING for adding commands.