Automated Groove helpdesk inbox triage. Fetches unread tickets, classifies them using Claude (spam / archive / star), and updates their state.
gem install dotenvCreate .env:
GROOVE_API_TOKEN=your-groove-api-token
GROOVE_API_URL=https://api.groovehq.com/v1
GROOVE_MAILBOX_ID=your-mailbox-id # optional, has a default
ANTHROPIC_API_KEY=sk-ant-...
ruby main.rbProcesses unread tickets one at a time in a loop:
- Fetches the next unread ticket
- Sends subject/snippet to Claude for classification
- If Claude needs the full message body, fetches it and re-evaluates
- Updates ticket state:
spam→ spam,archive→ closed,star→ opened - Repeats until inbox is empty