π¦ ClawHub
Instagram Skill via cyberdrk/gram CLI
by @arein
Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies.
TERMINAL
clawhub install gramπ About This Skill
name: gram description: Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies. homepage: https://github.com/arein/gram metadata: {"clawdbot":{"emoji":"πΈ","requires":{"bins":["gram"]},"install":[{"id":"npm","kind":"node","package":"@cyberdrk/gram","bins":["gram"],"label":"Install gram (npm)"}]}}
gram πΈ
Instagram CLI using REST/GraphQL API + cookie auth.
Install
# npm/pnpm/bun
npm install -g @cyberdrk/gramOne-shot (no install)
bunx @cyberdrk/gram whoami
Authentication
gram uses cookie-based auth from your Instagram web session.
Use --session-id, --csrf-token, and --ds-user-id to pass cookies directly, or --cookie-source for browser cookies.
Run gram check to see which source is active. For Arc/Brave, use --chrome-profile-dir .
Commands
Account & Auth
gram whoami # Show logged-in account
gram check # Show credential sources
gram query-ids --refresh # Refresh GraphQL query ID cache
Reading Posts
gram post # View a post
gram # Shorthand for post
gram comments -n 20 # View comments on a post
gram likers # View users who liked a post
Feeds
gram feed -n 20 # Home feed
gram explore -n 20 # Explore/discover feed
User Profiles
gram user # View user profile
gram user @instagram --json # JSON output
gram posts -n 20 # User's posts
gram following [username] # Users someone follows (defaults to you)
gram followers [username] # Someone's followers (defaults to you)
Search
gram search "query" # Search users, hashtags, places
gram search "coffee" --type users
gram search "nyc" --type places
gram search "#photography" --type hashtags
Engagement Actions
gram like # Like a post
gram unlike # Unlike a post
gram save # Save/bookmark a post
gram unsave # Unsave a post
gram comment "nice!" # Comment on a post
gram follow # Follow a user
gram unfollow # Unfollow a user
Output Options
--json # JSON output
--json-full # JSON with raw API response in _raw field
--plain # No emoji, no color (script-friendly)
--no-emoji # Disable emoji
--no-color # Disable ANSI colors (or set NO_COLOR=1)
Global Options
--session-id # Instagram sessionid cookie
--csrf-token # Instagram csrftoken cookie
--ds-user-id # Instagram ds_user_id cookie
--cookie-source # Cookie source for browser cookies (repeatable)
--chrome-profile # Chrome profile name
--chrome-profile-dir # Chrome/Chromium profile dir or cookie DB path
--firefox-profile # Firefox profile
--timeout # Request timeout
--cookie-timeout # Cookie extraction timeout
Config File
~/.config/gram/config.json5 (global) or ./.gramrc.json5 (project):
{
cookieSource: ["safari", "chrome"],
chromeProfile: "Profile 1",
timeoutMs: 60000
}
Environment variables: GRAM_TIMEOUT_MS, GRAM_COOKIE_TIMEOUT_MS
Troubleshooting
Query IDs stale (404 errors)
gram query-ids --refresh
Cookie extraction fails
--cookie-source--chrome-profile-dir--session-id, --csrf-token, --ds-user-idUser-agent mismatch errors
TL;DR: View feeds, profiles, search, and engage with Instagram via CLI. πΈ
π Tips & Best Practices
Query IDs stale (404 errors)
gram query-ids --refresh
Cookie extraction fails
--cookie-source--chrome-profile-dir--session-id, --csrf-token, --ds-user-idUser-agent mismatch errors
TL;DR: View feeds, profiles, search, and engage with Instagram via CLI. πΈ