Instagram auto DM from Gemini CLI
Tell Gemini CLI the keyword, the post and the message. It finds the reel, shows you the exact DM, and after your yes creates an Auto DM rule in CueEditio. From then on every matching comment gets the DM within seconds, even when Gemini CLI is closed.
For Instagram professional accounts · Updated October 2026
One-time setup in Gemini CLI
Read https://www.cueedit.io/agent.md and set up CueEditio for me. Use my email: you@example.comgemini mcp add --transport http --scope user cueedit https://www.cueedit.io/api/mcp/mcp
# then in Gemini CLI: /mcp auth cueedit- 1.Paste the line above into Gemini CLI. It signs up with an email code and gives you one link.
- 2.Open the link, check the email shown, and approve Instagram.
- 3.Ask Gemini to list your Instagram accounts.
Ask Gemini CLI
You
Make an auto DM rule for any comment on my latest reel: DM "Thanks for watching! Full video: https://example.com/yt".
Gemini CLI
Latest reel found. Rule: trigger on any comment (trigger_mode any) → DM "Thanks for watching! Full video: https://example.com/yt". Allow create_autodm_rule?
Example conversation. Post names and counts will be your own.
The CueEditio tools that run
list_accountsChecks which Instagram account is connected and whether it can send (Pro).list_postsFinds your latest reel or the post you described, with its id.create_autodm_ruleSaves the rule: keywords, the DM text, which posts, optional public reply and follow gate.list_autodm_rulesReads the rule back so you can see it is active.
How it works
1.Connect once
Add the CueEditio MCP to Gemini CLI and sign in. Connect your Instagram professional account in CueEditio.
2.Describe the rule
Name the keyword, the post ("my latest reel") and the message, link included.
3.Confirm
Gemini CLI shows the exact rule and DM text. Nothing is created until you say yes.
4.It runs on its own
The rule lives on CueEditio’s servers. It keeps sending after you close Gemini CLI. Ask Gemini CLI to pause it any time.
Gemini CLI asks before each tool call unless you trust the server. Leave confirmations on for replies and DMs.
Limits to know
- Instagram only lets a business DM someone who commented, as a private reply to that comment. The agent cannot cold-DM people who never commented.
- One DM per comment. A second send to the same comment returns already_dmed unless you tell the agent to force it.
- The comment must be 7 days old or newer. Older comments come back with dm_eligible false.
- At most 600 DMs and 600 public replies per hour per account, below Meta’s ceiling of 750.
- Reading posts, comments and rules works on the free plan. Sending replies, DMs and creating rules needs CueEditio Pro ($6 or ₹459 a month).
Questions
No. Gemini CLI only creates the rule. CueEditio stores it and Instagram’s webhook triggers it, so DMs go out while your computer is off.
Yes. Ask for "any comment" and Gemini CLI sets trigger_mode to any. Keyword rules match when the comment contains the word; ask for an exact match if you need one.
Yes. The rule can post a public reply under the comment, with up to three variations picked at random so the replies do not all look the same.
Yes. CueEditio uses the Instagram API with Instagram Login. Our messaging and comment permissions passed Meta App Review in October 2026.
This page covers Gemini CLI. Custom MCP apps in the consumer Gemini app are limited by region and plan, so use Gemini CLI if you do not see them.
Connect CueEditio to Gemini CLI
Create an account, connect your Instagram professional account, then add the MCP server above. Reading comments is free; sending replies and DMs needs Pro.
Instagram auto DM with other agents
More with Gemini CLI
Comparing tools? CueEditio vs ManyChat, CueEditio vs Postiz, CueEditio vs Blotato.