ghlike
Star GitHub repos with your browser session — no tokens. / Da estrellas en GitHub con la sesión de tu navegador — sin tokens.
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
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_JSinsrc/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
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_JSensrc/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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghlike-0.1.0.tar.gz.
File metadata
- Download URL: ghlike-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
044af1d13a955abb166ad6719960a6c2e103f55e23ff0a1c577cc0b8bf259c12
|
|
| MD5 |
63d303f7f4a15dae52f54aae3892b671
|
|
| BLAKE2b-256 |
26e1ccff1dbdc9c6c076626223c530df19f4b17ea0b78999c3c72d1fd2b689c2
|
Provenance
The following attestation bundles were made for ghlike-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on 686f6c61/ghlike-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghlike-0.1.0.tar.gz -
Subject digest:
044af1d13a955abb166ad6719960a6c2e103f55e23ff0a1c577cc0b8bf259c12 - Sigstore transparency entry: 2677028810
- Sigstore integration time:
-
Permalink:
686f6c61/ghlike-py@0f2542175ec48b98cd59c0dfbb00c015e3480d14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/686f6c61
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f2542175ec48b98cd59c0dfbb00c015e3480d14 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ghlike-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ghlike-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db66663382cd6fe308ae0fcfaf10f209e965a1065186f11f1d7c5690c6f564f9
|
|
| MD5 |
233928d9bdb7457471fc7dfc6cac335b
|
|
| BLAKE2b-256 |
0d5ca1abb2684b576efe10dcf6f159d89c10176de2e2a038527b951b7dd3d47d
|
Provenance
The following attestation bundles were made for ghlike-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on 686f6c61/ghlike-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghlike-0.1.0-py3-none-any.whl -
Subject digest:
db66663382cd6fe308ae0fcfaf10f209e965a1065186f11f1d7c5690c6f564f9 - Sigstore transparency entry: 2677028893
- Sigstore integration time:
-
Permalink:
686f6c61/ghlike-py@0f2542175ec48b98cd59c0dfbb00c015e3480d14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/686f6c61
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f2542175ec48b98cd59c0dfbb00c015e3480d14 -
Trigger Event:
workflow_dispatch
-
Statement type: