Skill detail
General-purpose LinkedIn automation with broad read and write operations.
Inspect before use
Automated review checks relevance, not safety or endorsement. Read the source instructions before using this skill.
SKILL.md
The saved excerpt is a snapshot from review. The external source remains the complete and most current version.
---
name: linkedin
description: General-purpose LinkedIn automation – fetch profiles, search people and companies, send messages, manage connections, create posts, and more. Use when the user wants to interact with LinkedIn.
---
# 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
```
## Global Flags
Always use `--json` and `-q` for machine-readable output:
```bash
LINKEDAPI_CLIENT=skill:linkedin linkedin <command> --json -q
```
When using this skill, run every `linkedin ...` example below with the
`LINKEDAPI_CLIENT=skill:linkedin` prefix so Linked API can attribute usage to the skill.
| 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> [flags] --json -q
```
Optional flags to include additional data:
- `--experience` – work history
- `--education` – education history
- `--skills` – skills list
- `--languages` – languages
- `--posts` – recent posts (with `--posts-limit N`, `--posts-since TIMESTAMP`)
- `--comments` – recent comments (with `--comments-limit N`, `--comments-since TIMESTAMP`)
- `--reactions` – recent reactions (with `--reactions-limit N`, `--reactions-since TIMESTAMP`)
Only request additional data when needed – each flag increases execution time.
```bash
# Basic profile
linkedin person fetch https://www.linkedin.com/in/username --json -q
# With experience and education
linkedin person fetch https://www.linkedin.com/in/username --experience --education --json -q
# With last 5 posts
linkedin person fetch https://www.linkedin.com/in/username --posts --posts-limit 5 --json -q
```
### Search People
```bash
linkedin person search [flags] --json -q
```
| Flag | Description |
|------|-------------|
| `--term` | Search keyword or phrase |
| `--limit` | Max results |
| `--first-name` | Filter by first name |
| `--last-name` | Filter by last name |
| `--position` | Filter by job position |
| `--locations` | Comma-separated locations |
| `--industries` | Comma-separated industries |
| `--current-companies` | Comma-separated current company nameRead the full source on GitHub (opens external page)