The Archil TypeScript SDK is theDocumentation Index
Fetch the complete documentation index at: https://docs.archil.com/llms.txt
Use this file to discover all available pages before exploring further.
disk package on npm. Itβs a pure-JavaScript control-plane client and CLI: create disks, list and inspect them, manage who can mount them, and run commands against them with disk.exec.
disk has no native dependencies and works on any platform Node.js does. For the rare case where you need raw protocol access from Node (inodes, delegations, byte-level reads), thereβs a separate @archildata/native package β most users will not need it.
| Package | When to use |
|---|---|
disk | Manage disks, run commands with disk.exec, manage API keys. The default. |
@archildata/native | Speak the Archil filesystem protocol directly from Node. Linux/macOS only. Not recommended unless youβre building a custom client runtime. |
Looking for the FUSE mount client? Thatβs the
archil CLI, which mounts a disk as a real local filesystem. The TypeScript SDK does not mount disks; it talks to the control plane and runs serverless commands.Configuration
The recommended pattern is a module-namespace import with a one-timeconfigure call:
ARCHIL_API_KEY, ARCHIL_REGION) if omitted, so in most environments configure({}) β or skipping configure entirely β is enough.
For multi-tenant scripts that need multiple credentials in one process, instantiate Archil directly instead:
The API key is an account-level credential and is not the same thing as a disk token. API keys authenticate calls to the control plane (everything in this page); a disk token grants mount access to a single disk. See the disk users concept page.
Managing disks
Disk object itself, not top-level functions:
Executing commands
Disk.exec(command) runs a bash command inside a container with the file system already mounted, and returns stdout, stderr, exit code, and timing. See the Serverless Execution concept page for the full picture.
archil.exec({ disks, command }) instead of Disk.exec. See Mounting multiple disks in one command.
ExecResult
executeMs β the wall-clock time your command runs β in 1ms increments, with a 100ms minimum per call. Queue time is not billed. The HTTP response returns after 5 minutes, and stdout and stderr are each capped at 128 KiB per invocation β pipe larger outputs to a file on the disk instead.
Fan-out
Because eachexec runs in its own container, Promise.all is a map-reduce:
disk.exec into an AI agent loop.
Managing API keys
API keys are account-level, so these helpers live at the top level rather than on aDisk:
CLI
disk ships a CLI under the same name. See the disk CLI reference for the full command list.
Low-level protocol access
For the small number of integrations that need to speak Archilβs filesystem protocol directly from Node β inodes, delegations, byte-level reads, paginated directory enumeration β install@archildata/native alongside disk:
Disk.mount(), which lazy-loads the native client:
@archildata/native ships prebuilt binaries for Linux (x64, arm64, glibc) and macOS (arm64). On other platforms, mount() throws; the rest of disk still works.
If youβre tempted to reach for
@archildata/native to βrun a bash command on a disk,β use disk.exec instead β it gives you a real shell with the filesystem mounted in a container, with no native dependencies on the caller side.Need a bash executor inside Node?
The legacy@archildata/just-bash package implements a JavaScript bash interpreter that talks to a disk through @archildata/native. Itβs still published, but for almost every use case disk.exec is the better answer β it runs your command in a real container with the filesystem mounted, returns stdout/stderr/exit code, and has no native dependencies on the caller.