CLI reference / service / file-fetch

stado service file-fetch

Invocation

stado service file-fetch [OPTIONS] --host <HOST> --source-file <SOURCE_FILE> <NAME>

Purpose

Copy one file OUT of a managed service's target home, byte-exact. The opposite direction of `file-sync`, and the byte-exact counterpart of `env-show`. `env-show` sanitizes every value it reports — printable ASCII, quotes and backslashes replaced, long values clamped — because its job is to let an operator judge a file without a secret crossing the channel. The consequence is that it can diagnose a file and can never reproduce one byte of it, so live operator tooling that exists only on a host could not be put under version control without copying it off by hand, outside the approved channel. The host hashes the file itself, the bytes travel base64 inside the same encrypted channel's response, and the digest is recomputed HERE over the decoded bytes: a payload that lost a chunk decodes into something shorter and perfectly valid, so only two independently computed SHA-256s catch it. A mismatch writes nothing and exits non-zero. `$HOME` confinement and symlink refusal are `env-show`'s, word for word.

Required inputs and options

Input or optionContract
<NAME>Service whose host-local process owns the file
--host <HOST>The single registry host to read
--source-file <SOURCE_FILE>File on the target, absolute or rooted at $HOME
--dest-file <DEST_FILE>Absolute local path to write the fetched bytes to. Replaced atomically, owner-only. Omit to report on the file without keeping a copy
--jsonCommand option; required or optional as shown in the invocation.

Output and state effect

It performs the operation described above and emits its operator result on standard output or standard error. Any state change is limited to the resources and records named by the purpose and options on this page.

Refusals

  • Before dispatch, Stado refuses a missing required token shown in the invocation, an unknown option, or a value outside a listed value set; argument-usage failures exit with code 2.