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

@lucenyo/strava-cli

v0.0.3

Published

Strava CLI tool to fetch and display your latest activities

Downloads

704

Readme

strava-cli

Herramienta de línea de comandos para consultar y analizar tus actividades de entrenamiento desde Strava.

Requisitos previos

  • Node.js 18 o superior
  • Una aplicación registrada en Strava Developers para obtener Client ID y Client Secret

Instalación

cd strava-cli
npm install

Configuración

Crea un archivo .env en la raíz de strava-cli/ a partir del ejemplo:

cp .env.example .env

Edita .env con tus credenciales de la API de Strava:

STRAVA_CLIENT_ID=tu_client_id
STRAVA_CLIENT_SECRET=tu_client_secret

Autenticación

Antes de usar los comandos, debes autenticarte con Strava mediante OAuth 2.0:

npm run dev -- login

Esto abrirá el navegador para que autorices la aplicación. El token se guardará automáticamente en ~/.config/strava-ai-cli/auth.json.

Uso

Todos los comandos se ejecutan desde el directorio strava-cli/:

npm run dev -- <comando> [opciones]

Comandos disponibles

login

Autentica la CLI con tu cuenta de Strava.

npm run dev -- login

activities list

Lista tus actividades recientes.

npm run dev -- activities list

Opciones:

| Opción | Descripción | Por defecto | |--------|-------------|-------------| | --page <n> | Número de página | 1 | | --per-page <n> | Actividades por página | 30 |

Ejemplos:

# Listar las últimas 10 actividades
npm run dev -- activities list --per-page 10

# Obtener la segunda página
npm run dev -- activities list --page 2 --per-page 20

Modos de salida

| Flag | Descripción | |------|-------------| | (ninguno) | Modo interactivo con formato de tabla (requiere TTY) | | --json | Salida en JSON (apto para scripts) | | --raw | Salida en texto plano | | --tui | Forzar modo interactivo aunque la salida esté redirigida |

Ejemplo con JSON:

npm run dev -- activities list --json | jq '.[0].name'

Ayuda

npm run dev -- --help
npm run dev -- activities --help

Scripts disponibles

| Comando | Descripción | |---------|-------------| | npm run dev | Ejecuta la CLI cargando variables desde .env | | npm start | Ejecuta la CLI sin cargar .env | | npm run lint | Comprueba el código con ESLint | | npm run format | Formatea el código con Prettier |

Estructura del proyecto

strava-cli/
├── bin/strava.ts                  # Punto de entrada ejecutable
├── src/
│   ├── index.ts                   # Router principal de comandos
│   ├── types.ts                   # Tipos globales (GlobalFlags, OutputMode…)
│   ├── commands/
│   │   ├── login.ts               # Flujo OAuth2 y almacenamiento de tokens
│   │   └── activities/
│   │       ├── index.ts           # Router del subcomando activities
│   │       └── list.ts            # Listado de actividades
│   ├── schemas/
│   │   ├── strava-activity.ts     # Schema Zod para actividades
│   │   └── strava-auth.ts         # Schemas Zod para autenticación
│   └── utils/
│       ├── auth.ts                # Carga y guardado de tokens
│       └── logger.ts              # Logger adaptado al modo de salida
├── package.json
└── tsconfig.json

Tecnologías

  • TypeScript 5 ejecutado directamente con tsx (sin paso de compilación)
  • Node.js fetch nativo para llamadas HTTP
  • Zod para validación de respuestas de la API
  • @clack/prompts para la interfaz interactiva en terminal
  • arg para el parsing de argumentos CLI