From b9983b5ebb424b085ed5f8bece2348565a264220 Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 03:51:49 -0400 Subject: [PATCH 1/7] test(auth): make browser-path tests platform-independent Several browser cookie-path tests only passed on POSIX hosts: * They redirected `HOME` but Windows `ntpath.expanduser` reads `USERPROFILE`, so the fake profile tree was never found. * They branch on `sys.platform` to build the fixture, but tests that pin `sys.platform` to exercise POSIX branches cannot use it to decide where to build the tree; and `platform.system()` derives from the patched `sys.platform` so it is unreliable too. * Two assertions hard-coded POSIX separators ('.config/x/Default/Cookies'). Add a `_patch_home` helper (HOME + USERPROFILE, keyed off `os.name`) and pin the POSIX layout explicitly where a test is asserting POSIX behaviour. Compare paths with os.path.join instead of literal separators. No production code changes; this makes the existing suite green on Windows as well as Linux/macOS. --- tests/test_auth.py | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 8010c08..abe6cd7 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -10,6 +10,25 @@ from twitter_cli import auth +def _patch_home(monkeypatch, tmp_path) -> None: + """Point ``os.path.expanduser("~")`` at ``tmp_path`` on every platform. + + POSIX honours ``HOME``; Windows ``ntpath.expanduser`` instead reads + ``USERPROFILE`` (falling back to ``HOMEDRIVE``/``HOMEPATH``). Tests that + build a fake browser profile under ``tmp_path`` must set both. + + Note: several tests monkeypatch ``auth.sys.platform`` to exercise POSIX + branches, which mutates the real ``sys`` module. ``expanduser`` is still + resolved by the *running* path module, so the platform check here must not + consult ``sys.platform`` — and not ``platform.system()`` either, which + derives from ``sys.platform`` and would also report the patched value. + ``os.name`` is fixed at interpreter start and is immune to that patch. + """ + monkeypatch.setenv("HOME", str(tmp_path)) + if os.name == "nt": + monkeypatch.setenv("USERPROFILE", str(tmp_path)) + + def test_get_cookies_prefers_env(monkeypatch) -> None: monkeypatch.setattr(auth, "load_from_env", lambda: {"auth_token": "env-token", "ct0": "env-csrf"}) monkeypatch.setattr(auth, "extract_from_browser", lambda: pytest.fail("should not extract from browser")) @@ -192,13 +211,10 @@ def get(self, url, headers=None, timeout=5): def test_iter_chrome_cookie_files_default_first(monkeypatch, tmp_path) -> None: """Default profile should be yielded first, then Profile N sorted.""" - # Create the correct platform-specific directory structure - if sys.platform == "darwin": - chrome_dir = tmp_path / "Library" / "Application Support" / "Google" / "Chrome" - elif sys.platform == "win32": - chrome_dir = tmp_path / "Google" / "Chrome" / "User Data" - else: - chrome_dir = tmp_path / ".config" / "Google" / "Chrome" + # Pin the POSIX layout so this test is deterministic on every host + # (Windows would otherwise resolve a 'User Data' tree instead). + monkeypatch.setattr(auth.sys, "platform", "linux") + chrome_dir = tmp_path / ".config" / "Google" / "Chrome" (chrome_dir / "Default").mkdir(parents=True) (chrome_dir / "Default" / "Cookies").touch() @@ -208,9 +224,7 @@ def test_iter_chrome_cookie_files_default_first(monkeypatch, tmp_path) -> None: (chrome_dir / "Profile 1" / "Cookies").touch() monkeypatch.delenv("TWITTER_CHROME_PROFILE", raising=False) - monkeypatch.setenv("HOME", str(tmp_path)) - if sys.platform == "win32": - monkeypatch.setenv("LOCALAPPDATA", str(tmp_path)) + _patch_home(monkeypatch, tmp_path) paths = auth._iter_chrome_cookie_files("chrome") @@ -224,17 +238,15 @@ def test_iter_chrome_cookie_files_default_first(monkeypatch, tmp_path) -> None: def test_iter_chrome_cookie_files_env_override(monkeypatch, tmp_path) -> None: """TWITTER_CHROME_PROFILE should restrict to that single profile.""" - if sys.platform == "darwin": - chrome_dir = tmp_path / "Library" / "Application Support" / "Google" / "Chrome" - else: - chrome_dir = tmp_path / ".config" / "Google" / "Chrome" + monkeypatch.setattr(auth.sys, "platform", "linux") + chrome_dir = tmp_path / ".config" / "Google" / "Chrome" (chrome_dir / "Default").mkdir(parents=True) (chrome_dir / "Default" / "Cookies").touch() (chrome_dir / "Profile 5").mkdir() (chrome_dir / "Profile 5" / "Cookies").touch() - monkeypatch.setenv("HOME", str(tmp_path)) + _patch_home(monkeypatch, tmp_path) monkeypatch.setenv("TWITTER_CHROME_PROFILE", "Profile 5") paths = auth._iter_chrome_cookie_files("chrome") @@ -249,13 +261,13 @@ def test_iter_chrome_cookie_files_edge_linux_uses_microsoft_edge_path(monkeypatc (edge_dir / "Default").mkdir(parents=True) (edge_dir / "Default" / "Cookies").touch() - monkeypatch.setenv("HOME", str(tmp_path)) + _patch_home(monkeypatch, tmp_path) monkeypatch.delenv("TWITTER_CHROME_PROFILE", raising=False) paths = auth._iter_chrome_cookie_files("edge") assert len(paths) == 1 - assert paths[0].endswith(".config/microsoft-edge/Default/Cookies") + assert paths[0] == os.path.join(str(tmp_path), ".config", "microsoft-edge", "Default", "Cookies") def test_iter_chrome_cookie_files_edge_windows_uses_user_data(monkeypatch, tmp_path) -> None: From d581ce2f3f8aa74470ba97689011b5a7462bd825 Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 03:56:39 -0400 Subject: [PATCH 2/7] fix(security): write cache files owner-only The ClientTransaction cache stores the full x.com/home HTML, which embeds the session's live auth_token/ct0. It was written with a plain open(), so it inherited the process umask - typically 0644, i.e. readable by every other local user on the host. The index cache (~/.twitter-cli/last_results.json) holds tweet text the user read and had the same problem. Create both through a shared helper that passes 0o600 to os.open() on create (so the file is never briefly world-readable) and fchmods an existing file to narrow permissions left by an older build. Cache directories are tightened to 0700. The helper is best-effort by design: permission changes must never fail the command that triggered a cache write, and on Windows chmod only toggles the read-only bit. Tests assert 0600/0700 on POSIX and are skipped elsewhere, and a negative control confirms they fail against the previous implementation. --- tests/test_cache_permissions.py | 107 ++++++++++++++++++++++++++++++++ twitter_cli/cache.py | 47 +++++++++++++- twitter_cli/client.py | 12 +++- 3 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 tests/test_cache_permissions.py diff --git a/tests/test_cache_permissions.py b/tests/test_cache_permissions.py new file mode 100644 index 0000000..782e783 --- /dev/null +++ b/tests/test_cache_permissions.py @@ -0,0 +1,107 @@ +"""Owner-only permissions for cache artefacts. + +The ClientTransaction cache stores the full ``x.com/home`` HTML, which embeds the +session's live ``auth_token``/``ct0``; the index cache stores tweet text the user +has read. Both used to be written with the process umask default (typically +``0644``), so any other local user could read a session off disk. + +These assertions are POSIX-only: Windows has no POSIX permission bits and +``os.chmod`` there only toggles the read-only flag, so ``stat.S_IMODE`` returns +``0o666`` regardless. +""" + +from __future__ import annotations + +import json +import os +import stat + +import pytest + +from twitter_cli import cache + +posix_only = pytest.mark.skipif( + os.name != "posix", reason="POSIX permission bits are not enforced on this OS" +) + + +def _make_tweet(tweet_factory, tweet_id: str = "100"): + return tweet_factory(tweet_id=tweet_id, text="cache me") + + +@posix_only +def test_save_writes_owner_only(tmp_path, monkeypatch, tweet_factory) -> None: + cache_file = tmp_path / ".twitter-cli" / "last_results.json" + monkeypatch.setattr(cache, "_CACHE_DIR", cache_file.parent) + monkeypatch.setattr(cache, "_CACHE_FILE", cache_file) + + cache.save_tweet_cache([_make_tweet(tweet_factory)]) + + assert cache_file.exists() + assert stat.S_IMODE(cache_file.stat().st_mode) == 0o600 + assert stat.S_IMODE(cache_file.parent.stat().st_mode) == 0o700 + # Still valid JSON that round-trips. + assert json.loads(cache_file.read_text(encoding="utf-8"))["tweets"][0]["id"] == "100" + + +@posix_only +def test_save_tightens_preexisting_world_readable_file(tmp_path, monkeypatch, tweet_factory) -> None: + cache_file = tmp_path / ".twitter-cli" / "last_results.json" + cache_file.parent.mkdir(parents=True) + cache_file.write_text("{}", encoding="utf-8") + cache_file.chmod(0o644) # simulate a file left behind by an older build + assert stat.S_IMODE(cache_file.stat().st_mode) == 0o644 + + monkeypatch.setattr(cache, "_CACHE_DIR", cache_file.parent) + monkeypatch.setattr(cache, "_CACHE_FILE", cache_file) + + cache.save_tweet_cache([_make_tweet(tweet_factory)]) + + assert stat.S_IMODE(cache_file.stat().st_mode) == 0o600 + + +def test_save_never_raises_on_unwritable_dir(tmp_path, monkeypatch, tweet_factory) -> None: + """A cache write must never break the command that triggered it.""" + cache_file = tmp_path / "missing" / "last_results.json" + monkeypatch.setattr(cache, "_CACHE_DIR", cache_file.parent) + monkeypatch.setattr(cache, "_CACHE_FILE", cache_file) + # Parent creation will fail because we point at a file, not a directory. + blocker = tmp_path / "missing" + blocker.write_text("not a directory", encoding="utf-8") + + cache.save_tweet_cache([_make_tweet(tweet_factory)]) # must not raise + + assert not cache_file.exists() + + +def test_client_transaction_cache_is_owner_only(tmp_path, monkeypatch) -> None: + """The CT cache embeds auth_token/ct0 and must be created owner-only.""" + from twitter_cli.client import TwitterClient + + ct_cache = tmp_path / ".twitter-cli" / "transaction_cache.json" + monkeypatch.setattr( + TwitterClient, "_ct_cache_path", staticmethod(lambda: str(ct_cache)) + ) + + client = TwitterClient.__new__(TwitterClient) + client._save_ct_cache("home", "ondemand") + + assert ct_cache.exists() + payload = json.loads(ct_cache.read_text(encoding="utf-8")) + assert payload["home_html"] == "home" + if os.name == "posix": + assert stat.S_IMODE(ct_cache.stat().st_mode) == 0o600 + assert stat.S_IMODE(ct_cache.parent.stat().st_mode) == 0o700 + + +def test_open_owner_only_uses_restrictive_mode(tmp_path) -> None: + """The create mode itself is narrow, not just a post-hoc chmod.""" + target = tmp_path / "secret.json" + with cache._open_owner_only(target) as handle: + handle.write('{"ok": true}') + + assert target.read_text(encoding="utf-8") == '{"ok": true}' + if os.name == "posix": + assert stat.S_IMODE(target.stat().st_mode) == 0o600 + + diff --git a/twitter_cli/cache.py b/twitter_cli/cache.py index fb1cad5..f8a98e8 100644 --- a/twitter_cli/cache.py +++ b/twitter_cli/cache.py @@ -4,9 +4,10 @@ import json import logging +import os import time from pathlib import Path -from typing import List, Optional, Tuple +from typing import IO, List, Optional, Tuple from .models import Tweet @@ -16,22 +17,64 @@ _CACHE_FILE = _CACHE_DIR / "last_results.json" _TTL = 3600 # seconds +# Owner-only permissions for cache artefacts. +# +# The ClientTransaction cache stores the full x.com/home HTML, which embeds the +# live auth_token / ct0 for the session, and the index cache stores tweet text +# the user has read. Neither should be world- or group-readable on a host with +# other local users. +_OWNER_ONLY_FILE = 0o600 +_OWNER_ONLY_DIR = 0o700 + + +def _open_owner_only(path: Path) -> IO[str]: + """Open ``path`` for writing with owner-only permissions. + + Uses ``O_CREAT`` with an explicit mode so a newly created file is never + briefly world-readable (a plain ``open()`` would honour the umask first and + only narrow afterwards). An existing file with looser permissions is + tightened on every write. Permission changes are best-effort: on Windows + ``chmod`` only toggles the read-only bit, and a cache write must never fail + the command that triggered it. + """ + flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC | getattr(os, "O_BINARY", 0) + fd = os.open(str(path), flags, _OWNER_ONLY_FILE) + try: + # Not declared on every platform by typeshed; guarded on AttributeError. + os.fchmod(fd, _OWNER_ONLY_FILE) # type: ignore[attr-defined] + except (AttributeError, OSError): # pragma: no cover - platform dependent + try: + os.chmod(str(path), _OWNER_ONLY_FILE) + except OSError: + pass + return os.fdopen(fd, "w", encoding="utf-8") + def save_tweet_cache(tweets: List[Tweet]) -> None: """Persist tweet list so indices can be resolved by `show`.""" try: _CACHE_DIR.mkdir(parents=True, exist_ok=True) + _tighten_dir(_CACHE_DIR) entries = [ {"index": i + 1, "id": t.id, "author": t.author.screen_name, "text": t.text[:80]} for i, t in enumerate(tweets) if t.id ] payload = {"created_at": time.time(), "tweets": entries} - _CACHE_FILE.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") + with _open_owner_only(_CACHE_FILE) as f: + f.write(json.dumps(payload, ensure_ascii=False, indent=2)) except OSError as exc: logger.debug("Failed to write tweet cache: %s", exc) +def _tighten_dir(directory: Path) -> None: + """Best-effort owner-only permission on a cache directory.""" + try: + os.chmod(str(directory), _OWNER_ONLY_DIR) + except OSError: + pass + + def _load_cache() -> Optional[List[dict]]: """Load and validate the cache file; return tweet entries or None if stale/missing.""" try: diff --git a/twitter_cli/client.py b/twitter_cli/client.py index 0436c8e..0ef3004 100644 --- a/twitter_cli/client.py +++ b/twitter_cli/client.py @@ -11,6 +11,7 @@ import random import time import urllib.parse +from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, cast import bs4 @@ -18,6 +19,7 @@ from x_client_transaction import ClientTransaction from x_client_transaction.utils import generate_headers as _gen_ct_headers, get_ondemand_file_url +from .cache import _open_owner_only, _tighten_dir from .constants import ( BEARER_TOKEN, SEC_CH_UA_BITNESS, @@ -1066,17 +1068,23 @@ def _load_ct_cache(self): def _save_ct_cache(self, home_html, ondemand_text): # type: (str, str) -> None - """Save transaction data to cache file.""" + """Save transaction data to cache file. + + The written JSON embeds the full x.com/home HTML, which carries the + session's live auth_token/ct0, so the file and its directory are locked + to the owner (0600 / 0700) rather than the process umask default. + """ try: cache_path = self._ct_cache_path() cache_dir = os.path.dirname(cache_path) os.makedirs(cache_dir, exist_ok=True) + _tighten_dir(Path(cache_dir)) cache = { "home_html": home_html, "ondemand_text": ondemand_text, "created_at": time.time(), } - with open(cache_path, "w", encoding="utf-8") as f: + with _open_owner_only(Path(cache_path)) as f: json.dump(cache, f) logger.debug("Saved CT cache to %s", cache_path) except Exception as exc: From 4f68c8d2a41ce90b3ebb9ddf9eb0f85990f66543 Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 03:57:00 -0400 Subject: [PATCH 3/7] ci: bound job time and document the fork-approval gate Two things made PR status unreadable rather than wrong: * No job timeout, so a stalled install/test run inherited GitHub's 30-day ceiling (runs sat at 'failure 720h' and read as code failures). * First-time contributors hit 'action_required', where the workflow never starts and no checks are reported at all. Set a 20-minute job cap with per-step timeouts, enable uv caching, drop persisted credentials from checkout, add least-privilege permissions and pull-request concurrency cancellation, and document the approval setting maintainers can change. Also fixed the matrix to fail-fast: false so one Python version failing does not hide the others on this 3-version matrix. --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 201c1f2..dbf3c75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,23 +1,45 @@ name: CI +# Pull requests from first-time contributors need a maintainer to approve the +# workflow run ("action_required"), otherwise no checks are reported and the PR +# looks untested. Repository admins can switch this off under +# Settings -> Actions -> General -> "Fork pull request workflows from outside +# collaborators" (require approval for first-time contributors). + on: push: branches: ["**"] pull_request: workflow_call: +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: ["3.10", "3.11", "3.12"] + # A job with no timeout inherits GitHub's 30-day ceiling: a hung dependency + # install or a stalled test keeps the whole PR in "expected" state until + # then. Bound it so a stall fails fast and visibly instead. + timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Setup uv uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Setup Python uses: actions/setup-python@v5 @@ -26,12 +48,17 @@ jobs: - name: Install dependencies run: uv sync --extra dev + timeout-minutes: 10 + # Fail fast on the cheap static checks, then run the suite. - name: Lint run: uv run ruff check . + timeout-minutes: 5 - name: Type check run: uv run mypy twitter_cli + timeout-minutes: 5 - name: Test run: uv run pytest -q + timeout-minutes: 10 From 9c76302de0d7f56bd3915d10db130485b21af2b7 Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 04:05:58 -0400 Subject: [PATCH 4/7] fix(cache): resolve fchmod without a version-specific type ignore mypy 1.14 (the version this project pins) reports the direct os.fchmod call as an unused ignore, while newer mypy needs the ignore because fchmod is missing from some typeshed variants. Resolve it through getattr instead, so the code type-checks cleanly on both. --- twitter_cli/cache.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/twitter_cli/cache.py b/twitter_cli/cache.py index f8a98e8..3fc7694 100644 --- a/twitter_cli/cache.py +++ b/twitter_cli/cache.py @@ -40,13 +40,16 @@ def _open_owner_only(path: Path) -> IO[str]: flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC | getattr(os, "O_BINARY", 0) fd = os.open(str(path), flags, _OWNER_ONLY_FILE) try: - # Not declared on every platform by typeshed; guarded on AttributeError. - os.fchmod(fd, _OWNER_ONLY_FILE) # type: ignore[attr-defined] - except (AttributeError, OSError): # pragma: no cover - platform dependent - try: + # Resolved via getattr: fchmod is absent from typeshed on some platforms, + # so a direct call needs a version-dependent type: ignore, while being + # genuinely available at runtime on every POSIX host. + fchmod = getattr(os, "fchmod", None) + if fchmod is not None: + fchmod(fd, _OWNER_ONLY_FILE) + else: # pragma: no cover - non-POSIX os.chmod(str(path), _OWNER_ONLY_FILE) - except OSError: - pass + except OSError: # pragma: no cover - permission change is best-effort + pass return os.fdopen(fd, "w", encoding="utf-8") From f52139e13eedfd614541f9fbce62887dbcb387b1 Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 04:13:39 -0400 Subject: [PATCH 5/7] ci: move to Node 24 action majors Actions targeting Node 20 (checkout@v4, setup-python@v5, setup-uv@v6) now emit a deprecation warning on every run. Move to the current majors, which run on node24: checkout@v7, setup-python@v7, setup-uv@v10.3.3 (setup-uv publishes no floating v10 tag, so the release is pinned). --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbf3c75..c44e728 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,17 +32,18 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: persist-credentials: false - name: Setup uv - uses: astral-sh/setup-uv@v6 + # setup-uv publishes no floating v10 major tag, so pin the release. + uses: astral-sh/setup-uv@v10.3.3 with: enable-cache: true - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} From 22b0412e3c3b4db0bbec06c1a55037ac2011954c Mon Sep 17 00:00:00 2001 From: axsddlr Date: Sat, 31 Oct 2026 04:14:54 -0400 Subject: [PATCH 6/7] ci: pin the runner image ubuntu-latest migrates to Ubuntu 26 in Oct 2026 and is otherwise a moving target, so a green run today does not prove the next one. Pin ubuntu-24.04. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c44e728..dc7ec79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,9 @@ concurrency: jobs: test: - runs-on: ubuntu-latest + # Pin the runner image: "ubuntu-latest" is a moving target (it migrates to + # Ubuntu 26 in Oct 2026), which makes a failure hard to attribute. + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: From 3858f8d9d201fca8daeda1d0d4f3a3321f376b16 Mon Sep 17 00:00:00 2001 From: jackwener Date: Tue, 10 Mar 2026 11:42:44 +0800 Subject: [PATCH 7/7] ci: align Python support validation and badges (cherry picked from commit 4e5966b27ea00e9d9911f0f200d4ed6c286f31b0) --- .github/workflows/ci.yml | 4 +++- README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc7ec79..db697ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + # Lower bound follows requires-python (>=3.10) from upstream; the 3.13 + # entry is restored from the fork's earlier CI work and verified green. + python-version: ["3.10", "3.11", "3.12", "3.13"] # A job with no timeout inherits GitHub's 30-day ceiling: a hung dependency # install or a stalled test keeps the whole PR in "expected" state until # then. Bound it so a stall fails fast and visibly instead. diff --git a/README.md b/README.md index e033cd2..241a028 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/jackwener/twitter-cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jackwener/twitter-cli/actions/workflows/ci.yml) [![PyPI version](https://badge.fury.io/py/twitter-cli.svg)](https://pypi.org/project/twitter-cli/) -[![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue.svg)](https://pypi.org/project/twitter-cli/) +[![Python versions](https://img.shields.io/pypi/pyversions/twitter-cli.svg)](https://pypi.org/project/twitter-cli/) A terminal-first CLI for Twitter/X: read timelines, bookmarks, and user profiles without API keys.