DEV Community

Aditya Pandey
Aditya Pandey

Posted on

How to Make an AI Agent Your Instagram Manager

An AI Instagram manager should research your account, plan content, prepare captions, and publish approved media. It should not chase followers, mass-comment, or make brand decisions without you.

This guide builds that supervised workflow with an AI coding agent and Webcmd. The agent handles the repetitive work. A person keeps control of the account, the message, and every public action.
.

TL;DR

  • Give the agent a written brand brief and a narrow job.
  • Let it read profile data and recent posts before suggesting ideas.
  • Require approval before posts, Reels, Stories, comments, likes, or follows.
  • Store approved media in a local campaign folder.
  • Publish through a reusable command and verify the returned post URL.
  • Keep growth hacks out of the workflow. Repetitive engagement can look like spam.

What are we building?

The workflow has five parts: account research, content planning, draft review, approved publishing, and a short performance review. The model handles judgment-heavy work such as themes and captions. Commands handle repeatable account actions.

Plain-text fallback: research the account, draft a plan, approve it, publish it, then review the result.

What should the agent manage?

Start with the tasks that save time without creating account risk. A good first scope covers research, planning, captions, media checks, publishing, and reporting.

Keep these actions behind explicit approval:

  • Publishing a feed post, carousel, Reel, or Story
  • Replying to a comment or direct message
  • Following or unfollowing an account
  • Liking, saving, or commenting on a post
  • Changing a caption after publication

Step 1: Install the command layer

Install Node.js 20 or newer, then install the command-line tool. Run the health check before connecting an account.

node --version
npm install -g @agentrhq/webcmd
webcmd doctor
Enter fullscreen mode Exit fullscreen mode

webcmd doctor checks the browser runtime, profile selection, daemon, and live connection. Fix any failed browser check before moving to account access.

Inspect the Instagram surface instead of relying on an old command list:

webcmd instagram --help
webcmd instagram post --help
webcmd instagram reel --help
Enter fullscreen mode Exit fullscreen mode

The command help separates read actions from write actions. That distinction gives the agent a clean approval boundary.

Step 2: Connect your Instagram account

Open the login flow and sign in yourself. Do not place an Instagram password inside the agent prompt, a shell script, or a shared environment file.

webcmd instagram login
Enter fullscreen mode Exit fullscreen mode

Complete any password or two-factor prompt in the browser. Then confirm which account the active browser profile represents:

webcmd instagram whoami -f json
Enter fullscreen mode Exit fullscreen mode

The result should contain the expected username. Stop if it points to a personal account or the wrong client profile.

Use separate browser profiles for separate brands. One mixed session is enough to publish the right post to the wrong account, which is a spectacularly dull way to create a crisis.

Step 3: Give the agent a manager brief

The agent needs rules before it needs tools. Save a short brief in the project as instagram-manager.md.

# Instagram manager

Account: @yourbrand
Audience: developers building browser agents
Goal: teach one useful idea per post
Voice: direct, curious, technical, no hype

Content mix:
- 50% practical tutorials
- 30% product demonstrations
- 20% founder observations

Rules:
- Never publish without my explicit approval.
- Never like, comment, follow, or unfollow without approval.
- Never reuse customer content without permission.
- Show the final caption, media path, and target account before publishing.
- Return the public post URL after publishing.
Enter fullscreen mode Exit fullscreen mode

Add examples of captions you like and phrases you avoid. Five real examples teach voice better than a long pile of adjectives.

Step 4: Research the account

Read the profile and recent posts as JSON. Structured results give the model captions, dates, media types, likes, and comment counts without asking it to inspect the same page by eye.

webcmd instagram profile yourbrand -f json
webcmd instagram user yourbrand --limit 12 -f json
Enter fullscreen mode Exit fullscreen mode

Ask the agent to answer four questions:

  1. Which topics appear most often?
  2. Which formats receive useful engagement?
  3. Which audience questions remain unanswered?
  4. Which recent idea deserves a follow-up?

Do not ask it to copy the top post. Ask it to find the promise behind that post, then develop a fresh example or a stronger explanation.

Step 5: Build a seven-day content plan

Give the agent one week, one audience, and one goal. A small planning window produces better drafts than asking for a vague month of "engaging content."

Use this prompt:

Read instagram-manager.md and analyze the latest 12 posts.

Create a seven-day plan with:
- one clear audience problem per post
- the format: image, carousel, Reel, or Story
- a one-sentence hook
- the proof or demonstration needed
- one call to action

Do not publish anything.
Flag ideas that need new media or factual verification.
Enter fullscreen mode Exit fullscreen mode

Review the plan for repeated hooks, unsupported claims, and ideas that exist only because a format is trending. Delete weak entries. Three good posts beat seven filler posts.

Step 6: Prepare one approved post

Create a local campaign folder for the final media and caption. Clear filenames help both the agent and the person reviewing its work.

campaigns/
  browser-agent-cost/
    cover.png
    terminal-demo.mp4
    caption.md
Enter fullscreen mode Exit fullscreen mode

Ask the agent to return a publication packet:

  • Target Instagram username
  • Final caption
  • Exact media path
  • Chosen format
  • Accessibility notes
  • Claims that need verification

Open every file before approval. Check the first frame of a Reel, the crop on mobile, subtitle timing, names, numbers, links, and rights to the media.

Step 7: Publish after approval

Feed posts and carousels accept up to ten comma-separated media paths. Pass the approved caption as the command argument.

webcmd instagram post \
  "$(cat campaigns/browser-agent-cost/caption.md)" \
  --media campaigns/browser-agent-cost/cover.png \
  -f json
Enter fullscreen mode Exit fullscreen mode

Publish an approved Reel with its MP4 file:

webcmd instagram reel \
  "$(cat campaigns/browser-agent-cost/caption.md)" \
  --video campaigns/browser-agent-cost/terminal-demo.mp4 \
  -f json
Enter fullscreen mode Exit fullscreen mode

Publish a single approved Story image or video:

webcmd instagram story \
  --media campaigns/browser-agent-cost/cover.png \
  -f json
Enter fullscreen mode Exit fullscreen mode

Treat the returned status and URL as the publishing receipt. Open the URL and inspect the live post. A successful command does not catch a poor crop or a typo baked into an image.

Step 8: Review performance without vanity loops

Read the latest posts again after enough people have had a chance to see them. Compare each result with its topic, hook, format, and call to action.

webcmd instagram user yourbrand --limit 12 -f json
Enter fullscreen mode Exit fullscreen mode

Ask the agent for observations, not a grand theory:

  • Which topic earned replies worth answering?
  • Which hook attracted the intended audience?
  • Which format took too much work for its result?
  • What follow-up question should become the next post?

Likes and comments alone do not explain why a post worked. Keep a small manual note for saves, qualified replies, profile visits, leads, and sales when those numbers matter to the business.

A safe operating prompt

Use this prompt when handing the workflow to an agent:

Act as the supervised Instagram manager for @yourbrand.

1. Read instagram-manager.md.
2. Confirm the active account with `webcmd instagram whoami -f json`.
3. Research the profile and 12 recent posts.
4. Propose the next post with its caption and media requirements.
5. Stop and request approval.
6. After approval, repeat the exact account, caption, media path, and command.
7. Stop and request final publishing approval.
8. Publish only after that approval.
9. Return the status and public URL.

Never automate likes, follows, unfollows, comments, or direct messages.
Never publish when the active username differs from @yourbrand.
Enter fullscreen mode Exit fullscreen mode

The two approval stops look slow on paper. In practice, they are cheaper than deleting the wrong post, explaining an invented claim, or recovering a restricted account.

want your ai agent to stop relearning websites?
star ⭐️ webcmd and help us build the command layer for the web. https://github.com/agentrhq/webcmd

Top comments (0)