npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agentkernel

v0.16.0

Published

Node.js SDK for agentkernel — run AI coding agents in secure, isolated microVMs

Readme

agentkernel

Node.js SDK for agentkernel — run AI coding agents in secure, isolated microVMs.

Install

npm install agentkernel

Requires Node.js 20+. Zero HTTP dependencies (uses native fetch).

Quick Start

import { AgentKernel } from "agentkernel";

const client = new AgentKernel();

// Run a command in a temporary sandbox
const result = await client.run(["echo", "hello"]);
console.log(result.output); // "hello\n"

Sandbox Sessions

Create a persistent sandbox with automatic cleanup:

await using sb = await client.sandbox("my-project", {
  image: "python:3.12-alpine",
});

await sb.run(["pip", "install", "numpy"]);
const result = await sb.run(["python3", "-c", "import numpy; print(numpy.__version__)"]);
console.log(result.output);
// sandbox auto-removed when scope exits

Exec Options

Run commands with a working directory, environment variables, or as root:

const result = await client.execInSandbox("my-sandbox", ["npm", "start"], {
  workdir: "/app",
  env: ["NODE_ENV=production"],
  sudo: true,
});

Works on sandbox sessions too:

await using sb = await client.sandbox("dev");
await sb.run(["pip", "install", "-r", "requirements.txt"], {
  workdir: "/app",
  sudo: true,
});

Git Source Cloning

Clone a git repo into the sandbox at creation time:

const sb = await client.createSandbox("my-project", {
  image: "node:20-alpine",
  source_url: "https://github.com/user/repo.git",
  source_ref: "main",
});

Persistent Volumes

Mount volumes that persist across sandbox restarts:

// First create volumes via CLI: agentkernel volume create mydata

const sb = await client.createSandbox("my-project", {
  image: "node:20-alpine",
  volumes: ["mydata:/data", "cache:/tmp/cache:ro"],
});

// Data in /data persists across sandbox restarts
await sb.run(["sh", "-c", "echo hello > /data/test.txt"]);

File Operations

Read, write, and delete files in a sandbox:

// Write a file
await client.writeFile("my-sandbox", "app/main.py", "print('hello')");

// Read a file
const file = await client.readFile("my-sandbox", "app/main.py");
console.log(file.content);

// Delete a file
await client.deleteFile("my-sandbox", "app/main.py");

// Batch write multiple files at once
await client.writeFiles("my-sandbox", {
  "/app/index.js": "console.log('hi')",
  "/app/package.json": '{"name":"app"}',
});

Detached Commands

Run long-lived processes in the background and retrieve their output later:

// Start a background process
const cmd = await client.execDetached("my-sandbox", ["python3", "train.py"]);
console.log(`Started: ${cmd.id} (pid ${cmd.pid})`);

// Check status
const status = await client.detachedStatus("my-sandbox", cmd.id);
console.log(status.status); // "running" | "completed" | "failed"

// Get logs
const logs = await client.detachedLogs("my-sandbox", cmd.id);
console.log(logs.stdout);

// Get stderr only
const stderr = await client.detachedLogs("my-sandbox", cmd.id, "stderr");

// List all detached commands
const all = await client.detachedList("my-sandbox");

// Kill a running command
await client.detachedKill("my-sandbox", cmd.id);

Streaming

for await (const event of client.runStream(["python3", "script.py"])) {
  if (event.type === "output") process.stdout.write(String(event.data.data));
}

Configuration

const client = new AgentKernel({
  baseUrl: "http://localhost:18888", // default
  apiKey: "sk-...",                 // optional
  timeout: 30000,                   // default: 30s
});

Or use environment variables:

export AGENTKERNEL_BASE_URL=http://localhost:18888
export AGENTKERNEL_API_KEY=sk-...

API

client.health()

Health check. Returns "ok".

client.run(command, options?)

Run a command in a temporary sandbox.

await client.run(["echo", "hello"]);
await client.run(["python3", "-c", "print(1)"], {
  image: "python:3.12-alpine",
  profile: "restrictive",
  fast: false,
});

client.runStream(command, options?)

Run a command with SSE streaming output. Returns an AsyncGenerator<StreamEvent>.

client.listSandboxes()

List all sandboxes.

client.createSandbox(name, options?)

Create a new sandbox. Options: image, vcpus, memory_mb, profile, source_url, source_ref, volumes.

client.getSandbox(name)

Get sandbox info.

client.removeSandbox(name)

Remove a sandbox.

client.execInSandbox(name, command, options?)

Run a command in an existing sandbox. Options: env, workdir, sudo.

client.readFile(name, path)

Read a file from a sandbox.

client.writeFile(name, path, content, options?)

Write a file to a sandbox.

client.deleteFile(name, path)

Delete a file from a sandbox.

client.writeFiles(name, files)

Write multiple files to a sandbox in one request. files is a Record<string, string> of path to content.

client.execDetached(name, command, options?)

Start a detached (background) command. Returns a DetachedCommand.

client.detachedStatus(name, cmdId)

Get the status of a detached command.

client.detachedLogs(name, cmdId, stream?)

Get stdout/stderr from a detached command. Pass "stderr" to get only stderr.

client.detachedKill(name, cmdId)

Kill a detached command.

client.detachedList(name)

List all detached commands in a sandbox.

client.sandbox(name, options?)

Create a sandbox session with automatic cleanup. Returns a SandboxSession that implements AsyncDisposable.

License

MIT