Use this when a person asks for some files and wants them shared: “get the PDFs from Ada’s mail and share them with my family circle and Bob”. One command collects, the person approves on a form, and each approved file goes to each chosen member as a reference that expires. Nothing is shared before the form is submitted.
share-docs is a Bash# example command (examples/share-docs/share-docs.bsh). bashy-defaults apply
registers it; bashy share-docs --skill prints its guide. It is experimental (example level).
The one command
bashy share-docs run --from "gmail:from:ada@example.com has:attachment" --match '*.pdf' \
--to family --to Bob --open
- collect: stages the files with size, sha256, source and sender.
- form: a bashy form with one checkbox per document (title, verify line, view link) and one per circle
and member (
bashy member ls).--toticks the circle or person named in the request; a name that matches nothing, or more than one member, is refused. No document is ticked for the person.--openopens the page. - deliver: waits for the form (
--timeout, default 30m). Submitting is the approval: exactly the files ticked and the recipients chosen, once, for this batch.
The steps also run one at a time (collect, form, deliver) on the same batch. status [--json] shows
the staging list and the delivery record; expire removes access whose time box (--ttl, default 24h) ended.
Agents: tell the person the form is open and wait. Never submit it for them.
Sources
--from takes gmail:QUERY, drive:NAME (both through bashy google, see [[gmail-setup-send-and-verify]]),
gh:OWNER/REPO[@TAG] (release assets), folder:DIR, url:URL, or cmd:NAME [ARGS] for any registered
command. A source command writes into $SHARE_DOCS_FILES and prints one JSON object per file:
{"path": "...", "source": "...", "sender": "...", "link": "..."}.
Routes: cheapest first
Each file goes to each recipient by the first route that works (SHARE_DOCS_ROUTES, default
store lan sphere satellite relay):
store: the file is in the person’s Drive, so their own account grants that one member read access that expires. No bytes move.lan,sphere,satellite,relay: the registered commandshare-route-NAME. It is called withoffer --file PATH --name TITLE --sha256 HEX --size N --to EMAIL --expires RFC3339, prints{"ref": "..."}, and exits non-zero when it cannot reach that recipient.relayis last and only for files up toSHARE_DOCS_RELAY_MAX_BYTES(default 10485760).
No route command ships yet: until you register one, only files collected from Drive can be delivered. A rung with no command is skipped, and the record says so. When no route works the file is not shared and the command exits 1.
The recipient is told with bashy notify --to EMAIL "<subject with the reference>". bashy notify
reaches only recipients this host can address; for anyone else the file is still shared and the record
says notified: false, so tell the person to pass the reference on. Set SHARE_DOCS_NOTIFY to a
registered command for another channel, such as a room post.
What is checked at delivery
- The member list is read again. A stale list shares nothing; only active, mutual members receive a file; a circle means its members at that moment.
- A staged file whose sha256 changed since staging is refused.
- The form shows titles, checksums and links, never file bytes.