Terminal toolkit for X/Twitter search, monitoring, sentiment, and reporting
Project description
PolyX
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:
- Official X API v2 via
X_BEARER_TOKEN - Cookie-based GraphQL fallback via
AUTH_TOKENandCT0
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_TOKENandTWITTER_CT0for GraphQL cookiesGROK_API_KEYfor xAIGEMINI_API_KEYfor 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
--jsonfor machine-readable pipelines--jsonlfor stream processing--csvfor spreadsheets--markdownfor 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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e62e4fee91e34e153660bd50c69fbc236ee9694e6300b14fa9632fe83a1611fc
|
|
| MD5 |
2e39a1f1a346d632df3e6d665ef2685c
|
|
| BLAKE2b-256 |
58b1921212a8cd16867754bc9e5001d008f4064095fbb89080e40660f462c00f
|
Provenance
The following attestation bundles were made for polyx_cli-0.1.0.tar.gz:
Publisher:
publish.yml on ElyzeSolutions/PolyX-CLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polyx_cli-0.1.0.tar.gz -
Subject digest:
e62e4fee91e34e153660bd50c69fbc236ee9694e6300b14fa9632fe83a1611fc - Sigstore transparency entry: 1188780367
- Sigstore integration time:
-
Permalink:
ElyzeSolutions/PolyX-CLI@60589ecabd085f25415a960afbcd3cbe3a66e741 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ElyzeSolutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60589ecabd085f25415a960afbcd3cbe3a66e741 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5197729075885c21bac369b2b5d17f94a169c84b1dcbef5e9cb4ce00de9e8e2d
|
|
| MD5 |
687ab94c6ed300e6f27a7893bac399ea
|
|
| BLAKE2b-256 |
ddf161d88f02fe82c9048f8359eeb6cfe045d4f5e934e13d6e6bb81436cc8eb7
|
Provenance
The following attestation bundles were made for polyx_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ElyzeSolutions/PolyX-CLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polyx_cli-0.1.0-py3-none-any.whl -
Subject digest:
5197729075885c21bac369b2b5d17f94a169c84b1dcbef5e9cb4ce00de9e8e2d - Sigstore transparency entry: 1188780382
- Sigstore integration time:
-
Permalink:
ElyzeSolutions/PolyX-CLI@60589ecabd085f25415a960afbcd3cbe3a66e741 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ElyzeSolutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60589ecabd085f25415a960afbcd3cbe3a66e741 -
Trigger Event:
push
-
Statement type: