Loading...
Loading...
Interact with Instagram DMs - send messages, read conversations, manage accounts
npx skill4agent add devxoul/agent-messenger agent-instagramagent-instagram ...bunx --package agent-messenger agent-instagram ...chat listauth listauth use# Extract cookies from browser (recommended — zero-config)
agent-instagram auth extract
# Or: Log in with Instagram credentials (fallback)
agent-instagram auth login --username myaccount --password "mypassword"
# List DM conversations
agent-instagram chat list
# Send a message
agent-instagram message send <thread-id> "Hello from agent-instagram"agent-instagram auth extract# Extract cookies from browser — zero-config
agent-instagram auth extract
# With debug output
agent-instagram auth extract --debug
# Scan custom Chromium profile/user-data dirs
agent-instagram auth extract --browser-profile ~/browser-data
agent-instagram auth extract --browser-profile "$HOME/work-profile,$HOME/personal-profile"--browser-profilesessionidcsrftokends_user_id~/.config/agent-messenger/agent-instagram auth extractagent-instagram auth listagent-instagram auth use <account-id>agent-instagram auth extract
# -> {"authenticated":true,"account_id":"12345678","username":"myaccount"}agent-instagram auth login --username myaccount --password "mypassword"
# -> {"authenticated":true,"account_id":"myaccount","username":"myaccount"}two_factor_required# -> {"two_factor_required":true,"two_factor_identifier":"abc123","message":"..."}agent-instagram auth verify --username myaccount --code 123456 --identifier abc123
# -> {"authenticated":true,"account_id":"myaccount","username":"myaccount"}agent-instagram auth extract # Extract cookies from browser (recommended)
agent-instagram auth extract --debug # Extract with debug output
agent-instagram auth status # Check current auth state
agent-instagram auth status --account <id> # Check specific account
agent-instagram auth list # List all stored accounts
agent-instagram auth use <id> # Switch active account
agent-instagram auth logout # Remove current account
agent-instagram auth logout --account <id> # Remove specific account~/.config/agent-messenger/MEMORY.mdReadWrite~/.config/agent-messenger/MEMORY.mdRead~/.config/agent-messenger/MEMORY.mdWritechat listWrite# Agent Messenger Memory
## Instagram Account
- Username: myaccount
- User ID: 12345678
## Conversations
- `340282366841710300949128138443434234567` - Alice (private)
- `340282366841710300949128138443434234568` - Bob (private)
- `340282366841710300949128138443434234569` - Project Team (group, 5 members)
## Aliases
- "alice" -> `340282366841710300949128138443434234567`
- "project" -> `340282366841710300949128138443434234569` (Project Team)
## Notes
- User prefers --pretty outputMemory lets you skip repeatedcalls. When you already know a thread ID from a previous session, use it directly.chat list
# Extract cookies from browser (recommended — zero-config)
agent-instagram auth extract
agent-instagram auth extract --debug
# Log in (interactive: prompts for username/password)
agent-instagram auth login
# Log in (non-interactive: pass credentials as flags)
agent-instagram auth login --username <username> --password <password>
# Log in with debug output (shows raw API responses)
agent-instagram auth login --username <username> --password <password> --debug
# Complete 2FA verification (non-interactive)
agent-instagram auth verify --username <username> --code <code> --identifier <identifier>
# Resolve a security challenge — send verification code
agent-instagram auth challenge --username <username> --method email
agent-instagram auth challenge --username <username> --method sms
# Resolve a security challenge — submit verification code
agent-instagram auth challenge --username <username> --code <code>
# Check auth status
agent-instagram auth status
agent-instagram auth status --account <id>
# List stored accounts
agent-instagram auth list
# Switch active account
agent-instagram auth use <id>
# Remove account
agent-instagram auth logout
agent-instagram auth logout --account <id># Show current authenticated user
agent-instagram whoami
agent-instagram whoami --pretty
agent-instagram whoami --account <account-id># List DM conversations (sorted by most recent activity)
agent-instagram chat list
agent-instagram chat list --limit 50
agent-instagram chat list --account <id>
# Search conversations by name
agent-instagram chat search "alice"
agent-instagram chat search "alice" --limit 10
agent-instagram chat search "alice" --account <id>idnametypeprivategroupis_groupparticipant_countunread_countlast_message# List messages in a conversation
agent-instagram message list <thread-id>
agent-instagram message list <thread-id> --limit 50
agent-instagram message list <thread-id> --limit 10 --account <id>
# Send a text message to a thread
agent-instagram message send <thread-id> <text>
agent-instagram message send <thread-id> "Hello!" --account <id>
# Send a text message to a user by @username
agent-instagram message send-to <username> <text>
agent-instagram message send-to @alice "Hello!"
# Search messages by text content
agent-instagram message search <query>
agent-instagram message search "meeting" --thread <thread-id>
agent-instagram message search "hello" --limit 10
# Search Instagram users by username
agent-instagram message search-users <query>
agent-instagram message search-users "alice"{
"id": "340282366841710300949128138443434234567",
"name": "Alice",
"type": "private",
"is_group": false,
"participant_count": 2,
"unread_count": 3,
"last_message": {
"id": "29876543210987654",
"thread_id": "340282366841710300949128138443434234567",
"from": "12345678",
"timestamp": "2026-03-29T10:30:00.000Z",
"is_outgoing": false,
"type": "text",
"text": "See you tomorrow!"
}
}--prettyagent-instagram chat list --pretty| Option | Description |
|---|---|
| Human-readable output instead of JSON |
| Use a specific account for this command |
# List conversations to see unread counts
agent-instagram chat list --limit 20
# Read messages from a specific conversation
agent-instagram message list <thread-id> --limit 10# Find the contact first
agent-instagram chat search "Alice"
# Send to the thread ID
agent-instagram message send <thread-id> "Hey, are we still on for tomorrow?"# Find the group
agent-instagram chat search "Project Team"
# Send to the group thread
agent-instagram message send <thread-id> "Status update: deployment complete."{
"error": "Not authenticated. Run \"agent-instagram auth login --username <username>\" first."
}Not authenticatedauth extractauth loginSession expired or missingauth extractauth loginLogin failedTwo-factor authentication failedauth verifyRate limited~/.config/agent-messenger/instagram/auth listauth use <id>agent-instagram--prettyagent-instagram: command not foundagent-instagramagent-messengeragent-instagramagent-instagram chat list --pretty--packagenpx -y --package agent-messenger agent-instagram chat list --pretty
bunx --package agent-messenger agent-instagram chat list --pretty
pnpm dlx --package agent-messenger agent-instagram chat list --prettynpx agent-instagrambunx agent-instagrampnpm dlx agent-instagram--package agent-messengeragent-instagram