LinkedIn CLI
Command-line tool for managing your LinkedIn account. Read your feed, view profiles, analyze post engagement, manage connections, search people/companies/jobs, and send messages — all from the terminal.
Uses Nodriver (CDP-based browser automation) under the hood — no WebDriver binary, no navigator.webdriver flag, undetectable by LinkedIn's PerimeterX/HUMAN anti-bot system.
What's in this Repo
This repo contains 3 things — install what you need:
| What | For whom | Install |
|---|
| LinkedIn CLI | Everyone | Binary or pip install |
| CLI Reference Plugin | AI/Claude Code users who want CLI knowledge for their agents | /plugin install linkedin-cli-reference |
| LinkedIn Commander Plugin | Marketers who want a full AI marketing team | /plugin install linkedin-commander |
1. LinkedIn CLI (the tool itself)
Terminal tool to interact with LinkedIn. Works standalone, no AI needed.
linkedin-cli profile show williamhgates
linkedin-cli posts analytics 7438407227096539136
linkedin-cli search people "software engineer" --limit 5
2. CLI Reference Plugin (for AI agents)
A single skill that teaches Claude Code (or any agent) how to use all CLI commands — correct syntax, flags, --json output shapes.
# In Claude Code:
/plugin marketplace add sabania/linkedin-cli
/plugin install linkedin-cli-reference
After installing, any agent or subagent can load the linkedin-cli-reference skill and knows how to call the CLI via Bash.
3. LinkedIn Commander Plugin (full marketing system)
Self-learning marketing system with 9 AI agents as a marketing team. Content strategy, post analysis, lead generation, competitor tracking, signal detection — all delta-based with human-in-the-loop.
# In Claude Code:
/plugin marketplace add sabania/linkedin-cli
/plugin install linkedin-commander
/setup
Full documentation: plugin/README.md
CLI Installation
Prerequisites
- Google Chrome installed (Nodriver communicates with it via CDP — no separate ChromeDriver needed)
Quick Install
Windows (PowerShell):
irm https://raw.githubusercontent.com/sabania/linkedin-cli/master/install.ps1 | iex
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/sabania/linkedin-cli/master/install.sh | bash
Installs to ~/.local/share/linkedin-cli (Unix) or %LOCALAPPDATA%\linkedin-cli (Windows) and automatically adds it to PATH. Restart terminal afterwards.
Manual Install
Download ZIP from Releases, extract and manually add directory to PATH:
| OS | File |
|---|
| Windows | linkedin-cli-windows.zip |
| macOS | linkedin-cli-macos.tar.gz |
| Linux | linkedin-cli-linux.tar.gz |
From Source (Developers)
git clone https://github.com/sabania/linkedin-cli.git
cd linkedin-cli
pip install -r requirements.txt
python main.py login
Uninstall
# Windows
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/sabania/linkedin-cli/master/install.ps1))) -Uninstall
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/sabania/linkedin-cli/master/install.sh | bash -s -- --uninstall
Login
# Opens Chrome — you log in, CLI captures cookies automatically. 2FA works.
linkedin-cli login
# On headless servers (no display): paste li_at cookie instead
# Get it from: Browser → linkedin.com → DevTools (F12) → Application → Cookies → li_at
linkedin-cli login --cookie "AQE..."
# Verify
linkedin-cli whoami
Login only needs to be done once. Session cookies are stored at ~/.linkedin-cli/cookies.json.
CLI Commands
Settings
linkedin-cli config show # Show all settings + daily usage
linkedin-cli config set rate_limits.daily_limit 120 # Max API calls per day
linkedin-cli config set rate_limits.calls_per_minute 20 # Burst limit per minute
linkedin-cli config set browser.headless false # Show browser window (debug)
linkedin-cli config reset # Reset to defaults
Profile
linkedin-cli profile show <user> # View profile
linkedin-cli profile posts <user> -n 5 # Posts with engagement stats
linkedin-cli profile contact <user> # Contact info
linkedin-cli profile skills <user> # Skills
linkedin-cli profile experiences <urn> # Work experience
linkedin-cli profile connections <urn> # Connections
linkedin-cli profile views # Who viewed your profile
linkedin-cli profile network <user> # Followers, connections count
linkedin-cli profile raw <user> # Raw JSON dump
Feed
linkedin-cli feed list -n 10 # Your feed
linkedin-cli feed list --no-promoted # Without sponsored posts
Posts