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

@computesdk/archil

v0.4.37

Published

Archil provider for ComputeSDK - exec commands against an Archil disk

Readme

@computesdk/archil

Archil provider for ComputeSDK.

Archil sandboxes are persistent Linux VMs, and that is what this provider creates by default:

  • create() provisions a VM and waits until it is running. getById fetches a VM (resuming it if paused or stopped), list returns the account's VMs, and destroy stops and deletes one.
  • runCommand, streaming (onStdout/onStderr) and startProcess run on Archil's native process API over a short-lived WebSocket (a fresh connection URL per process). Files move through Archil's native file transfer API.
  • Snapshots are paused forks of a VM; create({ snapshotId }) restores one into a new VM. sandbox.pause()/resume() pause the VM natively (also on sandbox.getInstance()).

The older disk exec surface (a fresh container per command with an existing disk mounted at /mnt/archil) is still available as an explicit opt-in; see Exec mode.

Installation

npm install @computesdk/archil

Configuration

| Option | Env var | Required | Description | | ----------- | ------------------ | -------- | ---------------------------------------------------- | | apiKey | ARCHIL_API_KEY | yes | Archil control-plane API key | | region | ARCHIL_REGION | yes | Archil region (e.g. aws-us-east-1) | | baseUrl | — | no | Override control-plane URL (for testing) | | execution | ARCHIL_EXECUTION | no | "persistent" (default) or "exec" (disk exec) |

Usage

import { archil } from '@computesdk/archil';

const provider = archil();

const sandbox = await provider.sandbox.create({
  name: 'ci-job',
  baseImage: 'node:24-bookworm', // OCI image; `image` / `templateId` work too
  vcpus: 4,                      // or `cpu` / `cpus`, or `sizeClass: 'lg'`
  memoryMiB: 8192,               // or `memory`
  env: { CI: '1' },              // or `envs`
  maxTtlSeconds: 3600,           // or `timeout` in ms; per powered-on session
  sandbox: { /* extra Archil create fields */ },
});

// Filesystem state, installs and background processes persist between calls.
// `cwd` and `env` apply to every part of a compound command.
await sandbox.runCommand('npm ci && npm test', { cwd: '/repo', env: { CI: '1' } });

// Native streaming and processes.
await sandbox.runCommand('npm run build', { onStdout: (c) => process.stdout.write(c) });
const proc = await sandbox.startProcess('cat', { stdin: true });
await proc.write('hello\n');
await proc.closeStdin();
await proc.wait();

// Pause/resume the same VM (memory, processes and disk preserved).
await sandbox.pause!();
await sandbox.resume!();

await provider.sandbox.destroy(sandbox.sandboxId);

The shared ephemeral create option overrides the configured mode per sandbox: ephemeral: true resolves an exec-mode disk handle (requires diskId), ephemeral: false provisions a VM.

Snapshots

const snapshot = await provider.snapshot.create(sandbox.sandboxId, { name: 'golden' });
const restored = await provider.sandbox.create({ snapshotId: snapshot.id });
const snapshots = await provider.snapshot.list();

// Archil deletes forks before their parent (it returns 409 otherwise):
await provider.sandbox.destroy(restored.sandboxId);
await provider.snapshot.delete(snapshot.id);
await provider.sandbox.destroy(sandbox.sandboxId);

A snapshot is a fork of the source VM's memory and disk, paused so it holds state without running, and named csdk-snap-<name>-<suffix>. snapshot.list() returns VMs with that prefix and sandbox.list() leaves them out. Restoring forks the snapshot again into an independent VM. Snapshot ids are ordinary Archil sandbox ids, so any VM id can be passed as snapshotId.

Declared capabilities, observed live: provider.sandbox.pause is { memory: true, createOptions: { ephemeral: false } } and provider.snapshot.capabilities is { scope: 'rootfs', memory: true, destroysSource: false, createOptions: { ephemeral: false } } — the whole disk (/tmp, /root, /opt, …) and running processes survive both, and the source keeps running after a snapshot. A process must outlive the command that started it to survive: use startProcess or setsid, since Archil reaps a command's process group (including nohup … & children) when the command exits.

Exec mode (opt-in)

const provider = archil({ execution: 'exec' }); // or ARCHIL_EXECUTION=exec

const sandbox = await provider.sandbox.create({ diskId: 'dsk-0000000000000000' });
await sandbox.runCommand('echo hello > /mnt/archil/note && cat /mnt/archil/note');

Each command runs in a fresh Archil-managed container with the disk mounted at /mnt/archil. create() requires diskId; passing diskId without opting in throws. getById/list operate on disks, destroy is a no-op (disk lifecycle is managed by Archil), and ids starting with dsk- are always treated as disk handles. cwd, env and installs do not persist between commands.

Supported operations

| Method | Persistent VM (default) | Exec mode (opt-in) | | ----------------- | ----------------------- | ------------------ | | create | ✅ Provisions a VM, waits for running. | ✅ Resolves an existing disk from diskId. | | getById | ✅ Fetches the VM; resumes if paused/stopped. | ✅ Fetches the disk. | | list | ✅ All VMs on the account, minus snapshots. | ✅ All disks visible to the API key. | | destroy | ✅ Stops and deletes the VM. | no-op | | runCommand | ✅ Native process API. | ✅ HTTP exec endpoint. | | Streaming | ✅ Native, live over the process WebSocket. | Output delivered when the command exits. | | startProcess | ✅ Native (stdin, kill, wait). | ❌ | | filesystem | ✅ Native file transfer for read/write; mkdir/readdir/exists/remove run shell commands. | ✅ Maps paths into /mnt/archil. | | Snapshots | ✅ create / list / delete / restore. | ❌ | | pause/resume | ✅ Native; memory and processes survive. | ❌ | | getUrl | Only for ports already published as sandbox endpoints (not proven live). | ❌ |

Limitations

  • list() is one Archil API call: Archil's sandbox list endpoint returns every sandbox in a single response (there is no cursor to page through).
  • kill(signal) on a native process cancels it through Archil's process control; Archil does not accept a signal name, so the result reports the requested signal (SIGKILL by default) with exit code 137. Timed-out commands report exit code 124.
  • A VM with live forks (snapshots or VMs restored from it) cannot be deleted until those forks are deleted.
  • Exec mode: responses are truncated to ~5 MB by the Archil control plane, and raw runCommand strings are not rewritten — commands that access the disk must use /mnt/archil themselves.

Standard sizes (persistent VMs only)

archil().sizes.list() / resolve('sm') declares exact xs, sm, md, lg, xl, 2xl, and 3xl requests. create({ sizeClass: 'sm' }) maps to adapter vcpus: 1, memoryMiB: 2048, then native vcpuCount / memSizeMiB. Exec mode (execution: 'exec' or ephemeral: true) reports unavailable for VM sizing. Attach (sandboxId/instanceId) and fork (snapshotId) standard requests reject as unsupported before API calls; those paths cannot apply a new VM size. Conflicting native controls reject too. 3xl (32 vCPU / 64 GiB) is Archil's maximum shape.

The persistent API documents 1–32 vCPUs and 256–65536 MiB, but adapter declarations are not account/quota/region guarantees or measurements. Discovery is pure and needs no credentials. Successful standardized creates expose frozen instance.sizing request metadata, not observed CPU/RAM. Local mock coverage uses the installed disk SDK; it does not certify separately locked consumer versions or published artifacts. Legacy creates without sizeClass remain unchanged.