| name | shortcut-share-file |
| version | 2.1.0 |
| description | Share iCloud Drive files via the iOS Shortcut "Speed Share". Trigger when the user mentions "share file", "send file", "share to xxx", "share via shortcut", "send file from backup", or similar file-sharing operations. Supports passing any file path under the iCloud Drive backup directory to the shortcut. |
Share File — Shortcut "Speed Share"
Shortcut link: https://www.icloud.com/shortcuts/c0cd9fbdc42149c3b98e4f9fcb103011
Core Principles
- No processing, no checks: No unzipping, no listing contents, no checking file types, no confirming file existence. Just go straight to sharing.
- File path: Source files on iCloud map to
/var/minis/mounts/iCloud/SpeedShare/, pass parameter as SpeedShare/<filename> (relative path, not absolute).
Workflow
A. Speed Test (prefer memory cache)
memory_get(keywords="iperf3 speed test upload speed")
- Has record and within 24 hours → Use
upload_MBs value directly
- No record or expired → Execute:
iperf3 -c ping.online.net -t 3 --json 2>/dev/null | python3 -c "import sys,json;d=json.load(sys.stdin);bps=d['end']['sum_sent']['bits_per_second'];print(f'{bps/8000000:.2f}')"
Output is MB/s (megabytes per second), immediately write to memory:
memory_write(content="## Speed Test Cache\n- upload_MBs: <value> (<date>)\n- Valid for 24 hours")
B. Copy File (if needed) and Calculate Time
If the file is not under /var/minis/mounts/iCloud/SpeedShare/:
cp <source_path> /var/minis/mounts/iCloud/SpeedShare/<filename>
Calculate parameter suffix:
- From other iCloud directory →
--0Second
- From external sources like attachments →
--<ceil(file_size_MB / upload_MBs * 1.2)>Second (add 20% margin for network fluctuation)
C. Invoke Shortcut
apple-open "shortcuts://run-shortcut?name=%E6%9E%81%E9%80%9F%E5%88%86%E4%BA%AB&input=text&text=%E6%9E%81%E9%80%9F%E5%88%86%E4%BA%AB/<filename>--<time>Second"
User Feedback
「Shortcut has started. Once complete, the link will be automatically copied to the clipboard — you can paste and send directly.」
Bundled Resources
- Help Document — Installation steps, feature overview, usage guide. Provide when the user has questions.