@archildata/just-bash 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/shell.js +2 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# @archildata/just-bash
|
|
2
2
|
|
|
3
|
+
> **Not recommended for new projects.** With Archil's serverless execution (`disk <id> exec <command>`, or `Disk.exec()` from the [`disk`](https://www.npmjs.com/package/disk) package), you can run commands against your disk without standing up a client-side mount or bash environment at all — the command runs in an Archil-managed container with the disk pre-mounted and returns stdout/stderr/exit code. We no longer recommend `@archildata/just-bash`; reach for `disk exec` instead.
|
|
4
|
+
>
|
|
5
|
+
> This package is still published for existing users who have tooling built around it.
|
|
6
|
+
|
|
3
7
|
Run bash commands against your cloud storage through [Archil](https://archil.com) — no local mount required. Works in scripts, CI pipelines, and interactive sessions.
|
|
4
8
|
|
|
5
9
|
## Quick Start
|
|
6
10
|
|
|
7
|
-
If you already have an Archil disk set up (see [
|
|
11
|
+
If you already have an Archil disk set up (see [`disk`](https://www.npmjs.com/package/disk) for setup), you can start a shell in one command:
|
|
8
12
|
|
|
9
13
|
```bash
|
|
10
14
|
ARCHIL_DISK_TOKEN=my-secret-mount-token npx @archildata/just-bash aws-us-east-1 myaccount/my-disk
|
|
@@ -29,11 +33,11 @@ Everything you do here — reads, writes, renames, deletes — goes through Arch
|
|
|
29
33
|
The interactive shell is great for poking around, but you can also run bash commands from your own code. This is useful for scripts, CI pipelines, AI agents, or anywhere you want to run shell commands against your cloud storage.
|
|
30
34
|
|
|
31
35
|
```bash
|
|
32
|
-
npm install @archildata/just-bash @archildata/
|
|
36
|
+
npm install @archildata/just-bash @archildata/native just-bash
|
|
33
37
|
```
|
|
34
38
|
|
|
35
39
|
```typescript
|
|
36
|
-
import { ArchilClient } from '@archildata/
|
|
40
|
+
import { ArchilClient } from '@archildata/native';
|
|
37
41
|
import { ArchilFs, createArchilCommand } from '@archildata/just-bash';
|
|
38
42
|
import { Bash } from 'just-bash';
|
|
39
43
|
|
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
38
38
|
|
|
39
39
|
// src/ArchilFs.ts
|
|
40
40
|
var import_debug = __toESM(require("debug"), 1);
|
|
41
|
-
var
|
|
41
|
+
var import_native = require("@archildata/native");
|
|
42
42
|
var debug = (0, import_debug.default)("archil:fs");
|
|
43
43
|
var ArchilFs = class _ArchilFs {
|
|
44
44
|
client;
|
|
@@ -243,14 +243,14 @@ var ArchilFs = class _ArchilFs {
|
|
|
243
243
|
debug("readFileBuffer file is empty, returning empty buffer");
|
|
244
244
|
return new Uint8Array(0);
|
|
245
245
|
}
|
|
246
|
-
if (size <=
|
|
246
|
+
if (size <= import_native.MAXIMUM_READ_SIZE) {
|
|
247
247
|
const buffer = await this.client.readInode(inodeId, 0, size, { user: this.user });
|
|
248
248
|
return new Uint8Array(buffer);
|
|
249
249
|
}
|
|
250
250
|
const result = new Uint8Array(size);
|
|
251
251
|
let offset = 0;
|
|
252
252
|
while (offset < size) {
|
|
253
|
-
const chunkSize = Math.min(
|
|
253
|
+
const chunkSize = Math.min(import_native.MAXIMUM_READ_SIZE, size - offset);
|
|
254
254
|
const chunk = await this.client.readInode(inodeId, offset, chunkSize, { user: this.user });
|
|
255
255
|
result.set(new Uint8Array(chunk), offset);
|
|
256
256
|
offset += chunkSize;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ArchilClient, UnixUser } from '@archildata/
|
|
1
|
+
import * as _archildata_native from '@archildata/native';
|
|
2
|
+
import { ArchilClient, UnixUser } from '@archildata/native';
|
|
3
3
|
import * as just_bash from 'just-bash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Archil filesystem adapter for just-bash
|
|
7
7
|
*
|
|
8
8
|
* Implements the IFileSystem interface from just-bash using the ArchilClient
|
|
9
|
-
* from @archildata/
|
|
9
|
+
* from @archildata/native for direct protocol access to Archil distributed filesystems.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
type BufferEncoding = "utf8" | "utf-8" | "ascii" | "binary" | "base64" | "hex" | "latin1";
|
|
@@ -65,7 +65,7 @@ interface IFileSystem {
|
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```typescript
|
|
68
|
-
* import { ArchilClient } from '@archildata/
|
|
68
|
+
* import { ArchilClient } from '@archildata/native';
|
|
69
69
|
* import { ArchilFs } from '@archildata/just-bash';
|
|
70
70
|
*
|
|
71
71
|
* const client = await ArchilClient.connect({
|
|
@@ -199,15 +199,15 @@ declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): just_b
|
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
201
|
* ```typescript
|
|
202
|
-
* import { ArchilClient } from '@archildata/
|
|
202
|
+
* import { ArchilClient } from '@archildata/native';
|
|
203
203
|
* import { createArchilFs } from '@archildata/just-bash';
|
|
204
204
|
*
|
|
205
205
|
* const client = await ArchilClient.connectAuthenticated({...});
|
|
206
206
|
* const fs = await createArchilFs(client, { user: { uid: 1000, gid: 1000 } });
|
|
207
207
|
* ```
|
|
208
208
|
*/
|
|
209
|
-
declare function createArchilFs(client:
|
|
210
|
-
user?:
|
|
209
|
+
declare function createArchilFs(client: _archildata_native.ArchilClient, options?: {
|
|
210
|
+
user?: _archildata_native.UnixUser;
|
|
211
211
|
subdirectory?: string;
|
|
212
212
|
}): Promise<ArchilFs>;
|
|
213
213
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ArchilClient, UnixUser } from '@archildata/
|
|
1
|
+
import * as _archildata_native from '@archildata/native';
|
|
2
|
+
import { ArchilClient, UnixUser } from '@archildata/native';
|
|
3
3
|
import * as just_bash from 'just-bash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Archil filesystem adapter for just-bash
|
|
7
7
|
*
|
|
8
8
|
* Implements the IFileSystem interface from just-bash using the ArchilClient
|
|
9
|
-
* from @archildata/
|
|
9
|
+
* from @archildata/native for direct protocol access to Archil distributed filesystems.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
type BufferEncoding = "utf8" | "utf-8" | "ascii" | "binary" | "base64" | "hex" | "latin1";
|
|
@@ -65,7 +65,7 @@ interface IFileSystem {
|
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```typescript
|
|
68
|
-
* import { ArchilClient } from '@archildata/
|
|
68
|
+
* import { ArchilClient } from '@archildata/native';
|
|
69
69
|
* import { ArchilFs } from '@archildata/just-bash';
|
|
70
70
|
*
|
|
71
71
|
* const client = await ArchilClient.connect({
|
|
@@ -199,15 +199,15 @@ declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): just_b
|
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
201
|
* ```typescript
|
|
202
|
-
* import { ArchilClient } from '@archildata/
|
|
202
|
+
* import { ArchilClient } from '@archildata/native';
|
|
203
203
|
* import { createArchilFs } from '@archildata/just-bash';
|
|
204
204
|
*
|
|
205
205
|
* const client = await ArchilClient.connectAuthenticated({...});
|
|
206
206
|
* const fs = await createArchilFs(client, { user: { uid: 1000, gid: 1000 } });
|
|
207
207
|
* ```
|
|
208
208
|
*/
|
|
209
|
-
declare function createArchilFs(client:
|
|
210
|
-
user?:
|
|
209
|
+
declare function createArchilFs(client: _archildata_native.ArchilClient, options?: {
|
|
210
|
+
user?: _archildata_native.UnixUser;
|
|
211
211
|
subdirectory?: string;
|
|
212
212
|
}): Promise<ArchilFs>;
|
|
213
213
|
|
package/dist/index.js
CHANGED
package/dist/shell.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// bin/shell.ts
|
|
4
4
|
import * as readline from "readline";
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
-
import { ArchilClient
|
|
6
|
+
import { ArchilClient } from "@archildata/native";
|
|
7
|
+
import { Archil } from "disk";
|
|
7
8
|
import { Bash } from "just-bash";
|
|
8
9
|
import { ArchilFs, createArchilCommand } from "@archildata/just-bash";
|
|
9
10
|
var program = new Command();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archildata/just-bash",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "Archil filesystem adapter for just-bash",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"shell": "tsx bin/shell.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@archildata/
|
|
29
|
+
"@archildata/native": "^0.8.9",
|
|
30
30
|
"commander": "^14.0.3",
|
|
31
31
|
"debug": "^4.3.4",
|
|
32
|
+
"disk": "^0.8.9",
|
|
32
33
|
"just-bash": "^2.7.0"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|