Skip to main content
just-bash is a terminal emulator from Vercel designed to provide agents with an in-process bash emulator with a limited set of tools. We offer the ability to use Archil disks from just-bash for agent environments where you do not have the ability to mount (such as AWS Lambda), and do not want to use a sandbox. For all users of just-bash, we recommend moving to Serverless execution, which gives you a full Linux environment to run commands like bash, node, and python on your disk data. Our just-bash integration is built by linking our Typescript package against our native Linux client. As a result, it’s only available on x86_64 and aarch64 Linux machines.

Usage

You use the Archil just-bash integration through the exported ArchilFs file system. In order to give your agent the ability to use the archil CLI to manage delegations, we recommend also adding archil as a custom command with createArchilCommand.
import { ArchilClient } from '@archildata/client';
import { ArchilFs, createArchilCommand } from "@archildata/just-bash";
import { Bash } from "just-bash";

const client = await ArchilClient.connect({
  region: 'aws-us-east-1',
  diskName: 'myaccount/agent-workspace',
});

const fs = await ArchilFs.create(client);
const bash = new Bash({
  fs,
  customCommands: [createArchilCommand(client, fs)],
});

const result = await bash.exec("ls -la /");
console.log(result.stdout);

await bash.exec('echo "hello world" > /greeting.txt');
const cat = await bash.exec("cat /greeting.txt");
console.log(cat.stdout); // "hello world"

Delegations

Writes through ArchilFs and the bash executor go through Archil’s delegation system. writeFile and mkdir handle delegations automatically when possible; for explicit control:
const inodeId = await fs.resolveInodeId("/mydir");
await client.checkout(inodeId);

await bash.exec('echo "hello" > /mydir/newfile.txt');

await client.checkin(inodeId);