{ "name": "wget", "section": 1, "title": "non-interactive network download (Fetch-based, not GNU wget2)", "synopsis": [ "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. Full flag matrix: ../bare-os-booter/CLI_PARITY.md.", "options": [ { "flag": "-O, --output-document FILE", "meaning": "Write the body to FILE; use - for stdout. Only one URL allowed." }, { "flag": "-P, --directory-prefix DIR", "meaning": "Save under DIR using a name derived from the URL (last path segment, or index.html if the path ends with /)" }, { "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=-; 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); whole-request timer, not connect-only" }, { "flag": "--header LINE", "meaning": "Extra header Name: value (repeatable). If you set Range, -c will not add another." }, { "flag": "--post-data STRING", "meaning": "POST body (sets method POST; default Content-Type application/x-www-form-urlencoded)" }, { "flag": "--post-file PATH", "meaning": "POST body read from a file on the VFS" }, { "flag": "-V, --version", "meaning": "Print Bare OS wget version string" }, { "flag": "-h, --help", "meaning": "Short usage" } ], "environment": [], "keywords": ["wget", "download", "http", "https", "fetch", "mirror"], "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", "section": 1 }, { "name": "git", "section": 1 } ], "examples": [ { "caption": "save with default name in cwd", "code": "wget https://example.com/README" }, { "caption": "choose output path", "code": "wget -O ~/page.html https://example.com/" }, { "caption": "directory prefix", "code": "wget -P ~/dl https://example.com/a/b.bin" }, { "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 — 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" ] }