Vault access: Autoload scripts run after the vault is unlocked, so
flume.vault.get() works at module load time. You can safely read secrets at the top level of your script.Script errors: Load failures and runtime errors are displayed as system messages in the flume buffer with full tracebacks — no need to check log files.
Script Structure
Every script follows the same pattern:- Import the
flumemodule (Python only — Lua has it globally) - Register event handlers and/or custom commands
- Flume calls your handlers when events occur
Custom Commands with Help
The third argument toflume.command.register is the help text shown when users type /help <command>:
Lua:
/help weather shows: /weather — Check weather for a city. Usage: /weather <city>
Printing to Buffers
flume.buffer.print(server, buffer, text) prints a message to a specific buffer.
Use empty strings "" for the active server/buffer:
Switching Buffers
Sending Messages
Persistent Script Config
Scripts can store and retrieve configuration values that persist across sessions usingflume.config.get/set. Each script gets its own config file at ~/.local/share/flume/scripts/data/<scriptname>/config.toml.
Lua:
Reading Vault Secrets
Scripts can read secrets stored in the encrypted vault viaflume.vault.get(name). This is useful for scripts that need API keys, passwords, or tokens without hardcoding them.
Store secrets first:
nil (Lua) or None (Python) if the secret doesn’t exist.
Sending Desktop Notifications
Sending Raw IRC Commands
For anything not covered by the API, send raw IRC protocol lines:Event Cancellation
Scripts can cancel events to prevent them from being displayed: Lua:Practical Examples
Auto-Reply When Away
Channel Logger
Nick Highlighter with Sound
Python: URL Title Fetcher (with pip packages)
Python scripts have full import access — use any pip package:Managing Autoload
Debugging Tips
- Use
flume.buffer.print("", "", "debug: " .. variable)to print debug info - Check
/script listto verify your script loaded - Check the Flume log at
~/.local/share/flume/logs/flume.logfor errors - Reload after changes:
/script reload myscript - Python import errors show as load failures — check that deps are installed