Skip to main content

ghlike

Star GitHub repos with your browser session — no tokens. / Da estrellas en GitHub con la sesión de tu navegador — sin tokens.

English · Español

This is the Python CLI of the ghlike project (like-button widget + browser extension + Node CLI live there). Zero dependencies: the CDP WebSocket client is implemented on the standard library, so the whole package audits in one sitting.


English

What it does

ghlike owner/repo stars a GitHub repository using the login session already active in your browser. No gh auth login, no personal access tokens, no OAuth: if you're logged into GitHub in Brave, Chrome, Chromium, Edge, Vivaldi or Opera (native or snap installs), it just works.

How: it finds the browser profile with your github.com session → copies the encrypted cookie store to a throwaway profile → opens your own browser headless with a private debug port → clicks the real Star button (GitHub handles its own CSRF) → verifies → kills the browser and deletes the profile. Cookies are never decrypted and never leave your machine.

Install

Available on PyPI: pypi.org/project/ghlike

pipx install ghlike        # or: pip install --user ghlike

Requires Python ≥ 3.9 and a Chromium-family browser with a github.com session. Firefox is not supported (no CDP).

CLI

ghlike owner/repo            # star (idempotent — tells you if already starred)
ghlike https://github.com/o/r  # full URLs work
ghlike owner/repo -c         # check current state only
ghlike owner/repo -u         # unstar
ghlike owner/repo --toggle   # flip
ghlike --list                # github.com sessions found in your browsers
ghlike --browser brave o/r   # force one browser (strict)
ghlike o/r --json            # machine-readable output

Exit codes: 0 ok (incl. nothing-to-do) · 1 generic error · 2 no github.com session · 3 repo not found.

JSON example:

$ ghlike cli/cli --check --json
{"repo":"cli/cli","user":"you","browser":"Brave","profile":"Default",
 "before":false,"action":"check","after":false,"changed":false}

Library

from ghlike import star, unstar, check, toggle

star("vercel/next.js")                 # -> {"repo": ..., "changed": True, ...}
state = check("vercel/next.js")        # -> {"repo": ..., "after": True/False, ...}
unstar("vercel/next.js", browser="brave")
toggle("vercel/next.js")

Exceptions: NoSessionError, RepoNotFoundError, GhlikeError.

Limitations

  • Chromium-family browsers only; Firefox is not supported (no CDP).
  • Each operation takes ~8–12 s (headless browser + page load). That's the price of the no-token approach.
  • Depends on GitHub's Star button; if the markup changes, one selector line fixes it (STATE_JS in src/ghlike/core.py).

Development

PYTHONPATH=src python3 -m ghlike.cli --list
python -m pip wheel . --no-deps --no-build-isolation -w dist

Publishing is automated: push a git tag / create a GitHub Release vX.Y.Z and .github/workflows/publish-pypi.yml publishes to PyPI via Trusted Publishing (no secrets). Versions live in pyproject.toml and src/ghlike/__init__.py.

License: MIT.


Español

Qué hace

ghlike owner/repo da una estrella a un repositorio de GitHub usando la sesión ya iniciada en tu navegador. Sin gh auth login, sin personal access tokens, sin OAuth: si estás logueado en GitHub en Brave, Chrome, Chromium, Edge, Vivaldi u Opera (nativo o snap), funciona directamente.

Cómo: busca el perfil del navegador con tu sesión de github.com → copia la tienda de cookies cifrada a un perfil desechable → abre tu propio navegador en modo invisible con un puerto de depuración privado → pulsa el botón de Star real (GitHub gestiona su propio CSRF) → verifica → cierra el navegador y borra el perfil. Las cookies nunca se descifran ni salen de tu máquina.

Instalación

Disponible en PyPI: pypi.org/project/ghlike

pipx install ghlike        # o: pip install --user ghlike

Requiere Python ≥ 3.9 y un navegador de la familia Chromium con sesión de github.com. Firefox no está soportado (sin CDP).

CLI

ghlike owner/repo            # dar star (idempotente)
ghlike https://github.com/o/r  # URLs completas valen
ghlike owner/repo -c         # solo consultar estado
ghlike owner/repo -u         # quitar star
ghlike owner/repo --toggle   # invertir
ghlike --list                # sesiones de GitHub detectadas
ghlike --browser brave o/r   # forzar un navegador (estricto)
ghlike o/r --json            # salida para scripts

Códigos de salida: 0 ok (también "nada que hacer") · 1 error genérico · 2 sin sesión de github.com · 3 repo no encontrado.

Librería

from ghlike import star, unstar, check, toggle

star("vercel/next.js")                 # -> {"repo": ..., "changed": True, ...}
state = check("vercel/next.js")        # -> {"repo": ..., "after": True/False, ...}
unstar("vercel/next.js", browser="brave")

Excepciones: NoSessionError, RepoNotFoundError, GhlikeError.

Limitaciones

  • Solo navegadores Chromium; Firefox no (sin CDP).
  • Cada operación tarda ~8–12 s (navegador invisible + carga). Es el precio del enfoque sin tokens.
  • Depende del botón de Star de GitHub; si cambia el markup, se arregla con una línea (STATE_JS en src/ghlike/core.py).

Desarrollo

PYTHONPATH=src python3 -m ghlike.cli --list
python -m pip wheel . --no-deps --no-build-isolation -w dist

La publicación es automática: crea un Release vX.Y.Z en GitHub y .github/workflows/publish-pypi.yml publica en PyPI con Trusted Publishing (sin secrets). Las versiones viven en pyproject.toml y src/ghlike/__init__.py.

Licencia: MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghlike-0.1.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghlike-0.1.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file ghlike-0.1.1.tar.gz.

File metadata

  • Download URL: ghlike-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ghlike-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e4658cbea5ceb5266773f42d20007f9895ce8ce302d5d7df33a4aee58fac671
MD5 930c6706eb5d55faa6cf0a3c5b535e04
BLAKE2b-256 1ab146de3a430a1b1b001404d189899cb8e1b1c6c8e50da439c5804ca20f986d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghlike-0.1.1.tar.gz:

Publisher: publish-pypi.yml on 686f6c61/ghlike-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghlike-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ghlike-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ghlike-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a76d6bac67b2418d6b724bf139b3860aee84a2180151435e5563e59b0aedadaf
MD5 6f608ee2571562d0e82b7599d6505bd3
BLAKE2b-256 d42265e6a119d16edd8cb78ec827546bbd44d42dfd176b34b75eb44b4f73822a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghlike-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on 686f6c61/ghlike-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page