Skip to main content
clinstagram

Let your AI agent run your Instagram.

Post, reply, answer DMs and read the numbers, from one command line your agent already knows how to use.


Star this repo    Follow @longevityboris

PyPI Python 3.10+ License: MIT


Running an Instagram account is a hundred small jobs a day: publish the post, put up the story, answer the comments, clear the message requests, check what worked. Each is easy. Together they eat the day.

clinstagram hands those jobs to an AI agent. Claude Code, Codex, Cursor, OpenClaw or a plain cron script calls it like any other command and gets short, clean JSON back. No browser to drive, no screen to scrape. The agent reads, decides and acts; you set the rules.

What your agent can do

  • Publish. Photos, carousels, reels and stories with link stickers and mentions. Fix a caption after the fact, or take a post down.
  • Keep up with people. Read and answer comments, pin the best one, clear message requests, reply to DMs, mark threads read.
  • Look after the profile. Name, bio and profile picture, a switch to a Creator or Business account, and the activity feed of new followers, likes and mentions.
  • Read the numbers. Reach, saves and shares per post, account insights, follower counts.
  • Find people. Search users and hashtags, see who follows an account, who liked a post, where someone is tagged. Download any post or reel.
  • Run several accounts. Each keeps its own login, device identity and proxy. Switch with one word.

Getting started

Ask your agent:

Install clinstagram with pip install clinstagram, run clinstagram agent-info, then log me in to Instagram.

That's the whole setup. agent-info tells the agent every command and option, so it needs no manual. To do it by hand:

pip install clinstagram
clinstagram auth login -u your_username
clinstagram profile show

clinstagram needs Python 3.10 or newer, and ffmpeg if you post video.

Safe by default

Instagram punishes accounts that act like bots, so clinstagram is careful out of the box:

  • Reading is open, writing is opt-in. The default mode uses Meta's official API wherever it can and the unofficial one only to read. Posting and messaging through the unofficial API wait until you switch on private-enabled.
  • Follows and likes need a second key. Every such call must carry --enable-growth-actions, so an agent can't start mass-liking by accident.
  • It paces itself. Writes are spaced out with random delays, and hourly and daily caps on DMs, follows and likes live in ~/.clinstagram/config.toml.
  • Secrets stay in your keychain. Logins and tokens go to the macOS Keychain, Secret Service on Linux or Windows Credential Manager. Nothing sits on disk in plain text.

Give a new account a week of normal use before you automate it. Instagram trusts new accounts least: they see fewer posts and hit limits sooner.

Made for agents

Every command answers in compact JSON: the fields an agent needs, without the long image links that waste its context. --full brings everything back; --fields id,caption returns only what you ask for.

When something goes wrong, the exit code says what kind of problem it is (bad input, expired login, rate limit, blocked by your settings) and the error carries the exact fix, so the agent can recover without asking you.

clinstagram reaches Instagram two ways and picks one per command: Meta's official Graph API for Business and Creator accounts, and instagrapi for everything the official API can't do. --backend forces either.

Running a channel

The news-channel playbook lays out a full day for a niche news account: the morning post and story, the comment and DM rounds, the evening numbers, and how to find the people worth reaching. It's written around AgingResearch.News, and the routine carries over to any channel.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md.

License

MIT


Built by Boris Djordjevic at 199 Biotechnologies | Paperfoot AI


If this is useful to you:

Star this repo    Follow @longevityboris

Metadata

Release files for clinstagram 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clinstagram 0.4.0
File Size Uploaded Provenance Actions
clinstagram-0.4.0.tar.gz 81.4 kB Without provenance Details for clinstagram-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clinstagram 0.4.0
File Interpreter ABI Platform Actions
clinstagram-0.4.0-py3-none-any.whl Python 3 none any Details for clinstagram-0.4.0-py3-none-any.whl

Total release size: 154.3 kB

Release files / clinstagram-0.4.0.tar.gz

Download URL clinstagram-0.4.0.tar.gz
Size 81.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6691800775fca7d2d6839e4dd2e5b33fd99b260b24cf06cceedcc4fc1772a219
BLAKE2b-256 checksum
How to use checksums
44ca97cd1757d4564123f5521f3055367930f55896a85fc28db40a4f860974b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / clinstagram-0.4.0-py3-none-any.whl

Download URL clinstagram-0.4.0-py3-none-any.whl
Size 73.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd9f7b9e39a08dbe6d8871e49e35b940a0ec4d10526874b114e9cd269a3c8be6
BLAKE2b-256 checksum
How to use checksums
de62f689434de83576760d0688f8816173c05d90a84b52090bb97ed22c91848e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for clinstagram 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page