Skip to content

Unix

const Unix: () => RuntimeAwareBuilder & object = UnixFn

Defined in: packages/runtime/src/root/builder.ts:387

Create a runtime-aware Unix builder with batteries included.

bare(): RuntimeAwareBuilder

Same chaining surface as Unix, but without stdSystem(), container management, or TTY auto-detect.

RuntimeAwareBuilder

This is the “one import, one line” entry point for @fishnet/runtime. Unlike core’s UnixBuilder — which produces an image and hands it to a runtime (runtime.boot(image)) — this builder auto-detects the host platform (detectRuntime), auto-wires the TTY on Node.js (autoTty), and bundles the stdSystem() + container-management presets by default. Reach for Unix.bare() when you want the same chaining surface without any defaults.

Every method returns a new builder — state is never mutated.

A fresh RuntimeAwareBuilder pre-loaded with the standard system preset, container management, and platform / TTY auto-detection.

import { Unix } from '@fishnet/runtime'
// One import, one line — a full shell on the host TTY:
await Unix().boot()

Compose extra extensions, then drive a container programmatically:

import { Unix } from '@fishnet/runtime'
import { pkgManager } from '@fishnet/core'
const root = await Unix()
.use(pkgManager({ sources: ['https://registry.example/'] }))
.env('PS1', '\\w $ ')
.start()
await root.spawn('sh', ['-c', 'pkg install jq && jq --version'])