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

lazdock-cli

v0.2.0

Published

Open-source Docker management CLI and API for the Lazdock mobile app

Readme

lazdock-cli

CLI open source que conecta Docker Engine directamente con la app móvil Lazdock. No necesita servidor central: ofrece API autenticada, WebSocket para logs y terminal, recursos y Docker Compose.

Requisitos e instalación

  • Linux y Node.js 20.19+
  • Docker Engine accesible para el usuario
  • Docker Compose v2 para stacks
  • Puerto TCP configurable, 4050 por defecto
npm install --global lazdock-cli
lazdock doctor
lazdock service install --port 4050

Desde este checkout usa npm install y npm install --global ..

El servicio usa systemd de usuario, arranque automático y Restart=always. Sin systemd ejecuta lazdock serve --port 4050 desde el supervisor del sistema.

Vinculación y comandos

Ejecuta lazdock code. El código dura diez minutos. En la app pulsa + e ingresa IP o dominio, puerto y código.

lazdock code
lazdock serve [--port 4050]
lazdock service install [--port 4050]
lazdock service status|restart|logs|uninstall
lazdock doctor
lazdock update [--check]

Funciones Docker

  • Crear contenedores con imagen, comando, variables, puertos, montajes y política de reinicio.
  • Listar, inspeccionar, iniciar, detener, pausar, reiniciar y eliminar contenedores.
  • Descargar, listar, inspeccionar, eliminar y limpiar imágenes.
  • Crear, listar, inspeccionar y eliminar volúmenes.
  • Crear redes con driver, subred, gateway, modo interno e IPv6.
  • Desplegar, listar, iniciar, detener, reiniciar y eliminar stacks Compose.
  • Métricas de contenedor y estado global de host y Docker.
  • Docker system prune con volúmenes opcionales.
  • Logs continuos y terminal interactiva mediante WebSocket.

Los Compose se guardan con permisos privados en ~/.lazdock/stacks.

API

Todas las rutas salvo /health y /pair requieren Authorization: Bearer TOKEN.

GET|POST  /containers
GET        /containers/:id/inspect|stats
PUT        /containers/:id
POST       /containers/:id/start|stop|restart|pause|unpause
DELETE     /containers/:id?force=true
GET        /images|volumes|networks
POST       /images/pull|images/prune
POST       /volumes|networks
GET        /images|volumes|networks/:id/inspect
DELETE     /images|volumes/:id
GET|POST   /stacks
POST       /stacks/:name/start|stop|restart|down
GET        /system/info
POST       /system/prune
WS         /containers/:id/logs/stream
WS         /containers/:id/terminal

Las entradas llegan a Docker como argumentos separados, nunca mediante shell. Los cuerpos HTTP tienen límite de 2 MB; Compose de 1 MB y los nombres de stacks se validan.

Compatibilidad Linux

La unidad portable cubre rutas habituales en Ubuntu/Debian, Fedora/RHEL/Rocky/Alma, Arch/Manjaro y openSUSE. En servidores sin sesión persistente puede requerirse sudo loginctl enable-linger USER.

Alpine/OpenRC y distribuciones sin systemd usan lazdock serve desde OpenRC, runit o s6. El parser acepta JSON por línea y arreglos JSON de distintas versiones de Compose v2.

Firewall y seguridad

sudo ufw allow 4050/tcp
sudo firewall-cmd --add-port=4050/tcp --permanent
sudo firewall-cmd --reload

Limita el origen a tu IP o usa VPN/TLS. No publiques el socket Docker.

Pruebas

npm test
npm run pack:check

La suite cubre creación avanzada, host, Compose, prune, borrados, reinicio, logs, terminal dúplex, streams de un millón de caracteres, Docker lento, reinicio HTTP y rutas Linux. Usa Docker simulado y no elimina recursos reales.

Validación real de desarrollo: Docker 29.1.3, Compose 2.40.3 y Ubuntu 24.04; negociación comprobada con API Docker 1.44, 1.45, 1.46 y 1.52.

Licencia MIT.

Puerto, TLS y reverse proxy

Consulta o cambia el puerto del servicio sin editar archivos:

lazdock port
sudo lazdock port 4050

Para HTTPS/WSS directo proporciona un certificado PEM y su clave al servicio (lazdock serve --tls-cert /etc/letsencrypt/live/host/fullchain.pem --tls-key /etc/letsencrypt/live/host/privkey.pem). En producción también puedes terminar TLS en Nginx/Caddy y reenviar WebSocket a 127.0.0.1:4050; conserva Upgrade y Connection y no expongas el puerto interno.

El emparejamiento limita a cinco códigos incorrectos por IP en una ventana de 15 minutos. Los tokens se pueden rotar o revocar con POST /auth/rotate y POST /auth/revoke (la app los expone en Ajustes).

Trabajos, eventos y paginación

POST /jobs acepta pull, image-prune, prune y compose; consulta GET /jobs/:id y cancela con DELETE /jobs/:id. Los trabajos informan progreso y salida acotada. WS /events transmite eventos de Docker en tiempo real. Las listas aceptan ?page=1&limit=100 y devuelven page, limit, total y hasNext.

Compose puede recibir secrets como mapa NOMBRE: VALOR; el CLI escribe un .env con modo 0600 y nunca devuelve sus valores por API. Aun así, usa un gestor de secretos del sistema para producción y elimina los archivos temporales cuando ya no sean necesarios.

Terminal y servicios Linux

La terminal usa PTY real (xterm-256color), admite resize y colores ANSI. El instalador detecta systemd, OpenRC y runit. Para generar artefactos locales: npm run package:deb, npm run package:rpm (requiere rpmbuild) o npm run package:binary (requiere descarga de @yao-pkg/pkg; genera el ejecutable y un tarball con el addon PTY nativo). La CI prueba Node 20/22 y Debian, Fedora, Arch y openSUSE.

Publicación npm

El paquete está preparado como [email protected]; publica desde una sesión autenticada con npm login usando npm publish --access public.

La generación local de códigos también está limitada a cinco solicitudes por ventana de 15 minutos; el emparejamiento remoto aplica el mismo límite por dirección IP.