Instagram Content Studio
by @uyeong
Manage an Instagram account. View profile, list posts, publish images/carousels, publish videos/Reels, and read/write comments. Use when the user requests an...
clawhub install instagram-content-studioπ About This Skill
name: instagram-api description: Manage an Instagram account. View profile, list posts, publish images/carousels, publish videos/Reels, and read/write comments. Use when the user requests any Instagram-related task. allowed-tools: Bash(node scripts/*) compatibility: Requires node (v22+), npm, and cloudflared (for local file uploads). Requires env var INSTAGRAM_ACCESS_TOKEN in a .env file. Requires internet access to graph.instagram.com. metadata: version: "1.0"
Instagram API Skill
A skill for managing an Instagram account via the Instagram Graph API. Supports profile viewing, post management, image publishing, video/Reels publishing, and comment operations.
Prerequisites
.env file with credentials must be configured.INSTAGRAM_ACCESS_TOKEN
- Recommended (for comment/reply via Facebook Graph): FACEBOOK_USER_ACCESS_TOKEN
- Required for FB token refresh: FACEBOOK_APP_ID, FACEBOOK_APP_SECRET
cloudflared must be installed for local image/video posting..env file path, append --env to every command.node scripts/get-profile.js --env /home/user/.instagram-env
Available Commands
All commands automatically refresh the token before execution. No manual refresh needed.
Refresh Token
# Instagram token refresh
node scripts/refresh-token.jsFacebook user token refresh (for comments/replies flow)
node scripts/refresh-facebook-token.js
Manually refreshes token(s) and returns expiration info.
View Profile
node scripts/get-profile.js
Returns profile info (name, username, account type, media count).
List Posts
node scripts/get-posts.js [--limit 10]
Returns the user's post list. Use --limit to set the count (default: 10).
View Post Detail
node scripts/get-post.js
Returns post detail including like count and comment count.
Publish Image
# Single image (URL)
node scripts/post-image.js --caption "Caption" https://example.com/photo.jpgSingle image (local file)
node scripts/post-image.js --caption "Caption" ./photos/image.pngCarousel β multiple images (URL)
node scripts/post-image.js --caption "Caption" https://example.com/a.jpg https://example.com/b.jpgCarousel β multiple images (local files)
node scripts/post-image.js --caption "Caption" ./img1.png ./img2.png ./img3.jpg
http://, https://) and local file paths are supported, but mixing is not allowed.Publish Video (Reels)
# Single video (URL)
node scripts/post-video.js --caption "Caption" https://example.com/video.mp4Single video (local file)
node scripts/post-video.js --caption "Caption" ./videos/clip.mp4With cover image and options
node scripts/post-video.js --caption "Caption" --cover https://example.com/cover.jpg --thumb-offset 5000 --share-to-feed true https://example.com/video.mp4Video carousel β multiple videos (URL)
node scripts/post-video.js --caption "Caption" https://example.com/a.mp4 https://example.com/b.mp4Video carousel β multiple videos (local files)
node scripts/post-video.js --caption "Caption" ./clip1.mp4 ./clip2.mov
--cover, --thumb-offset, --share-to-feed options are only available for single video posts (not carousels).View Comments
node scripts/get-comments.js
Returns comments and replies for a specific post.
Post Comment
node scripts/post-comment.js --text "Comment text"
Reply to Comment
node scripts/reply-comment.js --text "Reply text"
Workflow Guidelines
Error Handling
If the output contains an error field, an error has occurred. Explain the cause to the user and suggest a resolution.
{ "error": "error message" }
Security
Token storage
refreshIgToken() and refreshFbToken() overwrite tokens in the .env file in plaintext. Do not commit .env to version control.Local file upload
Minimum required permissions
When creating your Meta app, grant only these permissions:instagram_business_basic β profile and media readinstagram_content_publish β image/video publishinginstagram_manage_comments β comment read/writepages_read_engagement β required for comment API via Facebook Graphpages_show_list β required for page-linked Instagram accountsβοΈ Configuration
.env file with credentials must be configured.INSTAGRAM_ACCESS_TOKEN
- Recommended (for comment/reply via Facebook Graph): FACEBOOK_USER_ACCESS_TOKEN
- Required for FB token refresh: FACEBOOK_APP_ID, FACEBOOK_APP_SECRET
cloudflared must be installed for local image/video posting..env file path, append --env to every command.node scripts/get-profile.js --env /home/user/.instagram-env