Plugin Development

motd is API-first. Every feature is an API endpoint. That means you can build anything on top of it — custom clients, bots, bridges, tools.

Plugins run on your machine, not on the server. There's no plugin registry, no sandboxing, no approval process. You call the API. That's it.

Authentication

# Get a token
TOKEN=$(curl -s -X POST http://localhost:3006/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"alice","password":"hunter2pwd"}' | jq -r '.data.token')

echo $TOKEN

Tokens expire after 7 days. Re-authenticate when needed.

Example: Fetch Your Feed

#!/bin/bash
TOKEN="your-token-here"

curl -s http://localhost:3006/api/posts/feed \
  -H "Authorization: Bearer $TOKEN" | jq '.data.posts[] | {user: .username, text: .content, id: .id}'

Output:

{ "user": "alice", "text": "just shipped the wasm compiler [rust] [wasm]", "id": "a3kf9x" }
{ "user": "bob", "text": "working on a new side project [coding]", "id": "c9xk4m" }

Example: Post From the Command Line

#!/bin/bash
TOKEN="your-token-here"

curl -s -X POST http://localhost:3006/api/posts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"content\":\"$1\"}" | jq '.data.id'

Usage:

./motd-post.sh "automated post from my build pipeline [ci]"

Example: Upload and Post an Image

#!/bin/bash
TOKEN="your-token-here"
IMAGE="$1"
CAPTION="$2"

# Upload the image
MEDIA_ID=$(curl -s -X POST http://localhost:3006/api/media/upload \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@$IMAGE" | jq -r '.data.media_id')

# Post with attachment
curl -s -X POST http://localhost:3006/api/posts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"content\":\"$CAPTION /attach $MEDIA_ID\"}" | jq '.'

Usage:

./motd-upload.sh screenshot.png "new feature landed [showcase]"

Example: GitHub Bridge (Concept)

Sync your GitHub activity to motd. Watch for push events, post summaries.

#!/bin/bash
TOKEN="your-token-here"

# Poll GitHub events (simplified)
LATEST=$(curl -s https://api.github.com/users/alice/events?per_page=1 | jq -r '.[0]')
TYPE=$(echo $LATEST | jq -r '.type')
REPO=$(echo $LATEST | jq -r '.repo.name')

if [ "$TYPE" = "PushEvent" ]; then
  curl -s -X POST http://localhost:3006/api/posts \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"content\":\"pushed to $REPO [coding] [github]\"}"
fi

Example: Bookmark Monitor

Watch your bookmarked tags for new posts.

#!/bin/bash
TOKEN="your-token-here"

# Get bookmarked tags
TAGS=$(curl -s "http://localhost:3006/api/bookmarks?type=tag" \
  -H "Authorization: Bearer $TOKEN" | jq -r '.data.bookmarks[].id')

for TAG in $TAGS; do
  echo "--- [$TAG] ---"
  curl -s "http://localhost:3006/api/posts/search?q=$TAG" \
    -H "Authorization: Bearer $TOKEN" | jq '.data.posts[:3][] | "\(.username): \(.content)"'
done

Media Converters

motd accepts PNG, MP3, and MP4 only. Build converter plugins for other formats:

# JPG to PNG before upload
convert photo.jpg photo.png && ./motd-upload.sh photo.png "converted from jpg"

# WAV to MP3 before upload
ffmpeg -i recording.wav -q:a 2 recording.mp3

Ideas

Building something? Post about it with the [ideas] tag. Found a bug? Use [bugs]. The community is on motd itself.

See /read api for the complete endpoint reference.

← Open motd.social terminal