A command-line tool for reading and sending iMessages on macOS.
- List conversations - View recent iMessage conversations
- Read messages - Read messages from any conversation
- Send messages - Send iMessages from the command line
- Interactive chat - Real-time chat mode with a contact
- Search - Search through your message history
- TUI - Full terminal user interface with live updates
- macOS (uses the Messages app and iMessage database)
- Go 1.21 or later
- Full Disk Access permission for Terminal/your terminal emulator
cd go
go mod download
go build -o imessage ./cmd/imessage# Build and install to your GOPATH/bin
go install ./cmd/imessage
# Or build locally
go build -o imessage ./cmd/imessageimessage list
imessage ls
imessage l# By conversation number from list
imessage read 1
# By phone number
imessage read "+1234567890"
# Specify number of messages
imessage read 1 -n 50imessage send "+1234567890" "Hello from the command line!"
# Skip confirmation
imessage send "+1234567890" "Hi" -yimessage chat 1
imessage chat "+1234567890"imessage search "meeting"
imessage search "project" -n 50imessage tui
imessage ui
imessage watchimessage status| Key | Action |
|---|---|
↑/↓ or j/k |
Navigate/scroll |
Enter |
Select conversation |
Tab |
Switch between panels |
h/← |
Go back to conversations |
l/→ |
Go to messages |
i |
Start typing a message |
r |
Refresh |
g |
Go to top (messages) |
G |
Go to bottom (messages) |
q |
Quit |
This tool requires access to:
- iMessage Database (
~/Library/Messages/chat.db) - Grant Full Disk Access to your terminal - Contacts Database (
~/Library/Application Support/AddressBook/) - For resolving contact names - Messages App - Via AppleScript for sending messages
To grant Full Disk Access:
- Open System Preferences → Security & Privacy → Privacy
- Select "Full Disk Access"
- Add your terminal application (Terminal.app, iTerm2, etc.)
go/
├── cmd/
│ └── imessage/
│ └── main.go # Entry point
├── internal/
│ ├── cli/
│ │ └── cli.go # CLI commands
│ ├── database/
│ │ ├── database.go # iMessage database operations
│ │ └── contacts.go # Contact resolution
│ ├── sender/
│ │ └── sender.go # AppleScript message sending
│ ├── tui/
│ │ └── tui.go # Terminal user interface
│ └── watcher/
│ └── watcher.go # Real-time message watching
├── go.mod
├── go.sum
└── README.md
- spf13/cobra - CLI framework
- mattn/go-sqlite3 - SQLite driver
- rivo/tview - TUI framework
- gdamore/tcell - Terminal handling
This Go version is a complete rewrite with:
- Single binary distribution (no Python dependency)
- Faster startup time
- Native concurrency with goroutines
- Uses tview instead of curses for the TUI
Same license as the parent project.