1.8 KiB
Mattermost Sync
This directory contains the workspace-local Mattermost extractor used by OpenCode to refresh communication context.
Files
mattermost_context.pyExtracts recent Mattermost messages as JSONL.sync.shStable wrapper intended to be called by OpenCode..env.exampleExample configuration without secrets.requirements.txtReserved for future optional dependencies.
Recommended Setup
- Copy
.env.exampleto.env. - Fill in your Mattermost values.
- Create a local virtual environment if you want an isolated runtime.
Preferred channel config:
CHANNELS=fidelity-preguntas
Channel names are preferred for AI context because the exported records will use the readable channel name instead of the raw channel ID.
The script can resolve channel names without a team if the authenticated user can access the channel and the name is unique across the user's teams.
Supported env options:
CHANNELSMixed list of channel names or channel IDs.CHANNEL_NAMESChannel names only.CHANNEL_IDSLegacy channel IDs only.
Optional only for disambiguation:
MATTERMOST_TEAM_NAMEMATTERMOST_TEAM_ID
Use one of those only if the same channel name exists in multiple teams or if you want to force team-specific resolution.
Example:
cd scripts/mattermost
bash bootstrap.sh
Usage
Manual run:
bash scripts/mattermost/sync.sh
OpenCode can use this script directly. If FIDELITY_MATTERMOST_SYNC_CMD is not set, the workspace plugins will fall back to this wrapper automatically.
Bootstrap
You can initialize the local runtime with:
bash scripts/mattermost/bootstrap.sh
This will:
- create
.venv/if missing - create
.envfrom.env.exampleif needed
The current extractor uses only the Python standard library, so no third-party install is required.