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: a pair of twin CLIs — the Node one and this Python one. Zero dependencies: the CDP client talks to the browser over a private pipe (--remote-debugging-pipe, no TCP port) using only 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 CDP pipe (no TCP 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 on Linux (POSIX — the CDP pipe uses fds 3/4) 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 pipe CDP privado (sin puerto TCP) → 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 en Linux (POSIX — el pipe CDP usa los fds 3/4) 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.

Metadata

Release files for ghlike 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghlike 0.2.0
File Size Uploaded
ghlike-0.2.0.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghlike 0.2.0
File Interpreter ABI Platform
ghlike-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / ghlike-0.2.0.tar.gz

Download URL ghlike-0.2.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4d111ea15a2c00ba4f998d8f4bbc68579e7df4e5f761f8967619698d0672a081
BLAKE2b-256 checksum
How to use checksums
3a803b7611ff953935ef3138e9b6100c3b6d87e58a9499b15a60127420d0339e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release files / ghlike-0.2.0-py3-none-any.whl

Download URL ghlike-0.2.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deace0653794bf48a381ee74d46be2b973b066e6e8c9c721cd1d88e6b72a9598
BLAKE2b-256 checksum
How to use checksums
a5a356f04a7d4a4e8da2abf28e400380f966073bc8de0b4cb4da0285a2820776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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