π¦ ClawHub
Linkedin Cli
by @0xmythril
Post to LinkedIn using the official API v2. Uses OAuth tokens so only post when explicitly asked or scheduled.
TERMINAL
clawhub install linkedin-cli-2π About This Skill
name: linkedin-cli description: Post to LinkedIn using the official API v2. Uses OAuth tokens so only post when explicitly asked or scheduled. homepage: https://github.com/0xmythril/linkedin-cli metadata: {"openclaw":{"emoji":"πΌ","requires":{"bins":["linkedin-cli"],"env":["LINKEDIN_CLIENT_ID","LINKEDIN_CLIENT_SECRET","LINKEDIN_ACCESS_TOKEN"]},"install":[{"id":"npm","kind":"shell","command":"npm install -g github:0xmythril/linkedin-cli#v1.0.0","bins":["linkedin-cli"],"label":"Install linkedin-cli v1.0.0 (npm)"}]}}
linkedin-cli
Post to LinkedIn using the official API v2. This tool is rate-limited by LinkedIn, so only use it when the user explicitly asks you to post, or during scheduled cron tasks. Do not speculatively draft and post content.
Setup
1. Install (pinned to release tag):
npm install -g github:0xmythril/linkedin-cli#v1.0.0
2. Create a LinkedIn app at https://www.linkedin.com/developers/apps
- Enable Sign In with LinkedIn using OpenID Connect and Share on LinkedIn products
- Add http://localhost:8585/callback to Authorized redirect URLs
3. Configure credentials (file is created with restricted permissions):
mkdir -p ~/.config/linkedin-cli
touch ~/.config/linkedin-cli/.env
chmod 600 ~/.config/linkedin-cli/.env
cat > ~/.config/linkedin-cli/.env << 'EOF'
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
EOF
4. Authenticate (opens browser for OAuth):
linkedin-cli auth
5. Verify: linkedin-cli whoamiSecurity
~/.config/linkedin-cli/.env (read by dotenv at runtime). Set chmod 600 to restrict access.npm pack --dry-run or inspect package.json.api.linkedin.com) and OAuth (www.linkedin.com) when you run a command.commander (CLI parsing), dotenv (env file loading), open (browser launch for OAuth). No transitive dependencies beyond these.Commands
Verify auth
linkedin-cli whoami
Authenticate
linkedin-cli auth
Post a text update
linkedin-cli post "Your post text here"
Share a URL with commentary
linkedin-cli share "https://example.com/article" "Your commentary here"
Delete a post
linkedin-cli delete
linkedin-cli delete https://www.linkedin.com/feed/update/urn:li:activity:7654321/
Important rules
linkedin-cli auth to re-authenticate.βοΈ Configuration
1. Install (pinned to release tag):
npm install -g github:0xmythril/linkedin-cli#v1.0.0
2. Create a LinkedIn app at https://www.linkedin.com/developers/apps
- Enable Sign In with LinkedIn using OpenID Connect and Share on LinkedIn products
- Add http://localhost:8585/callback to Authorized redirect URLs
3. Configure credentials (file is created with restricted permissions):
mkdir -p ~/.config/linkedin-cli
touch ~/.config/linkedin-cli/.env
chmod 600 ~/.config/linkedin-cli/.env
cat > ~/.config/linkedin-cli/.env << 'EOF'
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
EOF
4. Authenticate (opens browser for OAuth):
linkedin-cli auth
5. Verify: linkedin-cli whoami