Skip to main content

Terminal toolkit for X/Twitter search, monitoring, sentiment, and reporting

Project description

PolyX

PolyX terminal interface showing search, monitoring, trends, sentiment, and report generation

X/Twitter intelligence from the terminal.

Search live conversations, monitor topics, score sentiment, inspect trends, and generate clean reports from one CLI.

search watch trends analyze report json markdown

PolyX is built for research, trading, monitoring, and agent workflows where signal matters more than browsing the web UI by hand.

Why use it

  • Search X quickly from the terminal with structured output.
  • Prefer the official X API v2 when you have a bearer token.
  • Fall back to a cookie-based GraphQL client when you need a non-API path.
  • Layer in Grok, Gemini, or OpenRouter for richer topic analysis.
  • Save reports, cache results, and keep an eye on API spend.

Install

The PyPI distribution name is polyx-cli. The executable stays polyx.

pip install polyx-cli

# With AI providers and richer terminal output
pip install "polyx-cli[ai,rich]"

From source:

git clone https://github.com/ElyzeSolutions/PolyX-CLI.git
cd PolyX
pip install -e ".[ai,rich]"

Authentication modes

PolyX supports two access paths:

  1. Official X API v2 via X_BEARER_TOKEN
  2. Cookie-based GraphQL fallback via AUTH_TOKEN and CT0

The GraphQL path is unofficial and can break when X changes internal endpoints. Use API v2 when you can.

Configuration

Use environment variables directly or copy .env.example to a local .env.

Variable Purpose
X_BEARER_TOKEN Official X API v2 bearer token
AUTH_TOKEN GraphQL auth_token cookie
CT0 GraphQL CSRF cookie
XAI_API_KEY xAI key for Grok
OPENROUTER_API_KEY OpenRouter key
GOOGLE_API_KEY Google AI key for Gemini
POLYX_DATA_DIR Base directory for reports, cache, and cost tracking
POLYX_CACHE_DIR Optional cache directory override
POLYX_DAILY_BUDGET Daily API budget in USD
POLYX_CACHE_TTL Cache TTL in seconds

Supported aliases:

  • TWITTER_AUTH_TOKEN and TWITTER_CT0 for GraphQL cookies
  • GROK_API_KEY for xAI
  • GEMINI_API_KEY for Gemini

Quick start

Check your setup:

polyx health

Search recent posts:

polyx search "bitcoin" --limit 25
polyx search "ai agents" --sentiment --json
polyx search "solana" --sort likes --pages 2

Watch a topic over time:

polyx watch "breaking news" --interval 1m
polyx watch "ethereum" --interval 5m --webhook https://hooks.example.com/polyx

Inspect trends:

polyx trends --location us
polyx trends --locations

Generate analysis and reports:

polyx analyze "stablecoins" --provider gemini
polyx report "AI agents" --pages 3 --sentiment --save

Output formats

PolyX works well for both humans and automation:

  • terminal output by default
  • --json for machine-readable pipelines
  • --jsonl for stream processing
  • --csv for spreadsheets
  • --markdown for reports and sharing

Docker

docker build -t polyx .
docker run --rm -e X_BEARER_TOKEN=your_token polyx search "bitcoin"

Development

uv sync --extra ai --extra rich --extra dev
uv run ruff check .
uv run pytest
uv build

GitHub Actions are included for CI and tag-based PyPI publishing.

License

MIT

Project details


Download files

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

Source Distribution

polyx_cli-0.1.0.tar.gz (151.2 kB view details)

Uploaded Source

Built Distribution

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

polyx_cli-0.1.0-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

Details for the file polyx_cli-0.1.0.tar.gz.

File metadata

  • Download URL: polyx_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 151.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polyx_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e62e4fee91e34e153660bd50c69fbc236ee9694e6300b14fa9632fe83a1611fc
MD5 2e39a1f1a346d632df3e6d665ef2685c
BLAKE2b-256 58b1921212a8cd16867754bc9e5001d008f4064095fbb89080e40660f462c00f

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyx_cli-0.1.0.tar.gz:

Publisher: publish.yml on ElyzeSolutions/PolyX-CLI

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

File details

Details for the file polyx_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: polyx_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for polyx_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5197729075885c21bac369b2b5d17f94a169c84b1dcbef5e9cb4ce00de9e8e2d
MD5 687ab94c6ed300e6f27a7893bac399ea
BLAKE2b-256 ddf161d88f02fe82c9048f8359eeb6cfe045d4f5e934e13d6e6bb81436cc8eb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyx_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ElyzeSolutions/PolyX-CLI

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page