← 返回
开发者工具 Key 中文

Instagram Skill via cyberdrk/gram CLI

Instagram CLI for viewing feeds, posts, profiles, and engagement via cookies.
Instagram 命令行工具,用于通过 Cookie 查看动态、帖子、主页和互动。
arein
开发者工具 clawhub v1.0.0 1 版本 99681.2 Key: 需要
★ 5
Stars
📥 3,652
下载
💾 8
安装
1
版本
#latest

概述

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 .

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

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

User Profiles

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

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

--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 <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):

{
  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. 📸

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 11:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,767
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,970
data-analysis

Onchain CLI

arein
加密货币投资组合跟踪、行情数据、CEX历史及交易查询的命令行工具。适用于查询加密货币价格、钱包余额、投资组合价值、Coinbase/Binance持仓、Polymarket预测或交易详情。
★ 2 📥 4,499