LinkedIn CLI Skill
You are helping the user interact with LinkedIn using the lnk CLI tool.
Prerequisites
Ensure lnk is installed:
bash
# Install from Homebrew brew install swiftlysingh/lnk/lnk # Or download from releases # https://github.com/swiftlysingh/lnk/releases # Check installation lnk --version
Authentication
Check auth status first:
bash
lnk auth status
Auth Methods
Browser (macOS only):
bash
lnk auth login --browser safari # or lnk auth login --browser chrome
Email/Password:
bash
lnk auth login -e your@email.com # Prompts for password interactively
Cookie-based (most reliable):
bash
# Extract cookies from browser, then use li_at token lnk auth login --li-at "your-li_at-cookie-value"
Environment variables:
bash
export LINKEDIN_LI_AT="your-li_at-cookie" export LINKEDIN_JSESSIONID="your-jsessionid-cookie" lnk auth login --env
Available Commands
Profile
bash
# View your profile lnk profile me # View someone else's profile by username/URN lnk profile get <username> # e.g., lnk profile get billgates
Posts
bash
# Create a post lnk post create "Your post content here" # Read your feed lnk feed read # Delete a post lnk post delete <post-urn>
Search
bash
# Search for people lnk search people "iOS developer" # Search for companies lnk search companies "Apple" # Search with filters (if supported) lnk search people "software engineer" --location "San Francisco"
Messaging
bash
# List conversations lnk messages list # Read a conversation lnk messages read <conversation-id> # Send a message lnk messages send --to "recipient-urn" --message "Hello!" # Reply to a conversation lnk messages reply <conversation-id> "Your reply here"
Output Formats
bash
# Default table format lnk profile me # JSON output (for scripting/AI agents) lnk profile me --json # Plain text lnk profile me --plain
Common Tasks
Check your LinkedIn profile summary
bash
lnk profile me --json | jq '.headline, .summary'
Find iOS developers to connect with
bash
lnk search people "iOS developer" --json | jq '.[] | {name, headline}'
Post an update
bash
lnk post create "Excited to share that I just shipped a new feature! 🚀"
Check recent messages
bash
lnk messages list --json
Guidelines
- •Always check auth status before running commands if it might have expired
- •Use --json flag when parsing output programmatically
- •Respect rate limits - LinkedIn may throttle API requests
- •Don't spam - Use messaging responsibly
- •Profile URNs look like:
urn:li:person:xxxxx - •Post URNs look like:
urn:li:share:xxxxx
Troubleshooting
"Not authenticated"
Run: lnk auth login with your preferred method
"LinkedIn requires verification"
LinkedIn may block logins from unknown devices. Try:
- •Logging in via browser first
- •Using cookie-based auth (
--li-at) - •Waiting a few hours before retrying
"Rate limited"
Slow down requests. Wait 5-10 minutes before trying again.
"No cookies found" (browser auth)
- •Make sure browser is closed
- •Grant Full Disk Access to terminal (macOS)
- •Try a different browser or auth method