Zynk CLI

Ready-to-use scripts

Two ready-to-use Bash wrappers that send and accept transfers, read the JSON stream, and report a clear outcome.

Send script

Save this as json-send.sh. It submits a transfer, reads the whole NDJSON stream, and reports whether the request was accepted.

Save as json-send.sh

This reads the complete result and reports submitted, rejected, or outcome unknown. A submitted result confirms the request, not delivery to the recipient.

Run the send script

$ bash json-send.sh -- Alice ./report.pdf

Replace Alice and ./report.pdf with your recipient and file. The -- separator goes before the recipient and paths.

Set a response timeout and save the JSON

$ bash json-send.sh --wait-timeout 10s -- Alice ./report.pdf > send.jsonl

General Zynk options go before --. JSON is saved to send.jsonl; the short explanation still appears in the terminal.

Accept script

Save this as json-accept.sh. It accepts pending transfers and tracks requested IDs separately from completed downloads.

Save as json-accept.sh

This tracks requested IDs separately from completed downloads, including when only part of a batch succeeds.

Run the accept script

$ bash json-accept.sh -- --all --save-dir ./Downloads

This accepts every transfer that is still waiting into ./Downloads, so check pending --all first when you only want some of them. Accept options go after the -- separator.

Output and exit status

These scripts collect output and report after Zynk finishes. They preserve Zynk’s exit status when they can read the output. Missing tools or invalid output cause the scripts themselves to fail. Set ZYNK_BIN to use a different Zynk binary.