gram

Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies.

3,891 stars

Best use case

gram is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies.

Teams using gram should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gram/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/arein/gram/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gram/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gram Compares

Feature / AgentgramStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# gram 📸

Instagram CLI using REST/GraphQL API + cookie auth.

## Install

```bash
# 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 <path>`.

## Commands

### Account & Auth

```bash
gram whoami                    # Show logged-in account
gram check                     # Show credential sources
gram query-ids --refresh       # Refresh GraphQL query ID cache
```

### Reading Posts

```bash
gram post <shortcode-or-url>   # View a post
gram <shortcode-or-url>        # Shorthand for post
gram comments <shortcode> -n 20 # View comments on a post
gram likers <shortcode>        # View users who liked a post
```

### Feeds

```bash
gram feed -n 20                # Home feed
gram explore -n 20             # Explore/discover feed
```

### User Profiles

```bash
gram user <username>           # View user profile
gram user @instagram --json    # JSON output
gram posts <username> -n 20    # User's posts
gram following [username]      # Users someone follows (defaults to you)
gram followers [username]      # Someone's followers (defaults to you)
```

### Search

```bash
gram search "query"            # Search users, hashtags, places
gram search "coffee" --type users
gram search "nyc" --type places
gram search "#photography" --type hashtags
```

### Engagement Actions

```bash
gram like <shortcode>          # Like a post
gram unlike <shortcode>        # Unlike a post
gram save <shortcode>          # Save/bookmark a post
gram unsave <shortcode>        # Unsave a post
gram comment <shortcode> "nice!" # Comment on a post
gram follow <username>         # Follow a user
gram unfollow <username>       # Unfollow a user
```

## Output Options

```bash
--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

```bash
--session-id <token>           # Instagram sessionid cookie
--csrf-token <token>           # Instagram csrftoken cookie
--ds-user-id <id>              # Instagram ds_user_id cookie
--cookie-source <source>       # Cookie source for browser cookies (repeatable)
--chrome-profile <name>        # Chrome profile name
--chrome-profile-dir <path>    # Chrome/Chromium profile dir or cookie DB path
--firefox-profile <name>       # Firefox profile
--timeout <ms>                 # Request timeout
--cookie-timeout <ms>          # Cookie extraction timeout
```

## Config File

`~/.config/gram/config.json5` (global) or `./.gramrc.json5` (project):

```json5
{
  cookieSource: ["safari", "chrome"],
  chromeProfile: "Profile 1",
  timeoutMs: 60000
}
```

Environment variables: `GRAM_TIMEOUT_MS`, `GRAM_COOKIE_TIMEOUT_MS`

## Troubleshooting

### Query IDs stale (404 errors)
```bash
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. 📸

Related Skills

Data Privacy & Protection Program

3891
from openclaw/skills

You are a **Data Privacy Officer (DPO) agent** — a comprehensive privacy program architect. You help organizations build, operate, and mature privacy programs that comply with global regulations (GDPR, CCPA/CPRA, LGPD, PIPEDA, POPIA, APPI, PDPA) while enabling business growth.

Privacy & Compliance

Channel Partner Program Framework

3891
from openclaw/skills

Build, manage, and scale a channel partner program that generates indirect revenue without adding headcount.

Business Strategy & Growth

clinstagram

3891
from openclaw/skills

Full Instagram CLI — posting, DMs, stories, analytics, followers, hashtags, likes, comments. Supports Meta Graph API (official, safe) and private API (full features). Three compliance modes: official-only, hybrid-safe, private-enabled.

Social Media

Telegram Bot间群聊通信技能

3891
from openclaw/skills

**创建时间**: 2026-02-20 11:03 UTC+8

Communication

Telegram Shop Bot Developer - Python

3891
from openclaw/skills

I develop fully-featured Telegram shop bots using Python. My bots manage products, orders, and customers professionally.

instagram-reel-downloader-whatsapp

3891
from openclaw/skills

Download an Instagram Reel via sssinstagram.com and return it as a WhatsApp-ready video file. Use when a reel URL is provided and yt-dlp is blocked or not preferred.

node-telegram-cli

3891
from openclaw/skills

CLI tool for Telegram via MTProto. Send/read messages, manage groups, search conversations, download media, and automate Telegram workflows. Use when the task involves any Telegram account interaction.

excalidraw-diagram

3891
from openclaw/skills

Generate Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Triggers on "Excalidraw", "画图", "流程图", "思维导图", "可视化", "diagram", "标准Excalidraw", "standard excalidraw", "Excalidraw动画", "动画图", "animate".

instagram-search

3891
from openclaw/skills

Instagram Search — Search 400M+ Instagram posts, reels, and profiles. Find influencers, track hashtags, analyze engagement, and export data. No Instagram API or Meta developer account needed — works through Xpoz MCP.

Instagram Profile Scraper

3891
from openclaw/skills

A browser-based Instagram profile discovery and scraping tool.

telegram-groupchat-setup

3891
from openclaw/skills

Configure a MoltBot agent to participate in a Telegram group chat. Automates adding the group to the allowlist, setting mention patterns, and configuring sender permissions — all via a single gateway config patch. Use when the user wants to set up their bot in a Telegram group, enable cross-bot communication, or configure group mention gating.

instagram-reels

3891
from openclaw/skills

Download Instagram Reels, transcribe audio, and extract captions. Share a reel URL and get back a full transcript with the original description.