MR
Mayur Rathi
@mayurrathi
⭐ 5 GitHub stars

Linkedin Cli

Use when automating LinkedIn via CLI: fetch profiles, search people/companies, send messages, manage connections, create posts, and Sales Navigator.

mkdir -p ./skills/linkedin-cli && curl -sfL https://raw.githubusercontent.com/mayurrathi/awesome-agent-skills/main/skills/linkedin-cli/SKILL.md -o ./skills/linkedin-cli/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

When to Use


Use this skill when you need to automate LinkedIn tasks such as profile fetching, connection management, or post creation via CLI, especially when integrated into automated workflows.


# LinkedIn Skill


You have access to `linkedin` – a CLI tool for LinkedIn automation. Use it to fetch profiles, search people and companies, send messages, manage connections, create posts, react, comment, and more.


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.


If `linkedin` is not available, install it:


```bash

npm install -g @linkedapi/linkedin-cli

```


Authentication


If a command fails with exit code 2 (authentication error), ask the user to set up their account:


1. Go to [app.linkedapi.io](https://app.linkedapi.io) and sign up or log in

2. Connect their LinkedIn account

3. Copy the **Linked API Token** and **Identification Token** from the dashboard


Once the user provides the tokens, run:


```bash

linkedin setup --linked-api-token=TOKEN --identification-token=TOKEN

```


When to Use


Use this skill when you need to **orchestrate LinkedIn actions from scripts or an AI agent** instead of clicking through the web UI:


- Building outreach, research, or recruiting workflows that rely on LinkedIn data and messaging.

- Enriching leads or accounts by fetching people and company profiles in bulk.

- Coordinating multi-step Sales Navigator or workflow runs where JSON output and exit codes are required.


Always respect LinkedIn’s terms of service, local regulations, and your organisation’s compliance policies when using automation against real accounts.


Global Flags


Always use `--json` and `-q` for machine-readable output:


```bash

linkedin <command> --json -q

```


| Flag | Description |

| ----------------------- | --------------------------------------- |

| `--json` | Structured JSON output |

| `--quiet` / `-q` | Suppress stderr progress messages |

| `--fields name,url,...` | Select specific fields in output |

| `--no-color` | Disable colors |

| `--account "Name"` | Use a specific account for this command |


Output Format


Success:


```json

{ "success": true, "data": { "name": "John Doe", "headline": "Engineer" } }

```


Error:


```json

{

"success": false,

"error": { "type": "personNotFound", "message": "Person not found" }

}

```


Exit code 0 means the API call succeeded – always check the `success` field for the action outcome. Non-zero exit codes indicate infrastructure errors:


| Exit Code | Meaning |

| --------- | ------------------------------------------------------------------------------------------- |

| 0 | Success (check `success` field – action may have returned an error like "person not found") |

| 1 | General/unexpected error |

| 2 | Missing or invalid tokens |

| 3 | Subscription/plan required |

| 4 | LinkedIn account issue |

| 5 | Invalid arguments |

| 6 | Rate limited |

| 7 | Network error |

| 8 | Workflow timeout (workflowId returned for recovery) |


Commands


Fetch a Person Profile


```bash

linkedin person fetch <url

🎯 Best For

  • Claude users
  • Knowledge workers
  • Remote teams
  • Professionals

💡 Use Cases

  • Using Linkedin Cli in daily workflow
  • Automating repetitive productivity tasks

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Linkedin Cli to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

How do I install Linkedin Cli?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/linkedin-cli/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills