Skip to main content

LinkedIn CLI tool using Safari session cookies

Project description

LinkedIn CLI

A command-line interface for LinkedIn, powered by Safari session cookies and LinkedIn's internal Voyager API.

Browse your feed, view notifications, create posts, react to content, search people, and view profiles — all from the terminal.

Installation

pip install linkedin-cli-tool

Or install from source:

git clone https://github.com/utsmannn/licli.git
cd licli
pip install -e .

Requirements

  • macOS with Safari
  • Python 3.10+
  • Active LinkedIn session in Safari (you must be logged in)

Commands

Authentication

# Test connection and see your profile
li auth

Profile

# View your own profile
li me

# View someone else's profile
li profile johndoe

Feed

# Show your LinkedIn feed
li feed

# Limit number of posts
li feed -n 5

Notifications

# View recent notifications
li notif

# Limit to 5 notifications
li notif -n 5

Shows notification headlines, timestamps, read/unread status, and content previews. Activity-linked notifications include a copyable li view command.

View Post Detail

# By activity URN
li view urn:li:activity:7426564508296400897

# By numeric ID only
li view 7426564508296400897

# From a feed URL path
li view /feed/update/urn:li:activity:7426564508296400897

Displays full post text, author, reaction breakdown (like, celebrate, love, etc.), comment/share counts, and inline comments.

Create a Post

# Simple post
li post "Hello LinkedIn!"

# With visibility setting
li post "Hello connections!" --visibility CONNECTIONS

# With mention (by URN)
li post "Great work @John!" --mention "John:urn:li:fsd_profile:ACoAAabc123"

# With mention (by profile ID — auto-resolves URN)
li post "Great work @John!" --mention "John:johndoe"

React to a Post

# Like a post (default)
li react urn:li:activity:7426564508296400897

# Choose reaction type
li react 7426564508296400897 --type celebrate
li react 7426564508296400897 --type love
li react 7426564508296400897 --type insightful
li react 7426564508296400897 --type funny
li react 7426564508296400897 --type curious

# Remove your reaction
li react 7426564508296400897 --undo

Comment on a Post

# Top-level comment on a post
li comment urn:li:activity:7426564508296400897 "Great post!"

# By numeric ID
li comment 7426564508296400897 "Nice one!"

# Reply to a specific comment (URN from `li view` output)
li comment "urn:li:comment:(activity:7426564508296400897,7426673256407007233)" "Thanks!"

Search People

li search "software engineer"
li search "John Doe" -n 5

Search Posts

# Search for posts by keyword
li search "artificial intelligence" --type posts

# Limit results
li search "machine learning" --type posts -n 5

How It Works

This CLI extracts session cookies from Safari's cookie store (~/Library/Cookies/Cookies.binarycookies) to authenticate with LinkedIn's internal APIs:

  • Voyager REST API — used for read operations (feed, profile, search, notifications, post detail) and comments
  • GraphQL API — used for creating posts and fetching comment threads
  • RSC (React Server Components) API — used for reactions (like/unlike)

No OAuth flow or API keys required — just log into LinkedIn in Safari and you're ready to go.

Cookies Used

Cookie Purpose
li_at LinkedIn authentication token
JSESSIONID CSRF token

Project Structure

linkedin_cli/
  __init__.py        # Package metadata
  auth.py            # Safari cookie extraction
  client.py          # LinkedIn API client (Voyager + RSC)
  cli.py             # Click CLI commands
  utils.py           # Formatting helpers
  rsc_template.json  # RSC payload template for reactions

Disclaimer

This tool uses LinkedIn's unofficial internal API. Use responsibly:

  • LinkedIn may rate limit or restrict your account
  • The API may change without notice
  • This is for personal use only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkedin_cli_tool-0.2.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkedin_cli_tool-0.2.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file linkedin_cli_tool-0.2.0.tar.gz.

File metadata

  • Download URL: linkedin_cli_tool-0.2.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for linkedin_cli_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5a9f54be1f215ac4f14f8948a8d383e1bf883c5e5ce8d5219c04e2da655afd82
MD5 3ce7fa01b368bf55c98d122481997df5
BLAKE2b-256 a0e28963107ef70e54415bcffb5a94780d547baa72acceff749ec16f9a24e9bd

See more details on using hashes here.

File details

Details for the file linkedin_cli_tool-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for linkedin_cli_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc2f6dba542d9f8c5dd5a542aa74914e45b599db5c3b81e06e4fdf299ce55467
MD5 b2f09c68d4ef6810d8dda66351fe31df
BLAKE2b-256 bdb36456e05fb8936317ba2b0ebdb82938c46e47bbcf3b294e8b8c14c204f920

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page