npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lnkn-cli

v0.8.0

Published

CLI para publicar y gestionar posts de LinkedIn (OAuth API + Playwright fallback)

Readme

linkedin-cli

Roadmap completo: GUIA.md

CLI para publicar y gestionar posts de LinkedIn desde la terminal. Soporta la API oficial OAuth (recomendado) y Playwright como fallback para analytics y posting legacy.

Instalacion

Desde npm (recomendado)

npm install -g lnkn-cli
npx playwright install chromium   # solo si usas modo Playwright

Desde el repo

git clone https://github.com/mayckolco/linkedin-cli.git
cd linkedin-cli
npm install
npx playwright install chromium
npm link

Setup OAuth (recomendado)

Cada usuario necesita su propia LinkedIn Developer App. No compartas client_id / client_secret.

  1. Crea una app en LinkedIn Developer Portal
  2. Activa Sign In with LinkedIn using OpenID Connect y Share on LinkedIn
  3. Registra el redirect URI: http://127.0.0.1:8765/callback
  4. Configura credenciales:
linkedin auth init --client-id TU_CLIENT_ID --client-secret TU_CLIENT_SECRET
linkedin auth login
linkedin whoami

Guia detallada: docs/SETUP-OAUTH.md

Tokens en ~/.linkedin-cli/credentials.json (permisos 600). El token dura ~60 dias; sin refresh_token debes repetir linkedin auth login.

Transportes: API vs Playwright

| Caso | Transporte | Comando | |------|------------|---------| | Publicar texto, imagen, video, documento, reshare | API OAuth | linkedin post text/image/... --confirm | | Publicar desde archivo .txt | API (recomendado) | linkedin post file draft.txt --transport api --confirm | | Publicar desde archivo .txt | Playwright (legacy) | linkedin post file draft.txt --confirm | | Analytics del dashboard | Playwright | linkedin analytics | | Login rapido sin Developer App | Playwright | linkedin login |

Recomendacion: usa API OAuth para todo posting. Playwright se mantiene como fallback y para analytics (scraping), con riesgo de rotura de selectores y ToS de automatizacion.

Comandos — Auth

| Comando | Descripcion | |---------|-------------| | linkedin auth init | Guardar client_id/secret | | linkedin auth login | Flujo OAuth | | linkedin auth refresh | Refrescar token (si hay refresh_token) | | linkedin auth profiles | Listar perfiles OAuth | | linkedin auth use <name> | Cambiar perfil activo | | linkedin auth status | Estado del token | | linkedin auth logout | Borrar credenciales | | linkedin whoami | Perfil autenticado |

Variables: LINKEDIN_CLI_PROFILE, LINKEDIN_CLI_DATA, LINKEDIN_API_VERSION (default 202508).

Comandos — Posting (API)

Sin --confirm siempre hace dry-run.

# Texto
linkedin post text "Mi update" --confirm --log

# Desde archivo
linkedin post file borrador.txt --transport api --confirm --log

# Imagen (jpg, png, gif — debe ser archivo valido)
linkedin post image --file foto.png --text "Caption" --confirm

# Video (mp4, mov)
linkedin post video --file clip.mp4 --text "Caption" --title "Titulo" --confirm

# Documento (pdf, doc, ppt)
linkedin post document --file guia.pdf --title "Guia" --text "Caption" --confirm

# Reshare
linkedin post reshare urn:li:share:123456789 --text "Recomiendo" --confirm

# Borrar
linkedin post delete urn:li:share:123456789 --confirm

Alias: linkedin post borrador.txt equivale a linkedin post file borrador.txt.

Migrar desde autopost-v2

linkedin migrate autopost-v2 --dry-run
linkedin migrate autopost-v2

Ver docs/AUTOPOST-V2.md y docs/AGENTS.md.

Comandos — Borradores, historial, panel

| Comando | Descripcion | |---------|-------------| | linkedin draft save/list/show | Gestionar borradores | | linkedin history list/add | Historial de posts | | linkedin schedule create/list/cancel | Programar (Windows) | | linkedin serve --open | Panel web local | | linkedin analytics | Scrape Playwright (prototipo, disclaimer ToS) | | linkedin analytics post <urn> | Metricas de un post via API | | linkedin analytics me | Metricas agregadas via API | | linkedin analytics export | Exportar snapshots JSON/CSV | | linkedin mcp | Servidor MCP (stdio) para agentes — docs/MCP.md |

MCP (agentes)

Expone el CLI como herramientas MCP para Cursor o Claude Desktop:

linkedin mcp
# o
linkedin-mcp

Configuracion y tools: docs/MCP.md. Salida --json para integraciones custom: docs/AGENTS.md.

Limites de la API

| Recurso | Limite | |---------|--------| | Texto del post | 3 000 caracteres | | Imagen | JPG, PNG, GIF; < 36 MPixeles | | Video | MP4/MOV; hasta 5 GB | | Documento | PDF, DOC, PPT; hasta 100 MB | | Token OAuth | ~60 dias (re-auth manual sin refresh_token) | | Permisos posting | w_member_social + OpenID scopes | | Leer posts propios via API | Requiere r_member_social (restringido) | | Analytics por post via API | Requiere r_member_postAnalytics — guia |

Datos locales

~/.linkedin-cli/
  config.json       # perfil OAuth activo
  app.json          # client_id/secret (NO commitear)
  apps/<profile>.json
  credentials.json  # tokens OAuth (NO commitear)
  drafts/<profile>/
  history/<profile>/posts-log.jsonl
  profile/          # sesion Playwright
  analytics/

Override: --data-dir o LINKEDIN_CLI_DATA.

Publicar en npm (maintainers)

Ver docs/PUBLISH.md.

Desarrollo

npm test
node bin/linkedin.js --help

Licencia

MIT — ver LICENSE.