a minimal [matrix] message watcher and link extractor
You can configure bot commands in bot.json. Commands are fully composable and support three types:
exec: Runs arbitrary executables with arguments. Supports{input}and{output}placeholders for file processing (e.g., image manipulation).http: Makes HTTP requests and returns responses (text or images).ai: Uses Groq AI with custom prompts for intelligent responses.
{
"deepfry": {
"type": "exec",
"command": "magick",
"args": ["{input}", "-modulate", "200,200", "-sharpen", "0x3", "{output}"],
"input_type": "image",
"output_type": "image"
},
"quack": {
"type": "http",
"url": "https://random-d.uk/api/v2/random",
"method": "GET",
"headers": {"User-Agent": "ash-bot"},
"output_type": "image"
},
"summary": {
"type": "ai",
"prompt": "Summarize these articles concisely:",
"model": "llama3-8b-8192",
"max_tokens": 500
}
}/bot deepfry— Deepfries attached images using ImageMagick/bot quack— Returns a random duck image/bot meow— Returns a random cat image/bot summary— Fetches recent articles from linkstash and summarizes them using Groq AI/bot gork <message>— Responds to queries using Groq AI (alias:@gork <message>)
Add or change commands in bot.json and set BOT_CONFIG_PATH in config.json if you place it elsewhere. The bot will prefix responses using BOT_REPLY_LABEL in config.json (defaults to [BOT]\n).
Bot commands are enabled per room via the allowedCommands array in config.json:
"allowedCommands": []— Enable bot with all commands allowed"allowedCommands": ["summary", "joke"]— Enable bot with only specific commands- Omit
allowedCommands— Bot disabled in that room
The hi command is always allowed in all rooms.
This allows fine-grained control over which commands are available in each room.
pairs nicely with lava
lava is a web clipping tool that can run as a server or daemon to automatically populate your Obsidian clippings directory with fresh parsed md from URLs.
- Install Go 1.25+ and SQLite.
- Clone the repo.
- Copy
config.jsonand edit with your Matrix credentials. - Run
maketo build and run.
ash.go: Main application logicbot.go: Bot command handlingdb/: Database schema filesdata/: Runtime data (SQLite, exports)config.json: Configuration filebot.json: Bot commands configuration
Edit config.json:
MATRIX_HOMESERVER: Your Matrix server URLMATRIX_USER: Your Matrix user IDMATRIX_PASSWORD: PasswordMATRIX_RECOVERY_KEY: For E2EE verificationMATRIX_ROOM_ID: Array of rooms to watch, each with:id: Room IDcomment: Human-readable namehook: Optional webhook URL for link processingkey: Webhook auth keysendUser/sendTopic: Whether to include user/topic in webhooksallowedCommands: Array of allowed bot commands (empty = all, omit = disabled)
BOT_REPLY_LABEL: Bot response prefix (default:[BOT]\n)LINKSTASH_URL: Base URL for linkstash service (used in summary bot)GROQ_API_KEY: API key for Groq AI (required for summary and gork commands)MATRIX_DEVICE_NAME: Device nameDEBUG: Enable debug logging
make: Build and runmake build: Build onlymake test: Run tests (validates bot.json configuration)make clean: Clean build artifacts
Links are exported to data/links.json.