---
id: 01a232fb-7f1a-77b4-a00a-5787de8fcbbe
seq: 51
form: page
type: runbook
title: 'Share documents with a person or circle: collect, approve on a form, deliver by reference (share-docs)'
description: 'Collect files from Gmail, Drive, a GitHub release, a folder or a URL, let the person tick files and recipients on a bashy form, and deliver each approved file to each chosen member or circle as a reference that expires, by the cheapest route. WHEN a person asks to get some files and share them with a known person or circle, from any assistant (keywords: share, documents, pdf, attachments, circle, member, form, approve, route, time-boxed, reference, share-docs)'
tags:
    - share
    - documents
    - form
    - members
    - example
status: candidate
evidence: '2026-12-01: go test in examples/share-docs (fake sources, members, form, routes, notify); the form step also run against the real bashy form on a dev host.'
source:
    tool: claude-fable5.2-g
    episode: ep-1f30bfeb0f8fac52
    parent_episode: ep-90865e79986cbf8f
created: "2026-12-01T19:01:12Z"
---

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

```sh
bashy share-docs run --from "gmail:from:ada@example.com has:attachment" --match '*.pdf' \
    --to family --to Bob --open
```

1. **collect**: stages the files with size, sha256, source and sender.
2. **form**: a bashy form with one checkbox per document (title, verify line, view link) and one per circle
   and member (`bashy member ls`). `--to` ticks 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. `--open`
   opens the page.
3. **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 command `share-route-NAME`. It is called with
  `offer --file PATH --name TITLE --sha256 HEX --size N --to EMAIL --expires RFC3339`, prints
  `{"ref": "..."}`, and exits non-zero when it cannot reach that recipient. `relay` is last and only for
  files up to `SHARE_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.
