Skill1 starsChanged 12 days agoMITView on GitHub
Drives the user's own Instagram account from the terminal through the same private endpoints instagram.com's web client uses, authenticated with the user's browser session cookies (no Graph API app, no Apify). Signs in via Chrome or imported cookies, reads profiles, posts, reels, comments, hashtags and search, computes account metrics, and publishes photos, carousels, reels and stories, edits captions and replies to comments (it never deletes), always as a dry run until the user approves. This skill should be used when the user says "post this to Instagram", "upload a reel", "publish a carousel", "log in to Instagram", "import my Instagram cookies", "post a story", "edit the caption on", "am I logged in to Instagram", "show my recent posts", "get stats for this post", "get this profile's posts", "reply to that comment", or mentions an instagram.com URL, even without saying "Instagram skill".
- Reads credentials
17 other projects use a version of this.
Adopted by
Most recently taken up by
- matthewdonsemail-lab/logtheir own version, first seen Nov 15, 2026
- eumateusalex/Template-OStheir own version, first seen Nov 8, 2026
- brightdata/skillstheir own version, first seen Nov 1, 2026
- abhayla/claude-best-practicestheir own version, first seen Nov 1, 2026
- manifoldmcp/marketing-skillstheir own version, first seen Oct 17, 2026
- obra/muse-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use tiktok, linkedin and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
G-HunterAiSkilltiktok
TikTok platform integration. Manage videos, view analytics, and track engagement.
Also in 4 projects that use this
kkoppenhaverSkilllinkedin
Write LinkedIn posts in Keanan's voice. Use when drafting LinkedIn content, creating professional posts, or sharing builder-focused insights. Triggers include requests to "write a LinkedIn post", "draft something for LinkedIn", "help me post on LinkedIn", or any LinkedIn content creation. Generates upbeat, builder-centric content mixing practical how-tos with candid humor.
Also in 4 projects that use this
QuixiAISkillspotify
Search Spotify, inspect current playback and devices, and control playback with explicit approval
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- brightdata/skills★ 270same name
- refly-ai/refly-skills★ 204same name
- hyperfx-ai/marketing-skills★ 112same name
- matthewdonsemail-lab/log★ 63same name
- obra/muse-skills★ 20same name
- AceDataCloud/Skills★ 17same name
- moboutrig/instagram-claude-skill★ 10same name
- abhayla/claude-best-practices★ 9same name
- mediause/agent-skills★ 9same name
- geegewu/gegeewu-open-skill★ 8same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- instagram-adsSkill
- instagram-auditSkill
- instagram-contentSkill
- instagram-researchSkill
- instagram-video-breakdownSkill
- instagram-video-remakeSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run every command from this skill directory:
- Very specific: line 15
No install step: Bun runs the TypeScript directly and the scripts have zero npm dependencies.
- Very specific: line 37
Never retry an unclear publish: If a publish ends without a clear answer, the CLI records it as pending and refuses new posts.
- Very specific: line 40
Only one publish runs at a time.
- Very specific: line 78
Every read reports via, meaning which endpoint answered.
- Very specific: line 117
Prefer a caption file (--caption-file) for anything with line breaks or quotes, to avoid shell quoting problems on Windows.
- Very specific: line 129
Every confirmed write appends a line (ids, urls, never cookies) to actions.jsonl in the data directory.
- Very specific: line 149
references/endpoints.md: every endpoint, request contract and evidence status, how to re-verify them from the live web client, and what …
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Instagram (web session)
Run every command from this skill directory:
cd <skill-dir> # the folder containing this SKILL.md
npx -y bun scripts/main.ts <command> [options] # add --json for a machine envelopeNo install step: Bun runs the TypeScript directly and the scripts have zero npm dependencies.
ffmpeg is optional (PNG/WebP to JPEG conversion and reel cover frames).
Ground rules (follow every time)
- Writes are dry runs by default.
post,edit-caption,commentandreplyprint the exact requests and validation result and send nothing. Show the user the media, caption and warnings, get an explicit yes for that post, then re-run the same command with--confirm --account <username>. Approval for one post never covers the next one. The dry run showssignedInAs: say which account the post will go to, and if it is not the account the user means, stop and have themlogin --forceas the right one.--accountis required with--confirm, and the write refuses if the session is another account. - Unverified writes need a second opt-in. A write runs with
--confirmalone only once its contract isverified-live(statuslists them). Photos, carousels, reels, stories, comments and replies are verified (reels through the "comet async" form instagram.com requires since 2026-11-12; verified 2026-11-13). Reel tags (--tag) and the AI label (--ai-label) are verified too (2026-11-13). Collaborator invites (--collab), the story AI label and edit-caption still need--experimental. Story mentions (--mention) were tried live and did NOT take: tell the user to add the mention in the app. Tell the user the endpoint has not been proven on a real account and may fail, and suggest a test account for the first try. - Stop on account signals. On
rate_limited(HTTP 429),checkpoint,feedback_requiredornot_logged_in, stop all Instagram calls and report the error'shint. Never retry in a loop, never switch endpoints to get around it. - Never retry an unclear publish. If a publish ends without a clear answer, the CLI records
it as pending and refuses new posts. Run
pending check <id>, ask the user to look at the profile, and resolve withpending resolve <id> --posted|--not-posted. Only one publish runs at a time; a second one is refused while the first is running. A crashed run's lock is ignored automatically.pending unlockonly tidies up those files. - No engagement automation. There are no follow, like or DM commands, by design. Comments and replies are one at a time, with the user approving each text. Instagram restricts accounts that automate engagement.
- Never print or paste cookie values.
statusshows redacted lengths only.
Authentication
npx -y bun scripts/main.ts login # opens Chrome (dedicated profile); sign in, 2FA is fine
npx -y bun scripts/main.ts login --force # always re-open Chrome (--timeout <sec>, default 300)
npx -y bun scripts/main.ts import-cookies cookies.json # Cookie-Editor JSON, cookies.txt, or "Cookie:" header
npx -y bun scripts/main.ts whoami # confirms the session against Instagram
npx -y bun scripts/main.ts status # offline: saved cookies (redacted), pending publishes
npx -y bun scripts/main.ts logout # deletes cookies, caches and the Chrome profile (--keep-profile keeps it)The session needs sessionid, csrftoken and ds_user_id for .instagram.com. sessionid
is HttpOnly, so login reads cookies over the Chrome DevTools protocol. The data directory
(%APPDATA%\instagram-ai, ~/Library/Application Support/instagram-ai, or
$XDG_DATA_HOME/instagram-ai) is locked to the current user before anything is written
(icacls on Windows, 0700/0600 elsewhere). If that fails, nothing is saved. INSTAGRAM_COOKIES
can carry a session for one process without touching disk.
Reading
npx -y bun scripts/main.ts profile [username] # default: own account
npx -y bun scripts/main.ts posts [username] --limit 30 # default: own account; newest first
npx -y bun scripts/main.ts media <url|shortcode|id>
npx -y bun scripts/main.ts comments <url|shortcode|id> --limit 50
npx -y bun scripts/main.ts hashtag <tag> --limit 24
npx -y bun scripts/main.ts search <query>
npx -y bun scripts/main.ts audit [username] --limit 30 --tz America/Bogota
npx -y bun scripts/main.ts swipe user1,user2,user3 --limit 24 --min 3Every read reports via, meaning which endpoint answered. Reads try the REST endpoints first,
then a GraphQL persisted query whose doc_id is discovered from the live web bundles. The last
resort is the 12 posts embedded in the profile response. When via says "embedded, max 12",
tell the user the sample is small. Counters can be null when the owner hid like counts.
Reach, saves, shares and profile visits are Insights-only and never available here.
audit returns the metric set used by the instagram-audit skill. swipe scores each post
against its own account's median, and is used by instagram-research. Keep research small: at
most 12 accounts per run, and the CLI spaces requests at least 1.5 s apart.
Publishing
# 1. Dry run: show this output to the user
npx -y bun scripts/main.ts post photo ./img.jpg --caption-file caption.txt --alt "Alt text"
npx -y bun scripts/main.ts post carousel ./1.jpg ./2.jpg ./3.mp4 --caption "..."
npx -y bun scripts/main.ts post reel ./reel.mp4 --caption "..." --cover ./cover.jpg # or --cover-at 1.5
npx -y bun scripts/main.ts post story ./story.jpg
# 2. After explicit approval of that exact post
npx -y bun scripts/main.ts post photo ./img.jpg --caption-file caption.txt --alt "Alt text" --confirm --account <username>--experimental stays required until that write type is marked verified-live.
Options: --disable-comments, --hide-likes, --no-feed (reel only on the Reels tab),
--max-hashtags N (default 5, Instagram's current cap), --ignore-pending (only after the user
resolved pending publishes by looking at the profile).
Validation before anything is uploaded:
| Rule | Limit |
| Caption | 2,200 chars; 5 hashtags; 20 mentions; warning when the first line is over ~125 chars |
| Feed images | aspect 4:5 to 1.91:1; 8 MB; JPEG (other formats converted with ffmpeg) |
| Carousel | 2 to 20 items; mixed aspect ratios are cropped to the first (warning) |
| Reel | 3 s to 15 min; H.264/HEVC; 9:16 recommended (warning otherwise) |
| Story | photo or video (up to 60 s); 9:16 recommended |
Prefer a caption file (--caption-file) for anything with line breaks or quotes, to avoid shell
quoting problems on Windows. Lint captions first with the instagram-content skill's
caption-lint.ts.
Managing
npx -y bun scripts/main.ts edit-caption <ref> --caption-file new.txt [--confirm --account <username> --experimental]
npx -y bun scripts/main.ts comment <ref> --text "..." [--confirm --account <username>]
npx -y bun scripts/main.ts reply <ref> <commentId> --text "..." [--confirm --account <username>]Every confirmed write appends a line (ids, urls, never cookies) to actions.jsonl in the data
directory. Use it to find what the CLI posted, or to finish a failed cleanup by hand.
Errors
| Kind | Meaning / action |
not_logged_in | Session expired: login --force or import-cookies |
checkpoint | Instagram wants a security check: user completes it in a browser, then login --force |
rate_limited | 429: stop for 15 to 30 min; do not retry |
feedback_required | Action blocked: stop writes for 24 h |
not_found / unexpected_response | Endpoint moved: run probe, then update scripts/endpoints.ts |
bad_request | Payload rejected: compare with the web client (see references) |
validation | Input problem; nothing was sent |
probe [--refresh-config] [--graphql] checks the main endpoints with a handful of GETs and
stops at the first 429. Run it only when diagnosing, not routinely.
Additional resources
references/endpoints.md: every endpoint, request contract and evidence status, how to re-verify them from the live web client, and what to edit when Instagram changes something.scripts/endpoints.ts(the endpoint table),scripts/publish.ts(write contracts andCONTRACTSstatus),scripts/graphql.ts(doc_id discovery).
Environment variables
| Variable | Purpose |
INSTAGRAM_DATA_DIR, INSTAGRAM_COOKIE_PATH, INSTAGRAM_CHROME_PROFILE_DIR, INSTAGRAM_CHROME_PATH | Storage and browser locations |
INSTAGRAM_COOKIES | Session for one process, any supported format, never written to disk |
INSTAGRAM_APP_ID, INSTAGRAM_ASBD_ID, INSTAGRAM_USER_AGENT | Header overrides when Instagram rotates them |
INSTAGRAM_DOCID_<OperationName> | Pin a GraphQL doc_id |
INSTAGRAM_MIN_GAP_MS | Minimum gap between requests (default 1500) |
INSTAGRAM_MAX_HASHTAGS | Default hashtag cap (5) |
INSTAGRAM_FFMPEG_PATH | ffmpeg location |
INSTAGRAM_ALLOW_INSECURE_STORAGE=1 | Store the session even if the folder cannot be locked (not recommended) |
Bun auto-loads a .env file from the working directory, which could set any of these. Always run
from this skill directory (it ships no .env), or add --no-env-file after bun. Origin
overrides (INSTAGRAM_BASE_URL and friends) are ignored unless they are https on instagram.com.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

