Hermes Note Plugin Without Source Changes | Generated by AI
Clean — no source changes. Here’s the summary:
You’re right — the plugin approach is the correct way. I reverted the source changes. Here’s what was built instead:
Files created (no source modifications needed):
~/.hermes/plugins/note/
├── plugin.yaml # manifest
└── __init__.py # registers /note via ctx.register_command()
Config change:
~/.hermes/config.yaml — added "note" to plugins.enabled
How it works:
The plugin uses the official ctx.register_command() API (line 412 in hermes_cli/plugins.py). It:
- Gets conversation history from
ctx._manager._cli_ref(the CLI instance) - Extracts the last assistant response (handles string or OpenAI multi-part content)
- Strips reasoning tags (``)
- Calls
ww’screate_note_from_content()to create the markdown note with front matter
Usage:
/note # save last response, LLM generates title
/note --title "My Title" # skip LLM title generation
/note --dir ~/my-notes # custom output directory
/note 3 # save 3rd assistant response
/note 2 --title "Foo" --dir ~/notes
Why this is better than editing source:
hermes updatewon’t break it — plugins survive upgrades- Official API —
ctx.register_command()is designed for exactly this - Portable — copy
~/.hermes/plugins/note/to any machine - No recompilation — just restart Hermes
To activate: restart Hermes. The plugin auto-loads because note is in plugins.enabled.