Cross‑Platform Plugin Development for Productivity Tools: Core Module Design and Platform Adaptation
The article examines how to boost personal efficiency by developing cross‑platform plugins for macOS productivity tools such as Alfred, Raycast, and uTools, describing their architectures, a shared core module, the use of the lightweight txiki.js runtime, and practical implementation details.
This article introduces the concept of using plugin systems in productivity tools to replace repetitive manual workflows with custom applications, thereby increasing personal efficiency.
It reviews three popular macOS platforms—Alfred, Raycast, and uTools—highlighting their features, plugin mechanisms, and limitations. Alfred offers built‑in utilities and a workflow system but is macOS‑only. Raycast, also macOS‑only, uses a VSCode‑like scaffold and builds plugins with React, Node.js, and TypeScript, making it friendly for front‑end developers. uTools, built on Electron, runs on all major operating systems and provides a “super panel” for quick context‑aware actions.
The author then presents their own tool, Cheetah, a plugin that searches local Git projects and opens them in the chosen application. The plugin’s workflow includes scanning workspace directories for .git folders, caching results, matching keywords, presenting a GUI list, and opening the selected project while tracking usage counts.
To avoid duplicating logic across platforms, a shared core module is extracted, handling file system operations and caching while each platform‑specific plugin implements only the input/output and UI layers.
Because Alfred lacks a built‑in script runtime, the article discusses using txiki.js , a lightweight JavaScript runtime based on Quick.js and libuv, which can be bundled with Alfred workflows. This eliminates the need for users to install Node.js.
To bridge differences between txiki.js and Node.js, the code checks for the presence of the global tjs object: const isTxiki = !!global.tjs . Conditional wrappers then provide a unified API for file reading, directory listing, and writing, abstracting away runtime‑specific details.
Finally, the article concludes that many other tools (e.g., rubick, quicker, wox) can adopt the same approach, provided they support a Node.js‑compatible environment or can embed txiki.js . Expanding platform coverage increases user adoption and potential monetization.
Rare Earth Juejin Tech Community
Juejin, a tech community that helps developers grow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.