CLI tool to export chat messages from Sdui into Markdown or JSON files.
Requires Go 1.22+. If you use mise, the toolchain is managed automatically.
# with mise
mise run build
# or plain go
go build -o sdui-export .Search for schools by name to discover their slink identifier. No authentication required.
./sdui-export list-slinks <search-term>Example:
$ ./sdui-export list-slinks basdorf
NAME SLINK CITY
---------------------------------------- ------------------------------ --------------------
Grundschule Basdorf grundschule-basdorf Wandlitz
Kindertagesstätte Rappelkiste Basdorf kindertagesstatte-rappelkis... Wandlitz
Use the SLINK value with --slink when logging in via username/password.
Export all messages from a chat to a Markdown or JSON file.
./sdui-export export [flags]Two mutually exclusive methods:
| Method | Flags | Env vars |
|---|---|---|
| Bearer token | --token, -t |
SDUI_TOKEN |
| Login | --user, -u + --password, -p + --slink, -s |
SDUI_USER, SDUI_PASSWORD, SDUI_SLINK |
Token auth:
./sdui-export export --token <TOKEN> --chat-id 12345Login auth:
./sdui-export export \
--user myuser \
--password mypass \
--slink grundschule-basdorf \
--chat-id 12345Use list-slinks to find your school's slink if you don't know it.
Two mutually exclusive options:
| Flag | Description |
|---|---|
--chat-id |
Numeric chat ID (visible in Sdui URLs) |
--chat-name |
Search by name — case-insensitive substring match against channel name and display name. Fails with a list if multiple chats match. |
# by ID
./sdui-export export --token TOKEN --chat-id 12165178
# by name
./sdui-export export --token TOKEN --chat-name "Zielske"| Flag | Values | Default |
|---|---|---|
--format |
markdown, md, json |
markdown |
--output |
File path | chat-<id>.md or chat-<id>.json |
Markdown output includes:
- Title with chat ID
- Participant list
- Messages grouped by date, each with author, timestamp, and content (HTML stripped)
- File attachment links
JSON output structure:
{
"chat_id": "12165178",
"exported_at": "2026-06-24T15:30:00Z",
"total_messages": 71,
"participants": {
"995300": "B. Zielske",
"5599266": "Henriette Salzmann"
},
"messages": [
{
"uuid": "b21a38e7-...",
"timestamp": "2026-05-19T16:27:00+02:00",
"author": "B. Zielske",
"author_id": 995300,
"content": "...",
"type": "MESSAGE"
}
]
}Both flags are optional and independent.
| Flag | Description |
|---|---|
--start |
Only include messages at or after this time |
--end |
Only include messages at or before this time |
Accepted formats:
2026-01-15
2026-01-15 09:00
2026-01-15 09:00:00
2026-01-15T09:00
2026-01-15T09:00:00+02:00
# messages from June onward
./sdui-export export --token TOKEN --chat-id 123 --start 2026-06-01
# messages in May only
./sdui-export export --token TOKEN --chat-id 123 \
--start 2026-05-01 --end "2026-05-31 23:59:59"# 1. Find your school
./sdui-export list-slinks basdorf
# 2. Export a chat by name, as JSON, filtered to June
./sdui-export export \
--user myuser \
--password mypass \
--slink grundschule-basdorf \
--chat-name "Zielske" \
--format json \
--start 2026-06-01 \
--end 2026-06-30 \
--output conversation.jsonAll auth flags can be set via environment variables to avoid passing secrets on the command line:
export SDUI_TOKEN="eyJ..."
# or
export SDUI_USER="myuser"
export SDUI_PASSWORD="mypass"
export SDUI_SLINK="grundschule-basdorf"
./sdui-export export --chat-name "Zielske"# run tests
mise run test
# or
go test -v -count=1 ./...
# clean build artifacts
mise run clean