Bring your Appwrite project into OpenClip. Select text anywhere on your Mac, open the Appwrite group, and hand the selection to your backend.
Commands#
More Appwrite commands will live in the same group; the connection settings below are per command.
With Execute Function, any Appwrite Function becomes a text tool: summarise, translate, rewrite with an LLM, look something up in your database, post to Slack — anything you can write in a Function.
Setup#
- Create a Function in the Appwrite Console (see the starter below, or use any Function that reads its request body as text).
- Either set the Function's Execute access to
Any, or create an API key with theexecution.writescope only, dedicated to this extension. - Install the extension, then configure Execute Function (under Appwrite in Preferences → Actions, or just run it once — OpenClip opens the configuration sheet for the missing values):
What your Function receives#
Execute Function creates a synchronous execution
(POST /v1/functions/{functionId}/executions) using the configured HTTP method and Path
(defaults GET and /). The request body is
the selected text, verbatim — no wrapper — so any Function that reads req.bodyText works,
whether or not it was written with OpenClip in mind.
- If the selection is a JSON object or array, it is sent as
content-type: application/json, soreq.bodyJsonparses it directly. Anything else is sent astext/plain; charset=utf-8. - Everything OpenClip knows about the run travels in request headers:
Your Function may reply with any of:
Starter Function (Node.js)#
The smallest Function that honours the contract. It trims the selection and Title-Cases it; swap the transform for a call to your favourite model to make it smart.
export default async ({ req, res, log }) => {
const text = req.bodyText ?? '';
const isCopyRun = req.headers['x-openclip-secondary'] === 'true';
if (!text.trim()) {
return res.json({ error: 'Nothing selected' }, 400);
}
const result = text
.trim()
.toLowerCase()
.replace(/\b\p{L}/gu, (c) => c.toUpperCase());
// Make it smart: replace `result` with a model call, e.g.
// const reply = await fetch('https://api.anthropic.com/v1/messages', { ... process.env.ANTHROPIC_API_KEY ... });
// and return res.json({ text: reply });
return res.json({ text: result });
};Keep the Function's timeout comfortably under 30 seconds: Appwrite hard-limits synchronous executions to 30 s, and OpenClip's own watchdog cancels the request at 60 s (you can also cancel by clicking the loading toast).
A ready-made template for the Appwrite templates gallery is planned; until then, paste the snippet above into a new Node.js Function.
Errors you may see#
Privacy#
The selected text leaves your Mac. It is sent over HTTPS to the Appwrite project you configured — Appwrite Cloud in the region of your endpoint, or your own self-hosted instance — and nowhere else, together with the bundle ID of the app it was selected in. The extension keeps no logs and sends no analytics. API keys are stored in OpenClip's secret store, not in plain preferences.
Requirements#
- OpenClip 1.1.0 or later.
- An Appwrite project (Cloud or self-hosted 1.4+). Execute Function needs a deployed Function.
- Internet access to your endpoint.
Credits#
Built by Matej "Meldiron" Bačo. The icon is the Appwrite logomark
from the appwrite/appwrite repository, recoloured to
currentColor so it follows the OpenClip theme. Appwrite is a trademark of Appwrite; this
extension is a community integration.