Share a link from any app to file it in your instance's inbox, ready for the next ingest. One shortcut handles any number of instances: with one instance it files silently; with several it shows a picker.
- Create your token first (see Before you begin).
- Open this link on your iPhone or iPad and add the shortcut: https://www.icloud.com/shortcuts/2787a68310624fdb9584080dcc313e62
- On import, a Customize Shortcut screen asks two questions:
- Your instances — for each dex instance, tap Add new item, choose
Text, and set key = its display name, text = its GitHub repo as
owner/repo. - Your token — paste it.
- Your instances — for each dex instance, tap Add new item, choose
Text, and set key = its display name, text = its GitHub repo as
- Share something to test it (see Try it).
Create a token that the shortcut uses to file captures:
- On GitHub, go to Settings > Developer settings > Fine-grained tokens and tap Generate new token.
- Name the token so future-you knows what it is — for example
send-to-dex— and add a description like "Files captures from my phone into dex instance inboxes. Lives inside the Send To Dex shortcut." - Set Expiration to No expiration. The shortcut breaks silently the day a token expires; if you prefer an expiring token, set a calendar reminder to rotate it.
- Under Repository access, select only your instance repo (or repos).
- Under Permissions, set Contents to Read and write.
- Generate the token and copy it.
Fine-grained tokens work for one account or organization at a time. Every repo in one shortcut must belong to the same owner.
If your instance repo is owned by an organization (not your personal
account): fine-grained tokens hit two org policies — the org must be chosen as
the token's Resource owner, and org-owned tokens can't be non-expiring. The
practical alternative is a classic token (Tokens (classic), scope repo,
No expiration) — it works identically in this shortcut, at the cost of broader
access. The org must allow classic PAT access in its settings.
When you add a new dex instance later, also add its repo to this token's Repository access — an upload to a repo the token can't reach fails silently (GitHub returns a valid-looking 404, and the shortcut shows a checkmark).
Open the Shortcuts app and create a new shortcut, then work through the sections below in order.
Terms used throughout:
- An action is one building block of a shortcut — a box that does one thing. When a step says add an action, it means: search the actions panel for the action's name, then tap it to add it. The one exception is the Share Sheet setting at the end, which isn't an action.
- A shortcut is a chain: each action automatically passes its result to the action below it. When these instructions add several actions in a row, that automatic hand-off does the wiring.
- Add Set Variable named
xmeans: add the Set Variable action, tap Variable Name, and typex. Its input is whatever the action above produced, unless a step says to repoint it. - Repoint it to
xmeans: tap the blue variable chip, tap Clear (the panel closes and the field shows a faded placeholder), then tap the faded placeholder and pickxfrom the bar that appears. If the bar doesn't list it, tap Select Variable — the editor switches to a view with a blue token beneath every action — and tap the token beneath the action whose result you want. - Place the next actions between two rows (for example between If and Otherwise): new actions land at the bottom of the shortcut — touch and hold each one and drag it up until it sits indented directly beneath the row it belongs under.
- Each step ends with what the finished row reads. If your row reads differently, fix it before moving on.
The dictionary lists your instances. It's the only thing you edit when you add an instance later.
- Add Dictionary.
- For each instance, tap Add new item, then:
- Choose Text as the item type.
- Set the key to the instance's display name.
- Set the text value to the instance's repo path.
For example:
- key =
Cooking, text =you/dex-cooking - key =
Travel, text =you/dex-travel
Store the token once, under a name, so later steps can use it.
- Add Text. It appears as an empty text box — paste your token into it.
- Add Set Variable below it, named
token. The row reads "Set variabletokentoText".
These actions pick the destination instance — and skip the picker entirely when your dictionary has only one instance in it.
- Add Get Dictionary Value. Tap the highlighted word Value and change
it to All Keys, then repoint its source to
Dictionary. The row reads "Get All Keys inDictionary". - Add Count. The row reads "Count Items in
Dictionary Value". - Add If. This adds three connected rows at once — If, Otherwise,
and End If: actions between If and Otherwise run when the
condition is true; actions between Otherwise and End If run when it
isn't. Tap the faded Number and enter 1, ignoring the +
after it. The row reads "If
Countis 1".
Place the next actions between If and Otherwise. They run when there is one instance — use it without asking:
- Add Get Dictionary Value. Change Value
to All Values, and repoint its source to
Dictionaryif needed. The row reads "Get All Values inDictionary". - Add Set Variable below it, named
repo. The row reads "Set variablerepotoDictionary Value".
Place the next actions between Otherwise and End If. They run when there are several instances — show a picker:
- Add Choose from List. Repoint its
input to the result of step 1 (use Select Variable and tap the token
beneath "Get All Keys in
Dictionary"). Tap the arrow on the action and set Prompt toWhich dex?. The row reads "Choose fromDictionary Value". - Add Get Dictionary Value below it. Repoint its source (after "in") to
Dictionary. Tap the faded key field and pickSelected Itemfrom the horizontally scrollable bar at the bottom of the screen. The row reads "Get Value forSelected IteminDictionary". - Add Set Variable below it, named
repo. The row reads "Set variablerepotoDictionary Value".
This step asks for an optional note with each capture.
- Add Ask for Input. Set its type to Text and its prompt to
Why? (optional). Leave the default answer empty. The row reads "Ask for Text with "Why? (optional)"".
These actions write the capture into the instance repo.
- Add Date. The row reads "Current Date".
- Add Format Date. Set Date Format to Custom and the format
string to
yyyyMMdd-HHmmss. The row reads "FormatDate". - Add Set Variable below it, named
stamp. The row reads "Set variablestamptoFormatted Date". - Add Get URLs from Input. Repoint it to
Shortcut Input. The row reads "Get URLs fromShortcut Input". - Add Count. Repoint it to
URLsif it connected to anything else. The row reads "Count Items inURLs". - Add If. Tap the faded Number and enter 0. Delete its
Otherwise row. The row reads "If
Countis 0".
Place the next actions inside it. They run when no URL was shared:
- Add Get Images from Input. Repoint it to
Shortcut Input. The row reads "Get images fromShortcut Input". - Add Count below it. Repoint it to
Imagesif it connected to anything else. The row reads "Count Items inImages". - Add If below it, with the condition is greater than and the
number 0. The row reads "If
Countis greater than 0".
Place the next actions between that If and its Otherwise. They run when an image was shared:
- Add Resize Image. Repoint it to
Imagesif needed. Set the width to2048and leave the height on Auto Height. The row reads "ResizeImages". - Add Convert Image below it, converting to JPEG. The row reads
"Convert
Resized Imageto JPEG". - Add Set Variable below it, named
blob. The row reads "Set variableblobtoConverted Image". - Add Text below that, containing exactly
.jpg. - Add Set Variable below it, named
ext. The row reads "Set variableexttoText".
Place the next actions between its Otherwise and End If. They run when the share isn't an image:
-
Add Get Details of Files. Set the detail to File Extension, and repoint its input to
Shortcut Input. The row reads "Get File Extension ofShortcut Input". -
Add If below it, with the condition has any value. Delete its Otherwise row. The row reads "If
File Extensionhas any value".Place the next actions inside it. They run when a file was shared:
- Add Set Variable named
blob, repointing its input toShortcut Input. The row reads "Set variableblobtoShortcut Input". - Add Text below that, containing
.immediately followed by the File Extension variable. - Add Set Variable below it, named
ext. The row reads "Set variableexttoText".
- Add Set Variable named
The bottom of the shortcut now reads three End If rows in a row: the file-check End If, the image End If, then the URL-check End If, which returns to the top level.
Below that last End If:
-
Add If. Repoint its input to
blob, and set the condition to has any value. The row reads "Ifblobhas any value".Place the next actions between If and Otherwise. They run when a binary was shared:
-
Add Get Contents of URL. Configure:
- URL:
https://api.github.com/repos/+ therepovariable +/releases/tags/inbox - Method: GET
- Headers: key =
Authorization, text =Bearer+ space + thetokenvariable
- URL:
-
Add Get Dictionary Value below it. Type
idinto the key field; its source isContents of URL(repoint if it connected elsewhere). The row reads "Get Value foridinContents of URL". -
Add Set Variable below it, named
release. The row reads "Set variablereleasetoDictionary Value". -
Add Get Contents of URL below that. Configure:
- URL:
https://uploads.github.com/repos/+ therepovariable +/releases/+ thereleasevariable +/assets?name=+ thestampvariable + theextvariable - Method: POST
- Headers:
- key =
Authorization, text =Bearer+ space + thetokenvariable - key =
Content-Type, text =application/octet-stream
- key =
- Request Body: File, set to the
blobvariable.
- URL:
-
Add Get Dictionary Value below it. Type
urlinto the key field; its source isContents of URL(the POST directly above). The row reads "Get Value forurlinContents of URL". -
Add Set Variable below it, named
asset. The row reads "Set variableassettoDictionary Value". -
Add Text below that, containing exactly five lines then your note:
--- asset: [asset] name: [stamp][ext] --- [Ask for Input]Each bracketed name is that variable; type the surrounding characters literally.
[stamp][ext]sit together with no space. -
Add Set Variable below it, named
payload. The row reads "Set variablepayloadtoText".
Place the next actions between Otherwise and End If. They run when a link or text was shared:
- Add Text. First line: the
Shortcut Inputvariable. Then an empty line, then theAsk for Inputvariable. - Add Set Variable below it, named
payload. The row reads "Set variablepayloadtoText".
-
Below that End If, at the top level of the shortcut:
- Add Base64 Encode. Repoint its input to
payload. Expand its options and set Line Breaks to None. The row reads "Base64 Encodepayload". - Add Get Contents of URL below it. Configure:
- URL:
https://api.github.com/repos/+ therepovariable +/contents/inbox/+ thestampvariable +.md - Method: PUT
- Headers:
- key =
Authorization, text =Bearer+ space + thetokenvariable - key =
Accept, text =application/vnd.github+json
- key =
- Request Body JSON, two text fields:
- key =
message, text = the literal wordcapture - key =
content, text = theBase64 Encodedvariable (the action above)
- key =
- URL:
This makes the shortcut appear when you tap Share in other apps, and defines what kinds of shares it accepts. It's a shortcut setting, not an action — you won't find it by searching the actions panel.
- Tap the name at the top and rename the shortcut to Send To Dex.
- Dismiss the actions panel if it's covering the bottom of the editor (swipe it down or tap outside it).
- Tap the small info button (an ⓘ in a circle) at the bottom of the editor, turn on Show in Share Sheet, then tap the blue tick in the top-right corner.
- Scroll back to the top of the action list, above your Dictionary. A new action has appeared there reading "Receive Apps and 18 more from Share Sheet. If there's no input: Continue". Tap the highlighted Apps and 18 more chip.
- Everything is toggled on by default. Turn OFF the following and leave
everything else on — Media and PDFs stay ON, since the shortcut
captures them through the binary path:
- Folders
- Map links
- Locations
- Contacts
- Email addresses
- Phone numbers
- Dates
- iTunes products
- Tap the blue tick in the top-right corner to confirm the toggles.
- Tap Continue (after "If there's no input:") and change it to
Stop and Respond. It asks for a response — enter:
Nothing to send to Dex.
Import Questions (in the same ⓘ info panel) let a shared copy ask its new owner for their own values at import time. A field that has an import question is cleared automatically when the shortcut is shared — so your token never travels with it.
- In the info panel, tap Import Questions, then Add New Question.
- Working top to bottom: choose the Dictionary parameter (shown as
"Dictionary items"). Set the Question Text to:
For each dex instance you have (one or more), add an item of type Text: key = its name (e.g. Engineering), text = its GitHub repo as owner/repoLeave the Default Answer empty. Confirm. - Tap Add New Question again, choose the token Text parameter, and set its Question Text to something like "Paste your GitHub token (see Before you begin in the setup guide)". Confirm, then tap Done.
- Configure any copy — including yours — via Change Answers / Customize Shortcut: it re-asks the questions and writes the answers into the shortcut's fields.
- Share directly from your configured copy: fields that carry import questions are cleared automatically in the shared artifact, so your token and instances never travel. Each share produces a new link.
- Share as an iCloud link. On import, the questions appear as a Customize Shortcut screen: for the instances question the importer taps Add new item, chooses Text, and fills the key (name) and text (owner/repo) — repeating for each instance — then pastes their token for the second question.
Share any page from Safari. Within seconds a new commit appears on the
instance repo adding a .md file under inbox/ — that's the capture,
with your note in its body, waiting for the next ingest. Share a photo to see
the binary path: the resized image appears as an asset on the repo's inbox
release, and the committed .md points at it. The next ingest moves the
binary into the repo (under media/, LFS-tracked) and deletes the asset.
- Never share a shortcut whose token field lacks an import question — shared shortcuts embed whatever is in their fields. With the import question set (above), the token field is cleared on share and sharing is safe.
- The shortcut is one client of the capture protocol (
docs/capture.md) — any HTTP client can capture the same way: a bookmarklet or CLI alias works as well as a shortcut.