You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ The application follows a command-line interface pattern using the Cobra library
21
21
-**credentials.go**: Registry credential management (list, add, update, delete) with REST API integration
22
22
-**landing.go**: Landing page management (show, update, remove) with REST API integration
23
23
-**vuln.go**: Vulnerability scanning for Julia packages via REST API
24
+
-**scan.go**: Trivy manifest scanning — discover and upload a Julia manifest (+ optional project file) and fetch results via the StaticAnalysis service. Manifest discovery recognizes every name Julia/Pkg accepts (`Manifest.toml`, `JuliaManifest.toml`, and version-specific `Manifest-v1.11.toml` / `JuliaManifest-v1.11.toml`); when a directory holds more than one, the user is prompted to select (defaults to the highest-precedence candidate). Project file is `Project.toml` or `JuliaProject.toml`
24
25
-**git.go**: Git integration (clone, push, fetch, pull) with JuliaHub authentication
25
26
-**julia.go**: Julia installation and management
26
27
-**run.go**: Julia execution with JuliaHub configuration
@@ -62,6 +63,7 @@ The application follows a command-line interface pattern using the Cobra library
-`jh vuln`: Vulnerability scanning for Julia packages (REST API; defaults to latest stable version via `GET /docs/<registry>/<package>/versions.json`; supports `--version` for a specific version, `--registry` to specify the registry for version lookup (default: General), `--advisory` to filter to a specific advisory ID, `--all` to show all advisories regardless of affected status, and `--verbose` for additional details)
66
+
-`jh scan`: Manifest vulnerability scanning via the StaticAnalysis service (REST API under `/api/v0/static_analysis/`); uploads a `Manifest.toml` (and sibling `Project.toml` unless `--no-project`) and POSTs to `/manifest/scan` to obtain a `run_uuid`; subcommands `status` and `results` hit `/manifest/scan/status/{run_uuid}` and `/results/manifest/{run_uuid}`; **polls by default** and prints results when the scan completes — Ctrl+C detaches and the `run_uuid` (printed up front) can be passed to `jh scan status` / `jh scan results` later. Pass `--no-wait` to submit-and-exit. `--csv` requests `text/csv` (content-negotiated via `Accept` header)
65
67
-`jh clone`: Git clone with JuliaHub authentication and project name resolution
66
68
-`jh push/fetch/pull`: Git operations with JuliaHub authentication
67
69
-`jh git-credential`: Git credential helper for seamless authentication
@@ -229,6 +231,26 @@ go run . vuln MyPkg --registry MyRegistry
229
231
go run . vuln SomePackage -s nightly.juliahub.dev
230
232
```
231
233
234
+
### Test manifest scan operations
235
+
```bash
236
+
# Submit a scan for the current directory's Manifest.toml (+ sibling Project.toml);
237
+
# polls until done by default. Ctrl+C detaches — the scan keeps running on the server.
238
+
go run . scan
239
+
240
+
# Scan a project directory (still polls until done)
241
+
go run . scan ./my-project
242
+
243
+
# Scan an explicit manifest, write CSV results to a file
244
+
go run . scan Manifest.toml --project=Project.toml --csv --output results.csv
245
+
246
+
# Submit and return immediately without polling
247
+
go run . scan --no-wait
248
+
249
+
# Check status / fetch results for an earlier run_uuid
250
+
go run . scan status <run-uuid>
251
+
go run . scan results <run-uuid> --csv
252
+
```
253
+
232
254
### Test Git operations
233
255
```bash
234
256
go run . clone john/my-project # Clone from another user
- Advisory IDs are clickable links to the JuliaLang SecurityAdvisories repository
267
268
- Each advisory shows: severity scores, affected status, full summary, affected versions, and version ranges
268
269
270
+
### Manifest Scanning (`jh scan`)
271
+
272
+
-`jh scan [path]` - Upload a `Manifest.toml` (and the sibling `Project.toml` when present), queue a Trivy vulnerability scan, and (by default) poll until it finishes
273
+
-`path` may be a directory (looks for `Manifest.toml` and `Project.toml` inside) or a manifest file; defaults to the current directory
274
+
-`--project <path>` - Use an explicit `Project.toml` instead of the auto-detected sibling
275
+
-`--no-project` - Skip the `Project.toml` even if a sibling exists
276
+
-`--tool <id>` - Static analysis tool id (default: `juliahub-trivy`)
277
+
-`--no-wait` - Submit and return immediately, printing only the `run_uuid`
278
+
-`--csv` - Request results as CSV (negotiated via the `Accept` header; ignored with `--no-wait`)
279
+
-`--output <file>` / `-o` - Write the results to a file instead of stdout
280
+
-`--poll-interval <sec>` - Poll cadence while waiting (default: 3)
281
+
-`--timeout <sec>` - Max seconds to wait for the scan (default: 600)
282
+
- The `run_uuid` is printed up front, so Ctrl+C during polling leaves the scan running on the server; resume with `jh scan status` / `jh scan results`
283
+
-`jh scan status <run-uuid>` - Show lifecycle status (`staging`, `initiated`, `queued`, `completed`, `failed`) plus tool/timing info and any failure reason
284
+
-`jh scan results <run-uuid>` - Fetch results for a finished scan
285
+
-`--csv` - CSV output instead of JSON
286
+
-`--output <file>` / `-o` - Write to a file instead of stdout
287
+
269
288
### Update (`jh update`)
270
289
271
290
-`jh update` - Check for updates and automatically install the latest version
0 commit comments