Post to LinkedIn using the official API v2. Uses OAuth tokens so only post when explicitly asked or scheduled.
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.
npm install -g github:0xmythril/linkedin-cli#v1.0.0
http://localhost:8585/callback to Authorized redirect URLsmkdir -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
linkedin-cli auth
linkedin-cli whoami~/.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.linkedin-cli whoami
linkedin-cli auth
linkedin-cli post "Your post text here"
linkedin-cli share "https://example.com/article" "Your commentary here"
linkedin-cli delete <post-id-urn-or-url>
linkedin-cli delete https://www.linkedin.com/feed/update/urn:li:activity:7654321/
linkedin-cli auth to re-authenticate.