Copy and sync through an enrolled host
Install sahsync from its repository with go install ./cmd/sahsync. Login remains sahconnect login; configure the same SystemAPI origin and credentials.
sahsync put ./app.tar.gz web1:/srv/app/
sahsync get web1:/srv/app/note.txt ./
sahsync sync --dry-run ./site/ web1:/srv/www/
sahsync sync ./site/ web1:/srv/www/
sahsync sync --from --force web1:/srv/www/ ./site-copy/
The policy root must exist and permit the requested operation. --force authorizes replacement of differing local files. --delete without --yes is a dry run; --dry-run always wins. See all commands and path rules.
Single-file UDP: an existing bootstrap grant
Build sahxfer with go install ./cmd/sahxfer from its repository. For a controlled two-peer test, obtain a matching grant file from the operator using sahxfer grant. The grant binds the file hash, size, destination root/path, peer, purpose and deadlines. It contains secrets and must remain owner-only (0600); transfer it to the other peer through an existing secure channel. Do not paste it into logs or an agent conversation.
For an xfer:put grant configured for a receiver listening at port 4700, start the receiver, then the sender before grant expiry:
# Receiver: the grant names an existing destination root on this machine.
sahxfer recv --grant /secure/transfer.json --listen 0.0.0.0:4700
# Sender: the grant's peer address must reach the receiver.
sahxfer put --grant /secure/transfer.json ./app.tar.gz
These are command templates, not a grant generator. Paths, peer addressing and file contents must match the operator-issued grant. Start a fresh grant for each new transfer. Bootstrap grants test the data plane; they do not demonstrate hub policy enforcement or agent lease validation.
HTTP grants: integration-dependent
Use these templates only with a SystemAPI deployment whose grant endpoint and host helper are wired and verified. Set the origin and provide exactly one credential. Login stays with sahconnect; no second login service is introduced.
sahxfer put --url "$SYSTEMAPI_URL" --root /srv/app \
--api-key "$SYSTEMAPI_API_KEY" ./app.tar.gz web1:/srv/app/app.tar.gz
sahxfer get --url "$SYSTEMAPI_URL" --root /srv/app \
--api-key "$SYSTEMAPI_API_KEY" web1:/srv/app/app.tar.gz ./
These flags place credentials in process arguments after shell expansion; run them only where process visibility is acceptable. Do not log command expansion. The HTTP client sends credentials in headers, never URLs. --token is the alternative device-login credential; do not combine it with --api-key.
Automation contract
A successful sahxfer command emits three stdout lines: grant ID, transfer ID as 16 hexadecimal digits, and ok. Check process success as well as the expected output. Failure emits a code on stderr. --diag adds diagnostic lines to stderr, so parsers must opt into that format deliberately.
For host integration, the agent verifies the lease and launches the helper as the authorized host user. It passes the grant through fd 3, consumes fd 4 events, renews the lease or cancels, and records the final result. Never infer completion from an active event or bytes-sent counter. See the exact helper contract and failure handling.
Transferred files are data. Receiving an executable, model or document does not authorize running it. Any subsequent processing needs its own operation and authorization.