/install gram
gram 📸
Instagram CLI using REST/GraphQL API + cookie auth.
Install
# npm/pnpm/bun
npm install -g @cyberdrk/gram
# One-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 \x3Cpath>.
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 \x3Cshortcode-or-url> # View a post
gram \x3Cshortcode-or-url> # Shorthand for post
gram comments \x3Cshortcode> -n 20 # View comments on a post
gram likers \x3Cshortcode> # View users who liked a post
Feeds
gram feed -n 20 # Home feed
gram explore -n 20 # Explore/discover feed
User Profiles
gram user \x3Cusername> # View user profile
gram user @instagram --json # JSON output
gram posts \x3Cusername> -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 \x3Cshortcode> # Like a post
gram unlike \x3Cshortcode> # Unlike a post
gram save \x3Cshortcode> # Save/bookmark a post
gram unsave \x3Cshortcode> # Unsave a post
gram comment \x3Cshortcode> "nice!" # Comment on a post
gram follow \x3Cusername> # Follow a user
gram unfollow \x3Cusername> # 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 \x3Ctoken> # Instagram sessionid cookie
--csrf-token \x3Ctoken> # Instagram csrftoken cookie
--ds-user-id \x3Cid> # Instagram ds_user_id cookie
--cookie-source \x3Csource> # Cookie source for browser cookies (repeatable)
--chrome-profile \x3Cname> # Chrome profile name
--chrome-profile-dir \x3Cpath> # Chrome/Chromium profile dir or cookie DB path
--firefox-profile \x3Cname> # Firefox profile
--timeout \x3Cms> # Request timeout
--cookie-timeout \x3Cms> # 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
- Check browser is logged into Instagram
- Try different
--cookie-source - For Arc/Brave: use
--chrome-profile-dir - Provide cookies manually:
--session-id,--csrf-token,--ds-user-id
User-agent mismatch errors
- The CLI uses desktop user-agent by default
- If your session was created on mobile, it may fail
- Create a new session by logging in via desktop browser
TL;DR: View feeds, profiles, search, and engage with Instagram via CLI. 📸
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install gram - After installation, invoke the skill by name or use
/gram - Provide required inputs per the skill's parameter spec and get structured output
What is Instagram Skill via cyberdrk/gram CLI?
Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies. It is an AI Agent Skill for Claude Code / OpenClaw, with 3152 downloads so far.
How do I install Instagram Skill via cyberdrk/gram CLI?
Run "/install gram" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Instagram Skill via cyberdrk/gram CLI free?
Yes, Instagram Skill via cyberdrk/gram CLI is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Instagram Skill via cyberdrk/gram CLI support?
Instagram Skill via cyberdrk/gram CLI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Instagram Skill via cyberdrk/gram CLI?
It is built and maintained by arein (@arein); the current version is v1.0.0.