@delta-agentcloud/cli 0.0.0-stage → 1.1.22
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 +498 -2
- package/checksums.txt +5 -0
- package/package.json +47 -4
- package/scripts/install-wizard.js +683 -0
- package/scripts/install.js +435 -0
- package/scripts/run.js +65 -0
- package/skills/delta-protein/AGENTS.md +73 -0
- package/skills/delta-protein/SKILL.md +389 -0
- package/skills/delta-protein/agents/openai.yaml +4 -0
- package/skills/delta-protein/references/bfitter.md +64 -0
- package/skills/delta-protein/references/catapro_predict.md +63 -0
- package/skills/delta-protein/references/catpred_predict.md +65 -0
- package/skills/delta-protein/references/caver_tunnel_analyze.md +63 -0
- package/skills/delta-protein/references/consensus_mutation.md +61 -0
- package/skills/delta-protein/references/consurf_predict.md +67 -0
- package/skills/delta-protein/references/crop_sequence.md +69 -0
- package/skills/delta-protein/references/dock.md +82 -0
- package/skills/delta-protein/references/dock_score.md +70 -0
- package/skills/delta-protein/references/easifa_predict_active_site.md +70 -0
- package/skills/delta-protein/references/ephod_predict_mutation.md +66 -0
- package/skills/delta-protein/references/ephod_predict_protein.md +61 -0
- package/skills/delta-protein/references/esmfold2_predict.md +67 -0
- package/skills/delta-protein/references/evcouplings_mutation.md +64 -0
- package/skills/delta-protein/references/fasta_to_sequence.md +59 -0
- package/skills/delta-protein/references/foldseek.md +61 -0
- package/skills/delta-protein/references/generate_msa.md +61 -0
- package/skills/delta-protein/references/interpro_analyze.md +63 -0
- package/skills/delta-protein/references/mpnn_design_sequence.md +71 -0
- package/skills/delta-protein/references/multievolve.md +73 -0
- package/skills/delta-protein/references/pisa_query.md +70 -0
- package/skills/delta-protein/references/plip_analyze.md +65 -0
- package/skills/delta-protein/references/pocket_prediction.md +63 -0
- package/skills/delta-protein/references/protein_design.md +65 -0
- package/skills/delta-protein/references/protein_evolution.md +77 -0
- package/skills/delta-protein/references/protein_sol_predict_mutation.md +66 -0
- package/skills/delta-protein/references/protein_sol_predict_protein.md +61 -0
- package/skills/delta-protein/references/protenix.md +66 -0
- package/skills/delta-protein/references/protrek_search.md +90 -0
- package/skills/delta-protein/references/pubchem_search.md +68 -0
- package/skills/delta-protein/references/pubmed_search.md +79 -0
- package/skills/delta-protein/references/reap_design_primer.md +69 -0
- package/skills/delta-protein/references/rfd3_design.md +65 -0
- package/skills/delta-protein/references/structure_to_sequence.md +61 -0
- package/skills/delta-protein/references/summarize_result.md +68 -0
- package/skills/delta-protein/references/surface_charge.md +84 -0
- package/skills/delta-protein/references/uniprot_batch_query.md +63 -0
- package/skills/delta-protein/references/uniprot_query.md +64 -0
- package/skills/delta-protein/references/zero_shot_mutant_candidates.md +76 -0
- package/skills/delta-protein/scripts/gen_references.py +167 -0
- package/skills/delta-protein/scripts/output_metadata.json +275 -0
- package/skills/delta-sandbox/SKILL.md +388 -0
- package/skills/delta-sandbox/agents/openai.yaml +4 -0
- package/skills/delta-sandbox/references/commands.md +58 -0
- package/skills/delta-sandbox/references/lifecycle.md +100 -0
- package/skills/delta-sandbox/references/recipes.md +138 -0
- package/skills/delta-science/AGENTS.md +47 -0
- package/skills/delta-science/SKILL.md +227 -0
- package/skills/delta-science/agents/openai.yaml +4 -0
- package/skills/delta-science/references/antbo.md +105 -0
- package/skills/delta-science/references/delta-bo.md +92 -0
- package/skills/delta-science/references/gsasii.md +118 -0
- package/skills/delta-science/references/lammps.md +68 -0
- package/skills/delta-science/references/ldm-bo.md +132 -0
- package/skills/delta-science/references/materials-design.md +130 -0
- package/skills/delta-science/references/pubchem.md +128 -0
- package/skills/delta-science/references/pymatgen.md +69 -0
- package/skills/delta-science/references/qe.md +134 -0
- package/skills/delta-science/references/rdkit.md +141 -0
- package/skills/delta-science/references/strbo.md +95 -0
- package/skills/delta-science/references/synbo.md +201 -0
- package/skills/delta-science/references/xrd.md +688 -0
- package/skills/delta-science/scripts/catalog.py +92 -0
- package/skills/delta-science/scripts/generated_catalog.py +69 -0
- package/skills/delta-science/scripts/invoke.py +346 -0
- package/skills/delta-shared/SKILL.md +113 -0
- package/skills/delta-shared/agents/openai.yaml +4 -0
- package/skills/manifest.json +20 -0
package/README.md
CHANGED
|
@@ -1,3 +1,499 @@
|
|
|
1
|
-
#
|
|
1
|
+
# delta-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line tool for the Delta Agent Cloud, used to manage Delta Sandbox GPU/CPU compute workloads and invoke Science tools.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Option 1: npx one-click install (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @delta-agentcloud/cli@latest install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This command performs, in order:
|
|
14
|
+
1. **Global install** of `@delta-agentcloud/cli` (includes the Go binary)
|
|
15
|
+
2. **Select AI tool platforms** (multi-select): generic agent dir `~/.agents/skills/` (Codex/Cursor/OpenCode), Claude Code `~/.claude/skills/`, OpenCode native `~/.config/opencode/skills/`, Cursor `~/.cursor/skills/`, Memento-S dev mode `~/memento_s/skills/`
|
|
16
|
+
3. **Install AI Skills** into the selected platforms' skills directories
|
|
17
|
+
4. **Initialize config** automatically writing the default server address (no manual base_url entry)
|
|
18
|
+
5. **Authenticate** `delta-cli auth login` (interactive; skipped when not a TTY)
|
|
19
|
+
|
|
20
|
+
AI agents can also install directly with:
|
|
21
|
+
|
|
22
|
+
> Install delta-cli for me: https://github.com/delta-agentcloud/delta-cli
|
|
23
|
+
|
|
24
|
+
### Uninstall
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx @delta-agentcloud/cli@latest uninstall
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Cleans up the global package, AI Skills from all known platforms, and the config file.
|
|
31
|
+
|
|
32
|
+
### Upgrade
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Upgrade CLI + AI Skills
|
|
36
|
+
delta-cli upgrade
|
|
37
|
+
|
|
38
|
+
# Only check whether an update is available (do not upgrade)
|
|
39
|
+
delta-cli upgrade --check
|
|
40
|
+
|
|
41
|
+
# Only upgrade the CLI binary
|
|
42
|
+
delta-cli upgrade --cli-only
|
|
43
|
+
|
|
44
|
+
# Only upgrade AI Skills
|
|
45
|
+
delta-cli upgrade --skills-only
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Upgrading the CLI pulls the latest version via `npm install -g @delta-agentcloud/cli@latest`; upgrading Skills reinstalls AI Skills via `npx skills add`.
|
|
49
|
+
|
|
50
|
+
### Option 2: Download the binary directly
|
|
51
|
+
|
|
52
|
+
Download the archive for your platform from [GitHub Releases](https://github.com/delta-agentcloud/delta-cli/releases) (below, `latest` points to the newest version):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# macOS (Apple Silicon)
|
|
56
|
+
curl -L -o delta-cli.tar.gz https://github.com/delta-agentcloud/delta-cli/releases/latest/download/delta-cli-darwin-arm64.tar.gz
|
|
57
|
+
tar -xzf delta-cli.tar.gz
|
|
58
|
+
sudo mv delta-cli-darwin-arm64 /usr/local/bin/delta-cli
|
|
59
|
+
rm delta-cli.tar.gz
|
|
60
|
+
|
|
61
|
+
# Linux (AMD64)
|
|
62
|
+
curl -L -o delta-cli.tar.gz https://github.com/delta-agentcloud/delta-cli/releases/latest/download/delta-cli-linux-amd64.tar.gz
|
|
63
|
+
tar -xzf delta-cli.tar.gz
|
|
64
|
+
chmod +x delta-cli-linux-amd64
|
|
65
|
+
sudo mv delta-cli-linux-amd64 /usr/local/bin/delta-cli
|
|
66
|
+
rm delta-cli.tar.gz
|
|
67
|
+
|
|
68
|
+
# Windows (AMD64, PowerShell)
|
|
69
|
+
Invoke-WebRequest -Uri https://github.com/delta-agentcloud/delta-cli/releases/latest/download/delta-cli-windows-amd64.zip -OutFile delta-cli.zip
|
|
70
|
+
Expand-Archive -Path delta-cli.zip -DestinationPath . -Force
|
|
71
|
+
Move-Item -Path delta-cli-windows-amd64.exe -Destination delta-cli.exe
|
|
72
|
+
Remove-Item -Path delta-cli.zip
|
|
73
|
+
# Put delta-cli.exe in a directory on your PATH
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Option 3: One-line install script (works without npm)
|
|
77
|
+
|
|
78
|
+
The install script **auto-detects the environment**:
|
|
79
|
+
- **npm present** → installs the `@delta-agentcloud/cli` npm package from the official npm registry
|
|
80
|
+
- **no npm** → downloads the binary directly (PowerShell + curl on Windows; bash + curl + tar on macOS/Linux, both built in), **no Node.js/npm required**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Linux / macOS
|
|
84
|
+
curl -L https://raw.githubusercontent.com/delta-agentcloud/delta-cli/main/install.sh | bash
|
|
85
|
+
|
|
86
|
+
# Windows (PowerShell)
|
|
87
|
+
Invoke-RestMethod -Uri https://raw.githubusercontent.com/delta-agentcloud/delta-cli/main/install.ps1 | Invoke-Expression
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The script downloads the binary directly from GitHub Releases and verifies the SHA-256. Use the `DELTA_CLI_VERSION` environment variable to pin a version.
|
|
91
|
+
|
|
92
|
+
### Option 4: npm
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install -g @delta-agentcloud/cli
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`postinstall` downloads the binary for the current platform:
|
|
99
|
+
|
|
100
|
+
1. The mirror specified by the `DELTA_CLI_MIRROR` environment variable (if set; must be HTTPS and allow the full-prefix format, e.g. `https://your-mirror`)
|
|
101
|
+
2. The GitHub source `https://github.com/delta-agentcloud/delta-cli/releases/download/...` (fallback)
|
|
102
|
+
|
|
103
|
+
If the download fails during install:
|
|
104
|
+
|
|
105
|
+
- Run `delta-cli` once; it will automatically retry the download.
|
|
106
|
+
- Or set a local archive path before installing:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
DELTA_CLI_ARCHIVE=/path/to/delta-cli-linux-amd64.tar.gz npm install -g @delta-agentcloud/cli
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Common environment variables:
|
|
113
|
+
|
|
114
|
+
| Variable | Description |
|
|
115
|
+
|----------|-------------|
|
|
116
|
+
| `DELTA_CLI_MIRROR` | Download mirror root, e.g. `https://your-mirror`. The script expands it to the full-prefix format (`<mirror>/https://github.com/...`). Must be HTTPS and allowlisted. |
|
|
117
|
+
| `DELTA_CLI_MIRROR_ALLOWLIST` | Additional allowed hosts, comma-separated. |
|
|
118
|
+
| `DELTA_CLI_ARCHIVE` | Path to a pre-downloaded `.tar.gz` / `.zip` to skip the network download. |
|
|
119
|
+
| `DELTA_CLI_SKIP_POSTINSTALL` | Set to `1` to skip the binary download at install time; `delta-cli` retries at runtime. |
|
|
120
|
+
| `DELTA_CLI_FATAL_ON_ERROR` | Exit non-zero on install failure (default: warn only; useful for debugging). |
|
|
121
|
+
| `DELTA_CLI_DOWNLOAD_TIMEOUT` | Max wait time per download source (ms, default 120000). |
|
|
122
|
+
|
|
123
|
+
### Option 5: Go Install
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
go install github.com/delta-infra/delta-infra-cli/cmd/delta-cli@latest
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Quick Start
|
|
130
|
+
|
|
131
|
+
### 1. Initialize configuration
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
delta-cli config init
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The server address needs no manual entry: it defaults to `https://delta-infra-nacos.laddery.uk` (an existing config keeps its own base_url); the CLI only prompts interactively for a Bearer Token (optional — you can also configure it later with `auth login`).
|
|
138
|
+
|
|
139
|
+
To point at a self-hosted server, specify it once via flag or environment variable:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Via flag
|
|
143
|
+
delta-cli config init \
|
|
144
|
+
--base-url http://your-server/api/v1 \
|
|
145
|
+
--token your-token
|
|
146
|
+
|
|
147
|
+
# Via environment variable (API Key or Token, pick one)
|
|
148
|
+
export DELTA_INFRA_BASE_URL=http://your-server/api/v1
|
|
149
|
+
export DELTA_INFRA_API_KEY=your-api-key # or DELTA_INFRA_TOKEN
|
|
150
|
+
delta-cli config init
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The config file is stored at `~/.delta-infra/config.json` (mode 0600).
|
|
154
|
+
|
|
155
|
+
### 2. Authentication
|
|
156
|
+
|
|
157
|
+
Two credential types are supported: **API Key** and **Bearer Token** (API Key takes priority).
|
|
158
|
+
|
|
159
|
+
**Get an API Key**: sign in to the Delta Agent Cloud **web console** and generate a key on the **API Keys** page.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# API Key (recommended)
|
|
163
|
+
delta-cli auth login --apikey <your-api-key>
|
|
164
|
+
|
|
165
|
+
# Token
|
|
166
|
+
delta-cli auth login --token <your-token>
|
|
167
|
+
|
|
168
|
+
# Interactive login (paste the Key/Token; the CLI detects the format automatically)
|
|
169
|
+
delta-cli auth login
|
|
170
|
+
|
|
171
|
+
# Show auth status
|
|
172
|
+
delta-cli auth status
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
You can also provide credentials via environment variables: `DELTA_INFRA_API_KEY=<key>` / `DELTA_INFRA_TOKEN=<token>`.
|
|
176
|
+
|
|
177
|
+
### 3. Sandbox lifecycle
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Create a sandbox with a GPU (--max-life defaults to 30 minutes; raise it for long tasks)
|
|
181
|
+
# ⚠️ Resource semantics: `--memory` is the container CPU memory TOTAL (one per sandbox); `--gpu-mem` is the memory PER CARD (MiB) —
|
|
182
|
+
# `--gpu 2 --gpu-mem 8000` = 8000MiB per card, 16000MiB total (the private OpenSandbox/HAMi backend writes it straight to the HAMi per-card annotation;
|
|
183
|
+
# the cloud RunPod backend treats --gpu-mem as total memory ÷ card count). Per-card memory limit is visible via `sandbox resources` (memory_mib).
|
|
184
|
+
# ⚠️ Resource semantics: `--shm-size` is the container /dev/shm size (default only 64Mi). PyTorch DataLoader(num_workers>0)/
|
|
185
|
+
# multiprocessing, Chromium-based kernels etc. fail with "No space left on device"/"Bus error" when shared memory is insufficient; raise it then.
|
|
186
|
+
# The unit is mandatory (4G/512M are normalized to 4Gi/512Mi; a bare number is rejected by the server) and must not exceed --memory.
|
|
187
|
+
# `--devices` requests host devices (comma-separated, e.g. kvm → /dev/kvm inside the container, for nested virtualization): a privilege escalation,
|
|
188
|
+
# rejected by the server when the allowlist is disabled (never silently ignored). Both apply to private compute only; third-party compute ignores them.
|
|
189
|
+
delta-cli sandbox create \
|
|
190
|
+
--image image.yangtzeailab.com/opensandbox/pytorch-cuda13:latest \
|
|
191
|
+
--cpu 4 --memory 16Gi --gpu 1 \
|
|
192
|
+
--max-life 120
|
|
193
|
+
|
|
194
|
+
# For DataLoader multiprocessing / nested virtualization: raise /dev/shm and request /dev/kvm (shm must not exceed memory)
|
|
195
|
+
delta-cli sandbox create \
|
|
196
|
+
--image image.yangtzeailab.com/opensandbox/pytorch-cuda13:latest \
|
|
197
|
+
--cpu 4 --memory 8Gi --shm-size 4Gi --devices kvm \
|
|
198
|
+
--max-life 120
|
|
199
|
+
|
|
200
|
+
# Sandbox that must live long and not be auto-cleaned: add --no-auto-cleanup (only explicit kill/finish destroys it)
|
|
201
|
+
delta-cli sandbox create \
|
|
202
|
+
--image image.yangtzeailab.com/opensandbox/pytorch-cuda13:latest \
|
|
203
|
+
--cpu 4 --memory 16Gi --gpu 1 \
|
|
204
|
+
--no-auto-cleanup
|
|
205
|
+
|
|
206
|
+
# Run a command (short tasks run synchronously; use run-bg instead of run for long tasks)
|
|
207
|
+
delta-cli sandbox run <sandbox_id> \
|
|
208
|
+
--command "<command>" \
|
|
209
|
+
--timeout 3600
|
|
210
|
+
|
|
211
|
+
# v1.0.85+ sandbox run uses an SSE real-time stream: stdout carries raw data: frames (no trailing envelope); exit_code/log_file are in the complete frame
|
|
212
|
+
# To get the trailing JSON summary in stdout: read the log_file and parse it (sandbox read <id> --path <log_file>)
|
|
213
|
+
delta-cli sandbox run <sandbox_id> --command "echo '{\"status\":\"ok\",\"result\":\"done\"}'" --timeout 60
|
|
214
|
+
|
|
215
|
+
# Read a result file
|
|
216
|
+
delta-cli sandbox read <sandbox_id> --path /workspace/result.json
|
|
217
|
+
|
|
218
|
+
# Destroy the sandbox
|
|
219
|
+
delta-cli sandbox kill <sandbox_id>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Command list
|
|
223
|
+
|
|
224
|
+
### Global commands
|
|
225
|
+
|
|
226
|
+
| Command | Description |
|
|
227
|
+
|---------|-------------|
|
|
228
|
+
| `delta-cli config init` | Initialize the config file |
|
|
229
|
+
| `delta-cli config show` | Show current config (sensitive fields masked) |
|
|
230
|
+
| `delta-cli config set <key> <value>` | Set a config value |
|
|
231
|
+
| `delta-cli config remove <key>` | Remove a config value (supports `token`, `apikey`) |
|
|
232
|
+
| `delta-cli auth login` | Interactive login (detects API Key / Token automatically) |
|
|
233
|
+
| `delta-cli auth login --apikey <key>` | API Key authentication (recommended) |
|
|
234
|
+
| `delta-cli auth login --token <token>` | Token authentication |
|
|
235
|
+
| `delta-cli auth status` | Show auth status |
|
|
236
|
+
| `delta-cli upgrade` | Upgrade the CLI and AI Skills to the latest version |
|
|
237
|
+
| `delta-cli upgrade --check` | Check whether an update is available |
|
|
238
|
+
| `delta-cli upgrade --cli-only` | Only upgrade the CLI binary |
|
|
239
|
+
| `delta-cli upgrade --skills-only` | Only upgrade AI Skills |
|
|
240
|
+
| `delta-cli usage` | Show current usage and remaining quota |
|
|
241
|
+
| `delta-cli --version` | Show version |
|
|
242
|
+
|
|
243
|
+
### Sandbox commands
|
|
244
|
+
|
|
245
|
+
> **Tip**: `sandbox list` (list sandbox instances) differs from `sandbox ls <id>` (list a directory); don't confuse them.
|
|
246
|
+
|
|
247
|
+
| Command | Description |
|
|
248
|
+
|---------|-------------|
|
|
249
|
+
| `delta-cli sandbox list` | List the current user's sandbox instances |
|
|
250
|
+
| `delta-cli sandbox providers` | Show available compute backends |
|
|
251
|
+
| `delta-cli sandbox resources [--provider opensandbox\|autodl]` | Show remaining requestable resources (GPU/memory/cores) per backend |
|
|
252
|
+
| `delta-cli sandbox images` | Show the available image list (each entry has `image_name`/`tags`/`description`/`supports_shared_workspace`; `supports_shared_workspace=true` means the compute supports a shared workspace (opensandbox/autodl) and can pair with `--shared-workspace`; the actual seed/write-back is decided at create time by probing for rclone inside the image) |
|
|
253
|
+
| `delta-cli sandbox recommend --cpu N --memory XGi` | Get a resource configuration recommendation |
|
|
254
|
+
| `delta-cli sandbox create --image <img> [--shm-size XGi] [--devices kvm] [--no-auto-cleanup] [--shared-workspace=true\|false]` | Create a sandbox container (`--no-auto-cleanup` disables auto-cleanup; `--shared-workspace` defaults to true: enables the shared workspace (seed/write-back determined at create time by probing for rclone in the image; skipped when absent, data not persistent across sandboxes); false skips seed/write-back, suited to fast tasks; `--shm-size` raises /dev/shm (default 64Mi, **must carry a Gi/Mi unit** and be ≤ `--memory`, common for PyTorch DataLoader/multiprocessing); `--devices` is a comma-separated list of host device tokens (`kvm` → /dev/kvm, nested virtualization), **a privilege escalation** the server **explicitly rejects** when the allowlist is off; `--shm-size`/`--devices` apply to private compute only, third-party compute ignores them) |
|
|
255
|
+
| `delta-cli sandbox extend <id> --max-life N` | **Dynamically extend** a running sandbox's max-life (increase or decrease; N must exceed elapsed minutes and be ≤10080; use `kill`/`finish` for early reclaim); without `--max-life` it queries the current lifecycle (elapsed/remaining/expiry); `status` output includes a `data.lifecycle` summary (elapsed/remaining/expiry; omitted when the lifecycle API is unavailable) |
|
|
256
|
+
| `delta-cli sandbox connect <id>` | Connect to a sandbox |
|
|
257
|
+
| `delta-cli sandbox status <id>` | Show sandbox status |
|
|
258
|
+
| `delta-cli sandbox finish <id>` | Save results and destroy |
|
|
259
|
+
| `delta-cli sandbox kill <id>` | Destroy a sandbox |
|
|
260
|
+
| `delta-cli sandbox run <id> --command "..." [--timeout <sec>] [--summary/--no-summary] [--artifacts]` | Run a command synchronously (raw SSE `data:` frames to stdout, no trailing envelope; `exit_code`/`log_file` in the `complete` frame); `--summary`/`--artifacts` only apply on the legacy-server fallback path |
|
|
261
|
+
| `delta-cli sandbox run-bg <id> --command "..." [--timeout <sec>] [--wait] [--summary/--no-summary] [--artifacts]` | Run a command in the background; without `--wait` it returns `{execution_id, sandbox_id}` immediately; with `--wait` it follows via SSE (raw `data:` frames to stdout, no trailing envelope) |
|
|
262
|
+
| `delta-cli sandbox logs <id> --execution-id <eid> [--tail N --grep <pattern> --context N --max-bytes N]` | Show background logs; returns `stderr_size + stderr_tail` by default (avoids context blow-up); filter with `--tail/--grep` |
|
|
263
|
+
| `delta-cli sandbox cancel <id> --execution-id <eid>` | Interrupt a background command |
|
|
264
|
+
| `delta-cli sandbox read <id> --path <path> [--output <local path>] [--tail N] [--grep <pattern>] [--offset N] [--limit N] [--context N] [--max-bytes N] [--parse-json]` | Read a file in the container; `--output <path>` saves locally; filter with `--tail/--grep`; non-UTF-8 files fall back to base64 automatically |
|
|
265
|
+
| `delta-cli sandbox pull <id> --source <sandbox path> --target <local path> [--recursive] [--pattern <glob>]` | Pull files/dirs from the sandbox to local (mirror of `upload`; flag direction reversed: source=remote, target=local); single file or recursive dir; bidirectional sha1 integrity check on both CLI and server |
|
|
266
|
+
| `delta-cli sandbox write <id> --path <path> --source <local path>` | Write a file |
|
|
267
|
+
| `delta-cli sandbox write-multiple <id> --entry <remote path>=<local path>` | Write multiple files |
|
|
268
|
+
| `delta-cli sandbox ls <id> --path <path>` | List a directory |
|
|
269
|
+
| `delta-cli sandbox stat <id> --path <path>` | File metadata |
|
|
270
|
+
| `delta-cli sandbox mv <id> --entry <src=dest>` | Move/rename |
|
|
271
|
+
| `delta-cli sandbox replace <id> --path <path> --old <text> --new <text>` | Replace content |
|
|
272
|
+
| `delta-cli sandbox chmod <id> --path <path> --mode <octal>` | Change permissions |
|
|
273
|
+
| `delta-cli sandbox rm <id> --path <path>` | Delete a file |
|
|
274
|
+
| `delta-cli sandbox rmdir <id> --path <dir>` | Recursively delete a directory |
|
|
275
|
+
| `delta-cli sandbox mkdir <id> --path <dir>` | Create a directory |
|
|
276
|
+
| `delta-cli sandbox search <id> --path <root> --pattern <glob>` | Search files |
|
|
277
|
+
| `delta-cli sandbox working-directory <id>` | Get the sandbox working directory path |
|
|
278
|
+
| `delta-cli sandbox upload <id> --source <local dir> --target <sandbox path>` | Upload a directory (tar.gz + auto-extract) |
|
|
279
|
+
| `delta-cli sandbox expose <id> [--port N]` | Expose a sandbox service port to the public internet (frp tunnel), default port 8700 |
|
|
280
|
+
| `delta-cli sandbox exposes <id>` | List the sandbox's active public port tunnels |
|
|
281
|
+
| `delta-cli sandbox dispose <id> --port N` | Recycle a public port tunnel (specify the port) |
|
|
282
|
+
|
|
283
|
+
### Science tools
|
|
284
|
+
|
|
285
|
+
> The Science Server is derived from `base_url` (`{base_url}/science_tool`); no separate `science_base_url` config is needed.
|
|
286
|
+
> The Sandbox API is likewise derived from `base_url` (`{base_url}/sandbox/api/v1`).
|
|
287
|
+
|
|
288
|
+
| Command | Description |
|
|
289
|
+
|---------|-------------|
|
|
290
|
+
| `delta-cli science list` | List all enabled science tools |
|
|
291
|
+
| `delta-cli science get <tool_name>` | Show details for a tool |
|
|
292
|
+
| `delta-cli science invoke --tool <tool_name> --endpoint <endpoint_name> [--data '{"key":"value"}'] [--params '{"key":"value"}']` | Invoke a tool endpoint |
|
|
293
|
+
| `delta-cli science endpoints list <tool_name>` | List all endpoints of a tool |
|
|
294
|
+
| `delta-cli science task submit --tool <tool> --operation <operation> --input '<json>' [--wait]` | Submit a durable Science task |
|
|
295
|
+
| `delta-cli science task get/list/cancel/invocations/artifacts` | Query, cancel tasks, and read invocation/artifact metadata |
|
|
296
|
+
| `delta-cli science file invoke --tool <tool> --endpoint <operation> --file <path>` | Invoke a controlled file/multipart operation |
|
|
297
|
+
| `delta-cli science file download --tool <tool> --endpoint <operation> --params '<json>' --output <path>` | Download a raw artifact and compute its SHA-256 |
|
|
298
|
+
|
|
299
|
+
`tools.name` and `tool_endpoints.name` are the only authoritative names for Science tool calls.
|
|
300
|
+
`science list` and `science endpoints list` show the enabled entries from the server database verbatim;
|
|
301
|
+
`science invoke` passes `--tool` and `--endpoint` verbatim, with no alias mapping or legacy-name compatibility.
|
|
302
|
+
|
|
303
|
+
Since v1.1.1 the online catalog includes `qe` (Quantum ESPRESSO DFT, 20 endpoints: task
|
|
304
|
+
submit/query/logs/artifact/PP library, etc.) and `materials-design` (durable materials agent
|
|
305
|
+
modeling, 7 endpoints: health/capabilities/job-submit(multipart)/job-status/job-cancel, etc.).
|
|
306
|
+
See the Skill docs `skills/delta-science/references/qe.md` and
|
|
307
|
+
`skills/delta-science/references/materials-design.md`.
|
|
308
|
+
The cloud XRD phase-identification, artifact, CIF simulation and refinement contract is in
|
|
309
|
+
`skills/delta-science/references/xrd.md`.
|
|
310
|
+
|
|
311
|
+
## Output format
|
|
312
|
+
|
|
313
|
+
All commands return a unified JSON envelope:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
// success
|
|
317
|
+
{"ok":true,"data":{"id":"sb-xxx","status":"running"}}
|
|
318
|
+
|
|
319
|
+
// error
|
|
320
|
+
{"ok":false,"error":{"type":"auth","message":"not authenticated","hint":"run 'delta-cli auth login'"}}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Error types and exit codes:
|
|
324
|
+
|
|
325
|
+
| Type | Exit Code | Scenario |
|
|
326
|
+
|------|-----------|----------|
|
|
327
|
+
| validation | 2 | Argument error |
|
|
328
|
+
| auth | 3 | Not authenticated |
|
|
329
|
+
| permission | 4 | Insufficient permission |
|
|
330
|
+
| not_found | 5 | Resource does not exist |
|
|
331
|
+
| network | 6 | Network error |
|
|
332
|
+
| api | 7 | Server error |
|
|
333
|
+
| internal | 10 | Client internal error |
|
|
334
|
+
|
|
335
|
+
## AI Agent Skills
|
|
336
|
+
|
|
337
|
+
delta-cli ships built-in AI Agent operation manuals (Skills) that help assistants such as Claude Code use the CLI correctly:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Install all Skills from the repo
|
|
341
|
+
npx skills add delta-agentcloud/delta-cli -y -g
|
|
342
|
+
|
|
343
|
+
# Install only the unified Science Skill
|
|
344
|
+
npx skills add delta-agentcloud/delta-cli -s delta-science
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Skill files live under `skills/`:
|
|
348
|
+
- `delta-shared/` — shared global rules (auth, config, error handling)
|
|
349
|
+
- `delta-sandbox/` — Sandbox operation guide (lifecycle, command routing)
|
|
350
|
+
- `delta-science/` — the single Science entry point, with the unified Delta CLI wrapper, cross-tool workflows, and
|
|
351
|
+
on-demand references for PubChem, RDKit, pymatgen, XRD, GSAS-II, LAMMPS, Delta-BO, LDM-BO, SynBO, AntBO
|
|
352
|
+
|
|
353
|
+
Hosts such as Memento only need to select `delta-science`. The Skill selects the tool and
|
|
354
|
+
operation from a natural-language research goal and loads only the reference for the current
|
|
355
|
+
tool, avoiding the planner overhead of many independent Skills. Upgrades automatically remove
|
|
356
|
+
the old standalone Science Skills.
|
|
357
|
+
|
|
358
|
+
### Adding a Science tool or operation
|
|
359
|
+
|
|
360
|
+
The tool catalog is maintained by the Science Server database. To add a tool, configure a
|
|
361
|
+
`tools` record and its `tool_endpoints` records; set `status=false` to disable. The CLI needs
|
|
362
|
+
no static table sync or new commands. To let an AI auto-select a new tool and safely assemble
|
|
363
|
+
requests, also update the tool-selection table in `skills/delta-science/SKILL.md` and the
|
|
364
|
+
corresponding `skills/delta-science/references/<tool>.md`; the references directory holds only
|
|
365
|
+
real tool docs, never meta-docs such as catalogs, routing, service maps or cross-tool
|
|
366
|
+
workflows. The canonical tool name in the database must exactly match the tool table and its
|
|
367
|
+
reference.
|
|
368
|
+
|
|
369
|
+
## Development
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
# Local build
|
|
373
|
+
make build
|
|
374
|
+
|
|
375
|
+
# Run tests
|
|
376
|
+
make test
|
|
377
|
+
|
|
378
|
+
# Lint
|
|
379
|
+
make lint
|
|
380
|
+
|
|
381
|
+
# Cross-platform build (produces platform binaries in bin/)
|
|
382
|
+
make release
|
|
383
|
+
|
|
384
|
+
# Install into the system PATH from source (default /usr/local/bin; macOS / Linux)
|
|
385
|
+
make install
|
|
386
|
+
|
|
387
|
+
# Custom install prefix
|
|
388
|
+
make PREFIX=$HOME/.local install
|
|
389
|
+
|
|
390
|
+
# Windows source install (pick one)
|
|
391
|
+
# A: install to GOPATH/bin with go install
|
|
392
|
+
go install github.com/delta-infra/delta-infra-cli/cmd/delta-cli@latest
|
|
393
|
+
|
|
394
|
+
# B: run the PowerShell script from the repo root to build and add to the user PATH
|
|
395
|
+
# .\install-from-source.ps1
|
|
396
|
+
# .\install-from-source.ps1 -InstallDir "$env:USERPROFILE\bin"
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Daily development flow
|
|
400
|
+
|
|
401
|
+
After modifying `skills/` or building `delta-cli`, sync to the Memento-S project for it to take effect:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# 1. Sync the full Skill set via the install wizard
|
|
405
|
+
node scripts/install-wizard.js
|
|
406
|
+
|
|
407
|
+
# 2. Build the Windows version with Docker (when no local Go toolchain is available)
|
|
408
|
+
docker run --rm -v "$(pwd):/src" -w /src \
|
|
409
|
+
-e GOPROXY=https://proxy.golang.org,direct \
|
|
410
|
+
golang:1.23 \
|
|
411
|
+
sh -c 'go build -buildvcs=false \
|
|
412
|
+
-ldflags "-X github.com/delta-infra/delta-infra-cli/internal/build.Version=$(git describe --tags --always --dirty 2>/dev/null || echo dev)" \
|
|
413
|
+
-o bin/delta-cli-windows-amd64.exe ./cmd/delta-cli'
|
|
414
|
+
|
|
415
|
+
# 3. Place delta-cli into Memento-S's node_modules/.bin (replacing the old version)
|
|
416
|
+
cp bin/delta-cli-windows-amd64.exe \
|
|
417
|
+
<memento-s>/electron_rebuild/node_modules/.bin/delta-cli
|
|
418
|
+
|
|
419
|
+
# 4. Restart the Memento-S sidecar to pick up the new binary
|
|
420
|
+
# Reload in the Electron UI, or restart the sidecar process manually
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
> **Note**: after replacing `delta-cli`, if a token is already configured in `~/.delta-infra/config.json`,
|
|
424
|
+
> the Sandbox and Science Skills work immediately; otherwise configure it first with `auth login`.
|
|
425
|
+
|
|
426
|
+
## Build and Release
|
|
427
|
+
|
|
428
|
+
### Local build
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Local build
|
|
432
|
+
make build
|
|
433
|
+
|
|
434
|
+
# Run tests
|
|
435
|
+
make test
|
|
436
|
+
|
|
437
|
+
# Lint
|
|
438
|
+
make lint
|
|
439
|
+
|
|
440
|
+
# Cross-platform build (produces platform binaries in bin/)
|
|
441
|
+
make release
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
> `make release` only produces platform binaries (e.g. `bin/delta-cli-linux-amd64`); it does not package them. Use `release.sh` for packaging and publishing.
|
|
445
|
+
|
|
446
|
+
### One-click release (maintainers)
|
|
447
|
+
|
|
448
|
+
The `release.sh` script at the repo root drives the full release flow:
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
export GH_TOKEN=<your-github-pat>
|
|
452
|
+
export NPM_TOKEN=<your-npm-token>
|
|
453
|
+
./release.sh v1.1.19
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Script steps:
|
|
457
|
+
1. Update the `package.json` version.
|
|
458
|
+
2. Cross-compile the 5 platform binaries (prefers Docker + `make release`, falls back to the local Go toolchain when Docker is unavailable).
|
|
459
|
+
3. Produce `.tar.gz` / `.zip` archives and SHA-256 checksums in `bin/`, and update the root `checksums.txt`.
|
|
460
|
+
4. Create the GitHub Release and upload the binary archives and checksums via `.ci/publish-github-release.js`.
|
|
461
|
+
5. Sync the npm scripts, README and all Skills to the public repo `delta-agentcloud/delta-cli`.
|
|
462
|
+
6. Run `npm publish --access public` to publish `@delta-agentcloud/cli`.
|
|
463
|
+
7. Create the local source commit and Git tag; the source GitLab remote is pushed only when `PUSH_SOURCE=1` is explicitly set.
|
|
464
|
+
|
|
465
|
+
`gh` CLI and Node.js/npm must be installed, and `GH_TOKEN` and `NPM_TOKEN` configured. See `.gitlab-ci.yml` for the CI flow.
|
|
466
|
+
|
|
467
|
+
## In-sandbox mirror auto-configuration
|
|
468
|
+
|
|
469
|
+
At sandbox creation, the server **auto-detects the deployment's network region** (mainland China / overseas) and, when the region is mainland China, injects mirror configuration into the container. No manual configuration is needed — it works on entry.
|
|
470
|
+
|
|
471
|
+
- **Mainland China (domestic)**: the server injects mirror config so `pip install` / `npm install` / `git clone` / HuggingFace downloads use domestic mirrors.
|
|
472
|
+
- **Overseas**: no mirrors are injected; each package manager uses its official source.
|
|
473
|
+
- The server probes connectivity to `pypi.org` / `npmjs.org` to decide the region (cached; falls back to overseas on probe failure, i.e. fail-open).
|
|
474
|
+
|
|
475
|
+
Four categories of configuration are covered:
|
|
476
|
+
|
|
477
|
+
| Type | Description | Example |
|
|
478
|
+
|------|-------------|---------|
|
|
479
|
+
| pip index-url | Python package index | `https://pypi.tuna.tsinghua.edu.cn/simple` |
|
|
480
|
+
| npm registry | Node package source | `https://registry.npmmirror.com` |
|
|
481
|
+
| HF_ENDPOINT | HuggingFace download domain | `https://hf-mirror.com` |
|
|
482
|
+
| git insteadOf | GitHub clone proxy | `https://gh-proxy.com/https://github.com` |
|
|
483
|
+
|
|
484
|
+
The AutoDL compute backend has mirror injection off by default (overseas platform); it takes effect only when operations explicitly enable it.
|
|
485
|
+
|
|
486
|
+
> **Note the two separate mirror mechanisms**: this in-sandbox mirror config targets the **package managers inside the sandbox** (pip / npm / git / HF). It is unrelated to the CLI's own download mirror `DELTA_CLI_MIRROR` — `DELTA_CLI_MIRROR` is used only to **install the delta-cli binary** and does not affect the sandbox.
|
|
487
|
+
|
|
488
|
+
## Tech stack
|
|
489
|
+
|
|
490
|
+
- **Language**: Go 1.23+
|
|
491
|
+
- **CLI framework**: [Cobra](https://github.com/spf13/cobra)
|
|
492
|
+
- **Config**: JSON file (`~/.delta-infra/config.json`, mode 0600)
|
|
493
|
+
- **Output**: JSON envelope (AI-agent friendly, scriptable)
|
|
494
|
+
- **Distribution**: GitHub Release (tar.gz/zip) + npm wrapper
|
|
495
|
+
- **Architecture**: flat static command tree, Factory dependency injection, lazy initialization
|
|
496
|
+
|
|
497
|
+
## License
|
|
498
|
+
|
|
499
|
+
MIT
|
package/checksums.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
4afefbba3350e2ec327ef06f619a545ebe1d073b1b3e114b168bc89c5d2b65c0 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
527371efd7cb487b5b9f204cf275909d6e91761d581cc22fed29e299e8fe07e5 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
bc8a485c30d035b3c48a8f95ce703a89d57f33385a39af49e10bb7da169fce5e delta-cli-linux-amd64.tar.gz
|
|
4
|
+
c4c7452a629dc4134cd0c8a9d6474f73a99e659ddfb3da365557c6a14521e002 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
3228551b42bdefd49304f7e34e12132eb4563111dd4c7c31c940f002e7815741 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delta-agentcloud/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.22",
|
|
4
|
+
"description": "Delta Agent Cloud CLI for sandbox compute and science tools.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"delta-cli": "scripts/run.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node scripts/install.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"checksums.txt",
|
|
13
|
+
"scripts/install.js",
|
|
14
|
+
"scripts/install-wizard.js",
|
|
15
|
+
"scripts/run.js",
|
|
16
|
+
"skills/manifest.json",
|
|
17
|
+
"skills/delta-sandbox/",
|
|
18
|
+
"skills/delta-shared/",
|
|
19
|
+
"skills/delta-science/",
|
|
20
|
+
"skills/delta-protein/"
|
|
21
|
+
],
|
|
22
|
+
"os": [
|
|
23
|
+
"darwin",
|
|
24
|
+
"linux",
|
|
25
|
+
"win32"
|
|
26
|
+
],
|
|
27
|
+
"cpu": [
|
|
28
|
+
"x64",
|
|
29
|
+
"arm64"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"delta",
|
|
33
|
+
"sandbox",
|
|
34
|
+
"cli",
|
|
35
|
+
"gpu",
|
|
36
|
+
"compute"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/delta-agentcloud/delta-cli.git"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@clack/prompts": "^1.2.0"
|
|
48
|
+
}
|
|
49
|
+
}
|