Runtime Flow
pier <name> <cmd...>wraps portless and records<name>.localhost -> cwd- CLI ensures the bridge process is running
- Extension content script activates only on localhost-style pages
- Content script opens WebSocket /terminal with token and page context
- Bridge resolves the page hostname using the workspace registry
- Bridge creates or reuses shell session (node-pty with pipe fallback)
- xterm.js renders terminal output in-page
Repository Structure
packages/shared: shared constants, settings normalization, and WebSocket protocol helperspackages/cli-core: CLI commands, config store, workspace routing registrypackages/bridge-core: bridge HTTP/WebSocket server and shell session managementpackages/extension-src: extension source and static assetsextension/: generated unpacked extension outputcli/,server/, andbin/: JS shims loading compiled dist output
Extension Build Pipeline
pnpm run build:extension bundles the shared runtime, content script, options UI, copies static extension assets, and removes stale vendored JS.
Packaging Model
- Published package is a single npm package:
@malviyahimanshu/pier - Internal packages are implementation details
prepackruns build and checks so published tarballs include generated extension output and compiled dist files
