LinkedIn automation via the Linked API CLI - fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and run Sales Navigator and custom workflows. Use when the user wants to interact with LinkedIn.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
LinkedIn automation via the Linked API CLI - fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and run Sales Navigator and custom workflows. Use when the user wants to interact with LinkedIn.
user-invocable
false
disable-model-invocation
true
version
1.0.0
category
ai-service
author
Linked API (vprudnikoff)
license
MIT
progressive_disclosure
{"entry_point":{"summary":"Linked API CLI: fetch/search LinkedIn people and companies, send messages, manage connections, create posts, react, comment, plus Sales Navigator and custom workflows.","when_to_use":"LinkedIn automation - profile and company lookups, people/company search, messaging, connection management, posting, or Sales Navigator workflows through the linkedin CLI.","quick_start":"1. Install @linkedapi/linkedin-cli 2. Export LINKEDAPI_TOKEN and LINKEDAPI_IDENTIFICATION_TOKEN 3. Run linkedin setup 4. Call commands with --json -q and check the success field."}}
linkedin is a CLI tool for LinkedIn automation built on Linked API. Use it to fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and run Sales Navigator and custom workflows.
Each command sends a request to Linked API, which runs a real cloud browser to perform the action on LinkedIn. Operations are not instant - expect 30 seconds to several minutes depending on complexity.
Install the CLI when linkedin is not available:
npm install -g @linkedapi/linkedin-cli
Safety & Compliance
Read this before running any command.
LinkedIn User Agreement risk. Automated connection requests, messaging, scraping, and posting can violate LinkedIn's User Agreement and can lead to account restriction or suspension. The account owner is responsible for compliance with LinkedIn's terms and applicable law. Confirm the user accepts this risk before performing write actions at scale.
Confirm write and outreach actions. Require explicit user approval before sending messages, connection requests, InMail, posts, reactions, or comments. Show the exact target and content first.
Credentials only. Use the Linked API token and identification token issued from the dashboard. Never request LinkedIn passwords, 2FA codes, cookies, session exports, recovery codes, or browser profile data.
Respect action limits. Per-account limits are configurable on the platform. A limitExceeded error means the limit was reached - stop and report it rather than retrying.
Authentication
The CLI reads credentials from environment variables. Export them so secrets stay out of shell history and process listings. Never pass tokens as CLI arguments.
When a command fails with exit code 2 (authentication error), guide the user through setup:
Treat an exposed token as compromised and rotate it in the Linked API dashboard. Do not put tokens in source files, committed examples, issue text, chat transcripts, screenshots, or logs.
Global Flags
Always use --json and -q for machine-readable output:
linkedin <command> --json -q
Optionally set LINKEDAPI_CLIENT=skill:linkedin in the environment once so Linked API can attribute usage to this skill. There is no need to repeat it on every command.
# Basic company info
linkedin company fetch https://www.linkedin.com/company/name --json -q
# With employees filtered by position
linkedin company fetch https://www.linkedin.com/company/name --employees --employees-position "Engineer" --json -q
# With decision makers and posts
linkedin company fetch https://www.linkedin.com/company/name --dms --posts --posts-limit 10 --json -q
By default, withdrawing also unfollows the person. Use --no-unfollow to keep following.
Remove a connection
linkedin connection remove <url> --json -q
Posts
Fetch a post
linkedin post fetch <url> [flags] --json -q
Flag
Description
--comments
Include comments
--reactions
Include reactions
--comments-limit
Max comments to retrieve (requires --comments)
--comments-sort
Sort order: mostRelevant or mostRecent (requires --comments)
--comments-replies
Include replies to comments (requires --comments)
--reactions-limit
Max reactions to retrieve (requires --reactions)
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 --json -q
# With comments sorted by most recent, including replies
linkedin post fetch https://www.linkedin.com/posts/username_activity-123 \
--comments --comments-sort mostRecent --comments-replies --json -q
Create a post
linkedin post create '<text>' [flags] --json -q
Flag
Description
--company-url
Post on behalf of a company page (requires admin access)
--attachments
Attachment as url:type or url:type:name. Types: image, video, document. Can be specified multiple times.
Attachment limits: up to 9 images, or 1 video, or 1 document. Cannot mix types.
linkedin post create 'Excited to share our latest update!' --json -q
# With a document
linkedin post create 'Our Q4 report' \
--attachments "https://example.com/report.pdf:document:Q4 Report" --json -q
# Post as a company
linkedin post create 'Company announcement' \
--company-url https://www.linkedin.com/company/name --json -q
React to a post
linkedin post react <url> --type <reaction> [--company-url <url>] --json -q
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type like --json -q
# React on behalf of a company
linkedin post react https://www.linkedin.com/posts/username_activity-123 --type celebrate \
--company-url https://www.linkedin.com/company/name --json -q
Comment on a post
linkedin post comment <url> '<text>' [--company-url <url>] --json -q
Text up to 1000 characters.
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Great insights!' --json -q
# Comment on behalf of a company
linkedin post comment https://www.linkedin.com/posts/username_activity-123 'Well said!' \
--company-url https://www.linkedin.com/company/name --json -q
Statistics
# Social Selling Index
linkedin stats ssi --json -q
# Performance analytics (profile views, post impressions, search appearances)
linkedin stats performance --json -q
# API usage for a date range
linkedin stats usage --start 2024-01-01T00:00:00Z --end 2024-01-31T00:00:00Z --json -q
Sales Navigator
Requires a LinkedIn Sales Navigator subscription. Uses hashed URLs for person/company lookups.
Fetch person
linkedin navigator person fetch <hashed-url> --json -q
Search people
linkedin navigator person search [flags] --json -q
Text up to 1900 characters. Subject up to 80 characters.
linkedin navigator message send https://www.linkedin.com/in/username \
'Would love to chat about API integrations' --subject 'Partnership Opportunity' --json -q
Get Sales Navigator conversation
linkedin navigator message get <person-url> [--since TIMESTAMP] --json -q
Custom Workflows
Execute a custom workflow definition from a file, stdin, or inline:
# From file
linkedin workflow run --file workflow.json --json -q
# From stdincat workflow.json | linkedin workflow run --json -q
# Inlineecho'{"actions":[...]}' | linkedin workflow run --json -q
Check workflow status or wait for completion:
linkedin workflow status <id> --json -q
linkedin workflow status <id> --wait --json -q
linkedin account list # List accounts (* = active)
linkedin account switch "Name"# Switch active account
linkedin account rename "Name" --name "New Name"# Rename account
linkedin reset # Remove active account
linkedin reset --all # Remove all accounts
Important Behavior
Sequential execution. All operations for an account run one at a time. Multiple requests queue up.
Not instant. A real browser navigates LinkedIn - expect 30 seconds to several minutes per operation.
Timestamps in UTC. All dates and times are in UTC.
Single quotes for text arguments. Wrap message text, post text, and comments in single quotes to avoid shell interpretation issues with special characters.
Action limits. Per-account limits are configurable on the platform. A limitExceeded error means the limit was reached.
URL normalization. All LinkedIn URLs in responses are normalized to https://www.linkedin.com/... format without trailing slashes.
Null fields. Fields that are unavailable are returned as null or [], not omitted.
Anti-Patterns
Do not pass tokens as CLI arguments (--linked-api-token=...). Export them as environment variables instead so they stay out of shell history and process listings.
Do not request or accept LinkedIn passwords, 2FA codes, cookies, or session data. Use only the dashboard-issued tokens.
Do not run bulk outreach or scraping without confirming the user accepts the LinkedIn User Agreement risk.
Do not retry a write action automatically after a limitExceeded or rate-limit error. Stop and report it.