Execution Environments
PreviewIsolated runtimes for code execution, dependency management and long jobs.
An execution environment is a disposable machine: a filesystem, a runtime, a resource ceiling and an egress profile.
Environment classes#
Lifecycle#
- 1
Provision
Created on first
code.executestep with the declared runtime and egress profile. - 2
Prepare
Dependencies installed under the
package-installprofile, then egress is narrowed. - 3
Execute
Commands run with captured stdout, stderr, exit code and duration.
- 4
Snapshot
Filesystem snapshotted at checkpoints so a resumed run does not rebuild from scratch.
- 5
Destroy
Environment torn down at run end; published artifacts survive, the machine does not.
const env = await pimsy.environments.create({
class: class="tok-str">"standard",
runtime: class="tok-str">"node@class="tok-num">22",
egress: class="tok-str">"package-install",
setup: [class="tok-str">"pnpm install --frozen-lockfile"]
});
const result = await env.exec(class="tok-str">"pnpm test -- --reporter=json");
console.log(result.exitCode, result.durationMs);Last updated 2026-09-01

