Add /compact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in /compact slash command. Main-group or trusted sender only.
中文简介正在准备中。当前显示原文说明。
Add Emacs as a channel. Opens an interactive chat buffer and org-mode integration so you can talk to NanoClaw from within Emacs (Doom, Spacemacs, or vanilla). Uses a local HTTP bridge — no bot token or external service needed.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
This skill adds Emacs support to NanoClaw, then walks through interactive setup. Works with Doom Emacs, Spacemacs, and vanilla Emacs 27.1+.
C-c n c / SPC N c), ask about a function or error without leaving Emacsnanoclaw-org-send; the response appears as a child heading inline in your org fileCheck if src/channels/emacs.ts exists:
test -f src/channels/emacs.ts && echo "already applied" || echo "not applied"
If it exists, skip to Phase 3 (Setup). The code changes are already in place.
git remote -v
If an upstream remote pointing to https://github.com/qwibitai/nanoclaw.git is missing,
add it:
git remote add upstream https://github.com/qwibitai/nanoclaw.git
git fetch upstream skill/emacs
git merge upstream/skill/emacs
If there are merge conflicts on package-lock.json, resolve them by accepting the incoming
version and continuing:
git checkout --theirs package-lock.json
git add package-lock.json
git merge --continue
For any other conflict, read the conflicted file and reconcile both sides manually.
This adds:
src/channels/emacs.ts — EmacsBridgeChannel HTTP server (port 8766)src/channels/emacs.test.ts — unit testsemacs/nanoclaw.el — Emacs Lisp package (nanoclaw-chat, nanoclaw-org-send)import './emacs.js' appended to src/channels/index.tsIf the merge reports conflicts, resolve them by reading the conflicted files and understanding the intent of both sides.
npm run build
npx vitest run src/channels/emacs.test.ts
Build must be clean and tests must pass before proceeding.
The channel works out of the box with defaults. Add to .env only if you need non-defaults:
EMACS_CHANNEL_PORT=8766 # default — change if 8766 is already in use
EMACS_AUTH_TOKEN=<random> # optional — locks the endpoint to Emacs only
If you change or add values, sync to the container environment:
mkdir -p data/env && cp .env data/env/env
The nanoclaw.el package requires only Emacs 27.1+ built-in libraries (url, json, org) — no package manager setup needed.
AskUserQuestion: Which Emacs distribution are you using?
Doom Emacs — add to ~/.config/doom/config.el (or ~/.doom.d/config.el):
;; NanoClaw — personal AI assistant channel
(load (expand-file-name "~/src/nanoclaw/emacs/nanoclaw.el"))
(map! :leader
:prefix ("N" . "NanoClaw")
:desc "Chat buffer" "c" #'nanoclaw-chat
:desc "Send org" "o" #'nanoclaw-org-send)
Then reload: M-x doom/reload
Spacemacs — add to dotspacemacs/user-config in ~/.spacemacs:
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(spacemacs/set-leader-keys "aNc" #'nanoclaw-chat)
(spacemacs/set-leader-keys "aNo" #'nanoclaw-org-send)
Then reload: M-x dotspacemacs/sync-configuration-layers or restart Emacs.
Vanilla Emacs — add to ~/.emacs.d/init.el (or ~/.emacs):
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(global-set-key (kbd "C-c n c") #'nanoclaw-chat)
(global-set-key (kbd "C-c n o") #'nanoclaw-org-send)
Then reload: M-x eval-buffer or restart Emacs.
If EMACS_AUTH_TOKEN was set, also add (any distribution):
(setq nanoclaw-auth-token "<your-token>")
If EMACS_CHANNEL_PORT was changed from the default, also add:
(setq nanoclaw-port <your-port>)
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# Linux: systemctl --user restart nanoclaw
curl -s "http://localhost:8766/api/messages?since=0"
Expected: {"messages":[]}
If you set EMACS_AUTH_TOKEN:
curl -s -H "Authorization: Bearer <token>" "http://localhost:8766/api/messages?since=0"
Tell the user:
- Open the chat buffer with your keybinding (
SPC N c,SPC a N c, orC-c n c)- Type a message and press
RET- A response from Andy should appear within a few seconds
For org-mode: open any
.orgfile, position the cursor on a heading, and useSPC N o/SPC a N o/C-c n o
tail -f logs/nanoclaw.log
Look for Emacs channel listening at startup and Emacs message received when a message is sent.
Error: listen EADDRINUSE: address already in use :::8766
Either a stale NanoClaw process is running, or 8766 is taken by another app.
Find and kill the stale process:
lsof -ti :8766 | xargs kill -9
Or change the port in .env (EMACS_CHANNEL_PORT=8767) and update nanoclaw-port in Emacs config.
Check:
launchctl list | grep nanoclaw (macOS) or systemctl --user status nanoclaw (Linux)sqlite3 store/messages.db "SELECT * FROM registered_groups WHERE jid = 'emacs:default'"tail -50 logs/nanoclaw.logIf the group is not registered, it will be created automatically on the next NanoClaw restart.
Verify the token in Emacs matches .env:
;; M-x describe-variable RET nanoclaw-auth-token RET
Must exactly match EMACS_AUTH_TOKEN in .env.
Check the path is correct:
ls ~/src/nanoclaw/emacs/nanoclaw.el
If NanoClaw is cloned elsewhere, update the load/load-file path in your Emacs config.
If running npm run dev while the service is active:
# macOS:
launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist
npm run dev
# When done testing:
launchctl load ~/Library/LaunchAgents/com.nanoclaw.plist
# Linux:
# systemctl --user stop nanoclaw
# npm run dev
# systemctl --user start nanoclaw
The Emacs bridge converts markdown → org-mode automatically. Agents should output standard markdown — not org-mode syntax. The conversion handles:
| Markdown | Org-mode |
|---|---|
**bold** | *bold* |
*italic* | /italic/ |
~~text~~ | +text+ |
`code` | ~code~ |
```lang | #+begin_src lang |
If an agent outputs org-mode directly, bold/italic/etc. will be double-converted and render incorrectly.
To remove the Emacs channel:
src/channels/emacs.ts, src/channels/emacs.test.ts, and emacs/nanoclaw.elimport './emacs.js' from src/channels/index.tssqlite3 store/messages.db "DELETE FROM registered_groups WHERE jid = 'emacs:default'"EMACS_CHANNEL_PORT and EMACS_AUTH_TOKEN from .env if setnpm run build && launchctl kickstart -k gui/$(id -u)/com.nanoclaw (macOS) or npm run build && systemctl --user restart nanoclaw (Linux)还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Add /compact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in /compact slash command. Main-group or trusted sender only.
中文简介正在准备中。当前显示原文说明。
Add Discord bot channel integration to NanoClaw.
中文简介正在准备中。当前显示原文说明。
Add Gmail integration to NanoClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.
中文简介正在准备中。当前显示原文说明。
Add image vision to NanoClaw agents. Resizes and processes WhatsApp image attachments, then sends them to Claude as multimodal content blocks.
中文简介正在准备中。当前显示原文说明。
Add a macOS menu bar status indicator for NanoClaw. Shows a bolt icon with a green/red dot indicating whether NanoClaw is running, with Start, Stop, and Restart controls. macOS only.
中文简介正在准备中。当前显示原文说明。
Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.
中文简介正在准备中。当前显示原文说明。