@delta-agentcloud/cli 0.0.0-stage → 1.1.20

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