Cord - Discord Bridge Skill
Interact with Discord through Cord's CLI commands. This skill teaches Claude Code how to send messages, embeds, files, and interactive buttons.
GitHub: https://github.com/alexknowshtml/cord
Setup
Ensure Cord is running:
bash1cord start
Verify it's connected:
bash1curl -s http://localhost:2643/health 2# {"status":"ok","connected":true,"user":"MyBot#1234"}
CLI Commands
send
Send a text message to a channel or thread.
bash1cord send <channel> "message"
Example:
bash1cord send 123456789 "Hello world!"
embed
Send a formatted embed card with optional styling.
bash1cord embed <channel> "description" [options]
Options:
| Flag | Description |
|---|---|
--title "..." | Embed title |
--url "..." | Title link URL |
--color <name|hex> | red, green, blue, yellow, purple, orange, or 0xHEX |
--author "..." | Author name |
--author-url "..." | Author link |
--author-icon "..." | Author icon URL |
--thumbnail "..." | Small image (top right) |
--image "..." | Large image (bottom) |
--footer "..." | Footer text |
--footer-icon "..." | Footer icon URL |
--timestamp | Add current timestamp |
--field "Name:Value" | Add field (append :inline for inline) |
Examples:
Simple embed:
bash1cord embed 123456789 "Daily status update" --title "Status Report" --color green
Embed with fields:
bash1cord embed 123456789 "Build completed successfully" \ 2 --title "CI/CD Pipeline" \ 3 --color green \ 4 --field "Branch:main:inline" \ 5 --field "Duration:2m 34s:inline" \ 6 --field "Tests:142 passed" \ 7 --footer "Deployed by Cord" \ 8 --timestamp
file
Send a file attachment.
bash1cord file <channel> <filepath> ["message"]
Examples:
bash1cord file 123456789 ./report.md "Here's the weekly report" 2cord file 123456789 ./logs.txt
buttons
Send interactive buttons with optional handlers.
bash1cord buttons <channel> "prompt" --button label="..." id="..." [options]
Button options:
| Option | Description |
|---|---|
label="..." | Button text (required) |
id="..." | Custom ID for tracking (required) |
style="..." | primary, secondary, success, danger |
reply="..." | Ephemeral reply when clicked |
webhook="..." | URL to POST click data to |
Examples:
Simple confirmation:
bash1cord buttons 123456789 "Deploy to production?" \ 2 --button label="Deploy" id="deploy-prod" style="success" \ 3 --button label="Cancel" id="cancel-deploy" style="secondary"
With inline responses:
bash1cord buttons 123456789 "Approve this PR?" \ 2 --button label="Approve" id="approve" style="success" reply="Approved! Merging now." \ 3 --button label="Reject" id="reject" style="danger" reply="Rejected. Please revise."
With webhook callback:
bash1cord buttons 123456789 "Start backup?" \ 2 --button label="Start Backup" id="backup-start" style="primary" webhook="http://localhost:8080/backup"
typing
Show typing indicator (useful before slow operations).
bash1cord typing <channel>
edit
Edit an existing message.
bash1cord edit <channel> <messageId> "new content"
delete
Delete a message.
bash1cord delete <channel> <messageId>
rename
Rename a thread.
bash1cord rename <threadId> "new name"
reply
Reply to a specific message (shows reply preview).
bash1cord reply <channel> <messageId> "message"
thread
Create a thread from a message.
bash1cord thread <channel> <messageId> "thread name"
react
Add a reaction to a message.
bash1cord react <channel> <messageId> "emoji"
Example:
bash1cord react 123456789 987654321 "👍"
state
Update a message with a status indicator. Use this to show work progress on a thread starter or status message.
bash1cord state <channel> <messageId> <state>
Preset states:
| State | Display |
|---|---|
processing | 🤖 Processing... |
thinking | 🧠 Thinking... |
searching | 🔍 Searching... |
writing | ✍️ Writing... |
done | ✅ Done |
error | ❌ Something went wrong |
waiting | ⏳ Waiting for input... |
Examples:
Using presets:
bash1cord state 123456789 987654321 processing 2cord state 123456789 987654321 done
Custom status:
bash1cord state 123456789 987654321 "🔄 Syncing database..."
Choosing the Right Command
| Use Case | Command |
|---|---|
| Simple notification | cord send |
| Formatted status update | cord embed |
| Long content (logs, reports) | cord file |
| User needs to make a choice | cord buttons |
| Indicate processing (typing bubble) | cord typing |
| Update thread/message status | cord state |
| Update previous message | cord edit |
| Start a focused discussion | cord thread |
| Quick acknowledgment | cord react |
Assembly Patterns
Notification with follow-up options
bash1# Send the notification 2cord embed 123456789 "Build failed on main branch" \ 3 --title "CI Alert" \ 4 --color red \ 5 --field "Error:Test suite timeout" \ 6 --field "Commit:abc1234:inline" 7 8# Offer actions 9cord buttons 123456789 "What would you like to do?" \ 10 --button label="View Logs" id="view-logs" style="primary" reply="Fetching logs..." \ 11 --button label="Retry Build" id="retry" style="success" webhook="http://ci/retry" \ 12 --button label="Ignore" id="ignore" style="secondary" reply="Acknowledged"
Progress updates
bash1# Start with typing indicator 2cord typing 123456789 3 4# Send initial status message 5MSGID=$(cord send 123456789 "🤖 Processing..." | grep -o '[0-9]*$') 6 7# Update state as work progresses 8cord state 123456789 $MSGID searching 9cord state 123456789 $MSGID writing 10cord state 123456789 $MSGID done
Or with custom progress:
bash1cord state 123456789 $MSGID "🔄 Step 1/3: Fetching data..." 2cord state 123456789 $MSGID "🔄 Step 2/3: Processing..." 3cord state 123456789 $MSGID "🔄 Step 3/3: Generating report..." 4cord state 123456789 $MSGID done
Report delivery
bash1# Send summary embed 2cord embed 123456789 "Weekly metrics compiled" \ 3 --title "Weekly Report Ready" \ 4 --color blue \ 5 --field "Period:Jan 15-21:inline" \ 6 --field "Pages:12:inline" 7 8# Attach the full report 9cord file 123456789 ./weekly-report.pdf "Full report attached"
Confirmation flow
bash1# Ask for confirmation 2cord buttons 123456789 "Delete all archived items older than 30 days?" \ 3 --button label="Yes, Delete" id="confirm-delete" style="danger" reply="Deleting..." \ 4 --button label="Cancel" id="cancel-delete" style="secondary" reply="Cancelled"
Auto-Complete Behavior
When a user adds a ✅ reaction to the last message in a thread, Cord automatically:
- Detects the reaction
- Updates the thread starter message to "✅ Done"
This provides a quick way for users to signal "conversation complete" without explicit commands.
HTTP API
For advanced use cases (webhooks, external scripts), see HTTP-API.md.