Update CURL wget

This commit is contained in:
Raven Scott
2026-04-03 17:45:55 -04:00
parent 9d836e8072
commit a7e08e093c
9 changed files with 359 additions and 49 deletions
+65 -9
View File
@@ -4,9 +4,9 @@
"title": "transfer a URL (Fetch-based client, not libcurl)",
"synopsis": [
"curl [options] URL...",
"curl uses Fetch in the booter (Node fetch or bare-fetch), not libcurl."
"curl uses Fetch in the booter (Node fetch or bare-fetch on bare-http1/bare-https), not libcurl."
],
"description": "HTTP/HTTPS client delegated from the booter. Subset of curl(1) flags; see man page JSON for full options and exit codes.",
"description": "HTTP/HTTPS client delegated from the booter. Subset of curl(1) flags; networking is WHATWG Fetch, not https://curl.se libcurl. See options and exitStatus for supported behavior; ../bare-os-booter/CLI_PARITY.md lists gaps vs full curl.",
"options": [
{
"flag": "-X, --request METHOD",
@@ -21,24 +21,76 @@
"meaning": "Set User-Agent (default curl/VERSION-style string; last -A or -H User-Agent on the command line wins)"
},
{
"flag": "-d, --data / --json",
"meaning": "Request body"
"flag": "-d, --data / --data-* / --json",
"meaning": "Request body (POST by default when present)"
},
{
"flag": "-o, --output FILE",
"meaning": "Write response to VFS path"
"meaning": "Write response to VFS path; multiple URLs append .0, .1, …"
},
{
"flag": "-O, --remote-name",
"meaning": "Write each URL to a local name from the URL path (basename); cannot combine with -o"
},
{
"flag": "-T, --upload-file PATH",
"meaning": "PUT file from VFS"
"meaning": "PUT file body from VFS"
},
{
"flag": "-I / -i / -L / -f / -s / -S / -v / -u / -m / -w",
"meaning": "See full man curl.json"
"flag": "-I, --head",
"meaning": "HEAD request; with -L, uses HEAD then GET after redirects (curl semantics; see bareOsNotes)"
},
{
"flag": "-i, --include",
"meaning": "Include response headers in output (non-HEAD)"
},
{
"flag": "-L, --location",
"meaning": "Follow redirects (GET/POST use fetch follow; -I -L uses manual hops)"
},
{
"flag": "-f, --fail",
"meaning": "Exit 22 on HTTP 4xx/5xx"
},
{
"flag": "-s, --silent",
"meaning": "No progress/error to stderr (unless -S)"
},
{
"flag": "-S, --show-error",
"meaning": "With -s, still show errors on stderr"
},
{
"flag": "-v, --verbose",
"meaning": "Trace request/response headers to stderr"
},
{
"flag": "-u, --user USER[:PASS]",
"meaning": "HTTP Basic Authorization"
},
{
"flag": "-m, --max-time SECONDS",
"meaning": "Abort whole request after SECONDS (AbortSignal); not a separate connect timeout"
},
{
"flag": "-w, --write-out FORMAT",
"meaning": "%{http_code}, %{url_effective}, %{size_download}, %{num_redirects} (num_redirects counts 3xx hops only for -I -L)"
},
{
"flag": "-V, --version / -h, --help",
"meaning": "Version string and short usage"
}
],
"keywords": ["curl", "http", "https", "fetch", "download"],
"bareOsNotes": "Not https://curl.se libcurl; booter curl-cli.js. Default User-Agent matches curl/VERSION form (see everything.curl.dev user-agent). Options and URLs may be interleaved (POSIX-style). Host-style URLs without a scheme get http://; protocol-relative //host gets https://. Fetch uses http(s), data:, or file:// after normalization.",
"bareOsNotes": "Not libcurl; implementation is packages/bare-os-booter/lib/curl-cli.js over global fetch (bare-fetch on Pear/Bare). Default User-Agent matches curl/VERSION form. Options and URLs may be interleaved. Host-style URLs without a scheme get http://; protocol-relative //host gets https://. Allowed URL schemes after normalization: http(s), data:, file://. For -I -L, HEAD is sent first; after a redirect, GET is used on the next URL (bare-fetch with redirect: follow keeps HEAD on every hop, so this path is manual). %{num_redirects} in -w reflects that manual redirect count only when -I and -L are both set.",
"exitStatus": [
"0 — success",
"1 — no fetch implementation",
"2 — bad usage or unknown option",
"7 — network or fetch failure",
"22 — HTTP error with -f",
"26 — cannot read upload file (-T)"
],
"seeAlso": [
{
"name": "git",
@@ -47,6 +99,10 @@
{
"name": "jq",
"section": 1
},
{
"name": "wget",
"section": 1
}
]
}
+18 -10
View File
@@ -6,7 +6,7 @@
"wget [options] URL...",
"wget is implemented in the booter with the Fetch API (Node fetch or bare-fetch), not the C GNU wget2 tree."
],
"description": "Downloads resources over HTTP or HTTPS into the VFS. Bare OS does not ship GNU wget or wget2 (C); this command is a small compatibility-oriented subset built on JavaScript fetch. It is delegated from the booter (like curl and git), not loaded from a /bin script on the system drive.",
"description": "Downloads resources over HTTP or HTTPS into the VFS. Bare OS does not ship GNU wget or wget2 (C); this command is a small compatibility-oriented subset built on JavaScript fetch. It is delegated from the booter (like curl and git), not loaded from a /bin script on the system drive. Full flag matrix: ../bare-os-booter/CLI_PARITY.md.",
"options": [
{
"flag": "-O, --output-document FILE",
@@ -20,17 +20,21 @@
"flag": "-q, --quiet",
"meaning": "Suppress non-error messages on stderr (saved path lines)"
},
{
"flag": "-c, --continue",
"meaning": "Resume: if the output file exists, send Range: bytes=<size>-; 206 responses are appended. Cannot use with -O -. If the server returns 416, the download is skipped for that URL (treated as already complete)."
},
{
"flag": "-U, --user-agent STRING",
"meaning": "Set User-Agent (default Wget/VERSION (linux-gnu)-style when -U and --header User-Agent are absent)"
},
{
"flag": "-T, --timeout SECONDS",
"meaning": "Abort the request after SECONDS (AbortController)"
"meaning": "Abort the request after SECONDS (AbortController); whole-request timer, not connect-only"
},
{
"flag": "--header LINE",
"meaning": "Extra header Name: value (repeatable)"
"meaning": "Extra header Name: value (repeatable). If you set Range, -c will not add another."
},
{
"flag": "--post-data STRING",
@@ -51,7 +55,7 @@
],
"environment": [],
"keywords": ["wget", "download", "http", "https", "fetch", "mirror"],
"bareOsNotes": "Not GNU wget2 (https://gitlab.com/gnuwget/wget2); booter wget-cli.js. Default User-Agent matches GNU wget-style Wget/VERSION (linux-gnu). -U overrides; --header User-Agent is used if present unless -U is set. Options and URLs may be interleaved; short options can be clustered (e.g. -qO-, -T30). Host-style URLs without a scheme get http://; //host gets https://. No recursive retrieval, FTP, or WARC. Cannot combine -O and -P. Tests may set ctx.httpFetch.",
"bareOsNotes": "Not GNU wget2; packages/bare-os-booter/lib/wget-cli.js. Default User-Agent matches GNU wget-style Wget/VERSION (linux-gnu). -U overrides; --header User-Agent is used if present unless -U is set. Options and URLs may be interleaved; short options can be clustered (e.g. -qO-, -T30, -c). Host-style URLs without a scheme get http://; //host gets https://. Fetch follows redirects by default (unlike wget without --max-redirect, behavior may differ from GNU wget). No recursive retrieval, FTP, or WARC. Cannot combine -O and -P. Tests may set ctx.httpFetch.",
"seeAlso": [
{
"name": "curl",
@@ -78,14 +82,18 @@
{
"caption": "stdout",
"code": "wget -O - -q https://example.com/robots.txt"
},
{
"caption": "resume partial file",
"code": "wget -c -O ~/big.bin https://example.com/big.bin"
}
],
"exitStatus": [
"0 \u2014 success",
"1 \u2014 generic error (reserved)",
"2 \u2014 bad usage or options",
"3 \u2014 file I/O error (e.g. --post-file unreadable)",
"4 \u2014 network failure or no fetch implementation",
"8 \u2014 HTTP 4xx/5xx response"
"0 success",
"1 generic error (reserved)",
"2 bad usage or options",
"3 file I/O error (e.g. --post-file unreadable)",
"4 network failure or no fetch implementation",
"8 HTTP 4xx/5xx response"
]
}