@north-light/env-docker
v0.3.588
Published
Docker connection manager for the crouter SDK — start, attach to, and stop a crtrd container over the docker CLI. Zero crouter imports.
Keywords
Readme
@north-light/env-docker — start and attach to a crtrd container from Node
@north-light/env-docker starts, attaches to and stops a crtrd (the crouter daemon) Docker container through the docker CLI, and hands back the connection settings that @north-light/sdk takes. It has no dependencies, including on the SDK.
It is not a Docker client library or an orchestrator: it runs one container and tells you how to reach it. The image contains no model credential, so you configure a provider inside the container before an agent run can do anything.
Docs · SDK · crouter repository · Source
Install
npm install @north-light/env-docker @north-light/sdkThe Docker CLI must be on PATH, and able to pull ghcr.io/northlight-systems/crtrd (or the image you pass).
Start a container
import { start } from '@north-light/env-docker';
import Crouter from '@north-light/sdk';
const env = await start({
name: 'my-crouter',
volume: 'my-agent-home',
});
const client = new Crouter(env.connection());
console.log(await client.system.health());
await env.stop();start() creates a container from ghcr.io/northlight-systems/crtrd:latest unless you pass image, generates a bearer token, grants the privileges the image's sandbox launcher needs (SYS_ADMIN and NET_ADMIN, unconfined seccomp and AppArmor), binds the mapped port to 127.0.0.1, and waits for /healthz. connection() returns { baseURL, headers }, the shape new Crouter(...) takes. stop() removes the container.
Options: env sets container environment variables, port selects a host port, volume mounts a named Docker volume at /volume, the image's declared volume. A named volume keeps canvas state, memory and installed credentials when the container is recreated.
Attach to an existing container
import { attach } from '@north-light/env-docker';
const env = await attach('my-crouter');
const connection = env.connection();
await env.stop(); // stops the container but does not remove itattach(name) reads the container's mapped port and its CRTRD_TOKEN.
Related
@north-light/sdk— the client that consumesconnection().docker/README.md— running thecrtrdimage withdocker run, its environment variables, and building it locally.- Main repository — the
crtrCLI, thecrtrddaemon.
License
Proprietary. Copyright (c) 2026 Northlight Systems. All rights reserved. See LICENSE.
