An Osaurus plugin that enables executing Emacs Lisp code in a running Emacs instance via emacsclient.
Based on emacs-mcp-server.
- Emacs with server mode enabled (
M-x server-startor add(server-start)to your init file) emacsclientavailable (auto-detected or specify path)
Execute Emacs Lisp code in a running Emacs instance.
Parameters:
code(required): The Emacs Lisp code to executeemacsclient_path(optional): Path to emacsclient binary. Auto-detected if not provided.
Example:
{
"code": "(buffer-name)",
"emacsclient_path": "/opt/homebrew/bin/emacsclient"
}-
Build:
swift build -c release cp .build/release/libEmacs.dylib ./libEmacs.dylib
-
Sign the dylib (required for distributed plugins):
codesign -s "Developer ID Application: Your Name (TEAMID)" ./libEmacs.dylibNote: For local development/testing, you can skip signing. It's only required when distributing the plugin.
-
Install:
osaurus tools install .
This repository includes a portable GitHub Actions workflow that automatically builds, signs, and releases your plugin.
The workflow at .github/workflows/release.yml is designed to be easily reusable. To use it for your own Osaurus plugin:
- Copy the workflow file to your repository
- Update the configuration section at the top:
env:
PLUGIN_ID: your.plugin.id
PLUGIN_NAME: Your Plugin # Display name
PLUGIN_DESCRIPTION: What it does
DYLIB_NAME: YourLibrary # Without lib prefix and .dylib extension
LICENSE: MIT
MIN_MACOS: "13.0"
MIN_OSAURUS: "0.5.0"
TOOLS: '[{"name": "tool_name", "description": "Tool description"}]'brew install minisign
minisign -G -p minisign.pub -s minisign.keyThis creates:
minisign.pub- Public key (share this)minisign.key- Private key (keep secret!)
To code sign the dylib for distribution, you need a Developer ID Application certificate:
- Open Keychain Access on your Mac
- Find your "Developer ID Application" certificate
- Right-click → Export → Save as
.p12with a password - Base64 encode it:
base64 -i certificate.p12 | pbcopy
Go to Settings → Secrets and variables → Actions → Secrets and add:
| Secret | Value |
|---|---|
MINISIGN_SECRET_KEY |
Contents of minisign.key (the entire private key file) |
MINISIGN_PUBLIC_KEY |
Public key string (second line of .pub file, starts with RW...) |
MINISIGN_PASSWORD |
Password you set when generating the key (leave empty if none) |
DEVELOPER_ID_CERTIFICATE_P12_BASE64 |
Base64-encoded .p12 certificate (from step 2) |
DEVELOPER_ID_CERTIFICATE_PASSWORD |
Password you set when exporting the certificate |
Tag and push a version:
git tag 1.0.0
git push origin 1.0.0The workflow will automatically:
- ✅ Build the plugin for macOS arm64
- ✅ Code sign the dylib (if certificate secrets are configured)
- ✅ Sign artifact with minisign
- ✅ Create a GitHub Release with artifacts
- ✅ Generate the registry entry JSON in
release/folder
After the workflow completes, you'll find the registry entry at release/<plugin-id>.json. To submit:
- Fork dinoki-ai/osaurus-tools
- Copy
release/<plugin-id>.jsontoplugins/<plugin-id>.jsonin your fork - If updating an existing plugin, merge the new version into the
versionsarray - Create a PR to the upstream repository
If you prefer to publish manually:
swift build -c release
# Sign the dylib (REQUIRED for distributed plugins)
codesign --force --options runtime --timestamp \
--sign "Developer ID Application: Your Name (TEAMID)" \
.build/release/libEmacs.dylib
mkdir dist && cp .build/release/libEmacs.dylib dist/
cd dist && zip -r ../osaurus.emacs-1.0.0.zip .
minisign -Slm osaurus.emacs-1.0.0.zip -s minisign.keyThen upload to GitHub Releases and submit a PR to the registry.