Universal Clipboard API service on Cloudflare Workers.
- Create own clipboard API service
- Simple GET/POST API
- Delete data automatically. Default: 60 seconds
- Fork this repository
git clone https://github.com/azu/uni-clipboard
cd uni-clipboard
- Create
UNI_CLIPBOARD
KV namespaces
wrangler kv:namespace create "UNI_CLIPBOARD" --preview
wrangler kv:namespace create "UNI_CLIPBOARD"
- Put
UNI_TOKEN
for security
$ wrangler secret put UNI_TOKEN
XXX
Get clipboard
await fetch('https://uni-clipboard.{your}.workers.dev/?token=XXX')
Update clipboard
await fetch("https://uni-clipboard.{your}.workers.dev/?token=XXX", { method: "post", body: "New Content"})
You can use Shortcuts and Alfred as client.
For example, Alfred allow you to use ShellScript.
Push your clipboard to uni-clipboard.
c=$(pbpaste | /usr/local/bin/jq -aRs .)
curl -X POST -H "Content-Type: application/json" -d "{\"value\":${c}}" \
"https://uni-clipboard.{you}.workers.dev/?token={token}"
Read clipboard text from uni-clipboard
curl "https://uni-clipboard.{you}.workers.dev/?token={token}" | pbocpy
wranger dev
wranger publish
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT