@archildata/just-bash

中文文档
0.8.41发布于 2026/11/06MITTypeScriptESM + CJS构建来源已验证近 30 天下载 8.1万

Archil 文件系统适配器

中文使用文档
文档目录8 节
  1. 快速启动
  2. 使用您的代码
  3. 直接使用文件系统适配器
  4. 写入文件( 代表团)
  5. 子目录挂起
  6. 交互式 shell 引用
  7. 平台支持
  8. 支助

@archildata/ just- bash (英语)

未建议新项目. 随着Archil的无服务器执行(disk <id> exec <command>,或 Disk.exec() 从 disk 软件包),您可以在磁盘上运行命令,而无需站起客户端挂载或击打环境——命令运行在一个Archil管理的容器中,并带有磁盘预挂载并返回stdout/stderr/exit代码. 我们不再建议 @archildata/just-bash; 达到 disk exec 换句话说.

这个软件包仍然为已有的用户发布,他们围绕它构建了工具.

运行针对您云存储的点击命令 阿奇尔 不需要本地挂载。 工作包括脚本、CI管道和互动会议.

快速启动

如果您已经设置了 Archil 磁盘( 请参看 disk 对于设置,您可以在一个命令中启动 shell :

ARCHIL_DISK_TOKEN=my-secret-mount-token npx @archildata/just-bash aws-us-east-1 myaccount/my-disk

这会让你变成一个交互式的外壳。 你看到的文件是您云桶的内容:

$ ls
data/  logs/  config.json

$ cat config.json
{"version": 2, "debug": false}

$ echo "hello from archil" > greeting.txt

你在这里所做的一切——读取,写出,重命名,删取——都通过阿奇尔到你的桶上去.

使用您的代码

交互外壳很适合绕来绕去,但您也可以从自己的代码运行bash命令. 这对脚本, CI 管道, AI 代理, 或任何您想要运行的外壳命令对你的云存储器有用.

npm install @archildata/just-bash @archildata/native just-bash
import { ArchilClient } from '@archildata/native';
import { ArchilFs, createArchilCommand } from '@archildata/just-bash';
import { Bash } from 'just-bash';

// Connect to your disk
const client = await ArchilClient.connect({
  region: 'aws-us-east-1',
  diskName: 'myaccount/my-disk',
  authToken: 'my-secret-mount-token',
});

// Create a filesystem adapter and a bash executor
const fs = await ArchilFs.create(client);
const bash = new Bash({
  fs,
  customCommands: [createArchilCommand(client, fs)],
});

// Run commands just like you would in a terminal
const result = await bash.exec('ls -la /');
console.log(result.stdout);

// Write a file
await bash.exec('echo "hello world" > /greeting.txt');

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

// Clean up
await client.close();

直接使用文件系统适配器

如果你不需要击打而只需要标准文件操作,你可以使用 ArchilFs 独自一人。 它的工作像节点Js fs数字 :

const fs = await ArchilFs.create(client);

await fs.writeFile('/notes.txt', 'some content');
const content = await fs.readFile('/notes.txt');
const entries = await fs.readdir('/');
const stats = await fs.stat('/notes.txt');
await fs.mkdir('/mydir', { recursive: true });
await fs.cp('/notes.txt', '/mydir/notes-copy.txt');
await fs.rm('/notes.txt');

写入文件( 代表团)

Archil使用授权系统写作. 当多个客户端连接到同一个磁盘时,代表团会协调谁可以写到什么. 在写到文件或目录之前,你先"检查"一个代表团在上面. 完事后"入户"放出.

在交互式外壳中,使用内置 archil 命令 :

$ archil checkout /mydir
$ echo "hello" > /mydir/newfile.txt
$ archil checkin /mydir

在代码中,直接使用客户端:

const inodeId = await fs.resolveInodeId('/mydir');
await client.checkout(inodeId);

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

await client.checkin(inodeId);

子目录挂起

您可以挂载磁盘的子目录而不是根 。 这在你的桶里嵌入一个项目时有用:

ARCHIL_DISK_TOKEN=my-secret-mount-token npx @archildata/just-bash aws-us-east-1 myaccount/my-disk:/data/project

交互式 shell 引用

# Basic usage
npx @archildata/just-bash <region> <org>/<disk>

# With mount token
ARCHIL_DISK_TOKEN=xxx npx @archildata/just-bash aws-us-east-1 myaccount/my-disk

# With subdirectory
npx @archildata/just-bash aws-us-east-1 myaccount/my-disk:/path/to/subdir

# With debug logging
npx @archildata/just-bash aws-us-east-1 myaccount/my-disk --log-level debug

贝壳命令 :

  • 标准 bash 命令 (ls, (中文(简体) ), cat, (中文(简体) ), echo, (中文(简体) ), cp, (中文(简体) ), mv, (中文(简体) ), rm页:1
  • archil checkout [--force] <path> 获得书面授权
  • archil checkin <path> ——放行写代表团
  • archil list-delegations ——展出现有代表团
  • archil help ——显示拱门命令

平台支持

要求数 链接 (x64 或 arm64, glibc) 或 马科斯 (pple Silicon / arm64),用于本地文件系统客户端.

支助

问题、专题请求还是问题? 联系我们 支持@ archil.com。 。 。 .

版本与发布记录

@archildata/just-bash 共发布 54 个版本,首次发布于 2026/02/01;过去 12 个月发布了 54 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.41latest2026/11/061 天前
0.8.402026/11/034 天前
0.8.392026/10/2810 天前
0.8.382026/10/1524 天前
0.8.372026/10/0930 天前
0.8.362026/10/031 个月前

关于 @archildata/just-bash 的常见问题

@archildata/just-bash 是什么?

Archil 文件系统适配器

如何安装 @archildata/just-bash?

在项目目录运行 npm install @archildata/just-bash,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 archil-shell,可以用 npx archil-shell 直接运行。

@archildata/just-bash 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@archildata/just-bash 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@archildata/just-bash 可以商用吗?

@archildata/just-bash 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@archildata/just-bash 的下载量有多少?

根据 npm 官方下载统计,@archildata/just-bash 在 2026/10/07 – 2026/11/05 这 30 天内被下载 80,774 次,日均约 2,692 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@archildata/just-bash 还在维护吗?

最新版本 0.8.41 发布于 2026/11/06(1 天前);至今共发布 54 个版本,其中过去 12 个月发布了 54 个;首次发布于 2026/02/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。