# Linkedin

> Post updates to LinkedIn, track analytics, and optimize content.

- Skill: `dvcrn/linkedin-5` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx skillmds@latest add dvcrn/linkedin-5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dvcrn/linkedin-5/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: dvcrn (https://skillmd.com/u/dvcrn)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/dvcrn/linkedin-5

---


# LinkedIn Skill

Post updates, track performance, and optimize your content for maximum reach.

## Setup & Authentication

1.  **Create an App**: Go to [LinkedIn Developers](https://www.linkedin.com/developers/apps), create an app, and add the "Sign In with LinkedIn" and "Share on LinkedIn" products.
2.  **Generate Token**: Use the included helper script to generate an OAuth 2.0 Access Token.
    ```bash
    # Set your credentials
    export LINKEDIN_CLIENT_ID="your_client_id"
    export LINKEDIN_CLIENT_SECRET="your_client_secret"
    export LINKEDIN_REDIRECT_URI="http://localhost:8000/callback"

    # Run the auth helper
    uv run /opt/homebrew/lib/node_modules/openclaw/skills/linkedin/scripts/linkedin_auth.py
    ```
3.  **Save Token**: Save the generated token as `LINKEDIN_ACCESS_TOKEN` in your environment.

## Usage

### 1. Optimize & Feedback Loop (New!)
Analyze your draft against top-performing posts before you publish. Requires `GEMINI_API_KEY`.
```bash
uv run /opt/homebrew/lib/node_modules/openclaw/skills/linkedin/scripts/linkedin_feedback.py "Your draft text here..."
```

### 2. Posting
**Preview (Default):**
```bash
uv run /opt/homebrew/lib/node_modules/openclaw/skills/linkedin/scripts/linkedin.py "Your post text"
```

**Publish:**
```bash
uv run /opt/homebrew/lib/node_modules/openclaw/skills/linkedin/scripts/linkedin.py "Your post text" --confirm
```

### 3. Analytics
**View Stats:**
Reads from `linkedin_history.jsonl` and fetches current stats (Requires `r_member_social`).
```bash
uv run /opt/homebrew/lib/node_modules/openclaw/skills/linkedin/scripts/linkedin_analytics.py
```

## Configuration
- `LINKEDIN_ACCESS_TOKEN`: Valid OAuth 2.0 Access Token.
- `GEMINI_API_KEY`: Required for the Feedback Loop/Optimizer.

