A fast, lightweight CLI for Threads β read posts, browse profiles, search users, and more from your terminal.
yarn-threads whoami
# Jeizzon Mendes @jeizzon.mp4
# β
Authenticated successfully
yarn-threads about zuck
# Mark Zuckerberg @zuck
# βοΈ Verified
# π Mostly superintelligence and MMA takes
# 5,444,367 followers | 460 following
yarn-threads user-posts zuck
# Posts by @zuck (15):
# Today we're establishing a new top-level initiative called Meta Compute...- Read posts β Fetch any thread by URL or shortcode
- Browse profiles β View user info, posts, followers, following
- Search users β Find accounts by name or handle
- View likes β See your liked posts
- Replies β Get reply threads for any post
- Cookie-based auth β Uses your existing browser session (no OAuth needed)
- Multiple output formats β Human-friendly, plain text, or JSON
npm install -g yarn-threads-cligit clone https://github.com/jeizzon/yarn-threads-cli.git
cd yarn-threads-cli
npm install
npm run build
npm linkyarn-threads-cli uses cookies from your browser to authenticate with Threads. You must be logged into Threads in your browser.
# Use default Chrome profile
yarn-threads whoami
# Use a specific Chrome profile directory
yarn-threads --chrome-profile-dir "/path/to/chrome/profile/Default" whoami
# Use Chrome profile by name
yarn-threads --chrome-profile "Profile 1" whoamiyarn-threads --firefox-profile "default-release" whoamiyarn-threads --session-id "YOUR_SESSION_ID" --csrf-token "YOUR_CSRF_TOKEN" whoamiOr via environment variables:
export THREADS_SESSION_ID="..."
export THREADS_CSRF_TOKEN="..."
yarn-threads whoamiThe CLI automatically extracts cookies from Safari, Chrome, and Firefox. On macOS, it uses the system keychain to decrypt Chrome cookies.
yarn-threads whoami
yarn-threads whoami --jsonyarn-threads about zuck
yarn-threads about @mosseri
yarn-threads about 314216 --json # by user IDyarn-threads user-posts zuck
yarn-threads user-posts mosseri --limit 5yarn-threads read https://www.threads.net/@zuck/post/DTa3-B1EbTp
yarn-threads read DTa3-B1EbTp # shortcode only
yarn-threads read 3812345678901234567 # post IDyarn-threads replies https://www.threads.net/@zuck/post/DTa3-B1EbTp
yarn-threads replies DTa3-B1EbTp --limit 10yarn-threads thread https://www.threads.net/@zuck/post/DTa3-B1EbTpyarn-threads search "design"
yarn-threads search "AI" --limit 20Note: Search returns users, not posts (Instagram API limitation).
yarn-threads likes
yarn-threads likes --limit 50yarn-threads followers zuck
yarn-threads followers zuck --limit 100yarn-threads following zuck
yarn-threads following jeizzon.mp4 --limit 50yarn-threads about zuckyarn-threads about zuck --plainyarn-threads about zuck --jsonCreate ~/.config/yarn/config.json5:
{
// Chrome profile directory (full path)
chromeProfileDir: "/Users/you/.clawdbot/browser/clawd/user-data/Default",
// Or Chrome profile name
chromeProfile: "Default",
// Firefox profile name
firefoxProfile: "default-release",
// Request timeout (ms)
timeoutMs: 30000,
// Cookie extraction timeout (ms)
cookieTimeoutMs: 5000,
}| Variable | Description |
|---|---|
THREADS_SESSION_ID |
Session cookie value |
THREADS_CSRF_TOKEN |
CSRF token cookie value |
THREADS_USER_ID |
User ID cookie value |
NO_COLOR |
Disable colored output |
| Command | Status | Reason |
|---|---|---|
home |
β | Home timeline requires app-level authentication |
saved |
β | Saved posts endpoint not publicly accessible |
- Search returns users only β The Instagram mobile API doesn't expose post search. Use the Threads web app for searching posts.
- The Instagram API may rate-limit requests if you make too many in a short period.
- If you encounter errors, wait a few minutes before retrying.
- Session cookies expire periodically. If authentication fails, log into Threads in your browser again.
yarn-threads-cli uses the Instagram mobile API (i.instagram.com) with your browser session cookies. This is the same API that the Threads mobile app uses.
Why not the official Threads API?
The official Threads API requires:
- Meta developer app registration
- OAuth flow for authentication
- Access token management
The cookie-based approach works with your existing browser session β no app registration needed.
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Watch mode
npm run devInspired by bird (Twitter/X CLI) and threads-api.
MIT