| name | instagram |
| description | Control Instagram via instagram-cli — browse feed, send/read DMs, view and post stories, upload content, manage multiple accounts. Use when the user mentions Instagram, asks to check/post DMs, view stories, upload a photo/reel, or manage Instagram accounts. |
| metadata | {"openclaw":{"emoji":"📸","os":["darwin","linux"],"requires":{"bins":["instagram-cli"]}}} |
Instagram Skill (OpenClaw)
Full Instagram control via instagram-cli — DMs, feed, stories, posts, multi-account support.
Installation
brew tap supreme-gg-gg/tap
brew install instagram-cli
Or via npm:
npm install -g @i7m/instagram-cli
Authentication
Login (first time)
instagram-cli auth login --username <username>
Multi-Account Setup
instagram-cli auth login --username account1
instagram-cli auth login --username account2
instagram-cli auth whoami
instagram-cli auth switch <username>
instagram-cli auth list
Sessions are saved locally at ~/.instagram-cli/
Core Commands
Feed
instagram-cli feed
instagram-cli feed <username>
Stories
instagram-cli stories
Notifications
instagram-cli notify
Chat/DMs (TUI)
instagram-cli chat
instagram-cli chat -u <username>
instagram-cli chat -t "Work DMs"
Chat Commands (inside TUI)
:select # Select message for actions
:react <emoji> # React to selected message
:reply <text> # Reply to selected message
:unsend # Unsend selected message
:upload <path> # Upload image/video
:download <path> # Download selected media
:k / :j # Navigate up/down
:K / :J # Jump to top/bottom
Headless Operations
For automation, use the Python client which has more scripting capabilities:
pip install instagram-cli
The Python client uses the instagram command (not instagram-cli).
Multi-Account Automation Pattern
For running multiple bots/accounts:
for account in account1 account2 account3; do
instagram-cli auth switch $account
done
Or use --username flag:
instagram-cli feed --username account1
instagram-cli feed --username account2
Configuration
instagram-cli config
instagram-cli config <key> <value>
instagram-cli config edit
Common Config Options
| Key | Default | Description |
|---|
image.protocol | halfBlock | Image rendering: ascii, halfBlock, braille, kitty, iterm2, sixel |
feed.feedType | list | Feed layout: timeline, list |
Agent Integration
Reading DMs
pip install instagrapi
python3 -c "
from instagrapi import Client
cl = Client()
cl.load_settings('~/.instagram-cli/session.json') # or login
threads = cl.direct_threads()
for t in threads[:5]:
print(t.thread_title, t.messages[0].text if t.messages else '')
"
Sending DMs Programmatically
python3 -c "
from instagrapi import Client
cl = Client()
cl.login('username', 'password')
cl.direct_send('Hello!', user_ids=[cl.user_id_from_username('target_user')])
"
Posting Content
python3 -c "
from instagrapi import Client
cl = Client()
cl.login('username', 'password')
cl.photo_upload('path/to/photo.jpg', 'Caption here')
"
Multi-Bot Architecture
For running multiple Instagram bots:
~/.instagram-cli/
├── sessions/
│ ├── bot1/
│ │ └── session.json
│ ├── bot2/
│ │ └── session.json
│ └── bot3/
│ └── session.json
Each bot can have its own session directory. Use environment variables or config to point to different sessions.
Limitations & Warnings
⚠️ Account Risk: Using unofficial APIs may violate Instagram ToS. Use responsibly.
- Don't spam or automate aggressively
- Add delays between actions
- Use for personal productivity, not mass automation
- Instagram may require re-authentication periodically
Troubleshooting
Login Issues
instagram-cli auth logout
instagram-cli auth login --username <username>
2FA Required
The CLI supports 2FA — you'll be prompted to enter the code during login.
Rate Limiting
If you hit rate limits, wait a few hours before trying again. Don't retry aggressively.
See Also