polish: cookie header string parsing + Cookie-Editor guide + server user path

Key improvements:
- twitter-cookies now accepts BOTH formats:
  1. Full cookie header string from Cookie-Editor export
  2. Two separate values (auth_token ct0)
  Automatically detects which format was pasted.

- New docs/cookie-export.md guide for server users
  Recommends Cookie-Editor Chrome extension (one-click export)
  Fallback: manual F12 → Network → Cookie header

- Install guide now has two clear paths:
  Path A (local): --from-browser chrome (one command, all cookies)
  Path B (server): Cookie-Editor extension export (30 sec per site)

- Better error messages with accepted format examples
This commit is contained in:
Panniantong
2026-02-24 07:02:44 +01:00
parent b264070a8d
commit 89b3eaf5da
3 changed files with 125 additions and 42 deletions
+56 -34
View File
@@ -12,56 +12,80 @@ Install Agent Eyes: https://raw.githubusercontent.com/Panniantong/agent-eyes/mai
## For AI Agents
Install Agent Eyes and set it up with minimal user effort.
Install Agent Eyes with minimal user effort. Goal: fewest questions, fewest steps.
### Step 1: Install and check
### Step 1: Install and detect
```bash
pip install git+https://github.com/Panniantong/agent-eyes.git || pip3 install git+https://github.com/Panniantong/agent-eyes.git
agent-eyes install --env=auto
```
### Step 2: One-click cookie import (LOCAL COMPUTERS ONLY)
Read the output. It tells you the detected environment (local/server) and what's already working.
If the environment was detected as **local**, offer to grab all cookies at once:
### Step 2: Set up cookies (the approach depends on environment)
> "I can automatically import your cookies from Chrome to unlock Twitter, XiaoHongShu, and Bilibili — all at once, one command. Want me to do that?
> (Make sure Chrome is closed first)"
#### Path A: Local computer (auto-detected)
If yes:
Offer one-click import:
> "I can grab your browser cookies automatically to unlock Twitter, XiaoHongShu, and Bilibili — all at once. Just close Chrome first, then say 'go'."
If user agrees:
```bash
pip install browser-cookie3
agent-eyes configure --from-browser chrome
pip install browser-cookie3 2>/dev/null; agent-eyes configure --from-browser chrome
```
This extracts cookies for ALL supported platforms in one shot. No F12, no manual copying.
If user uses another browser: replace `chrome` with `firefox`, `edge`, `brave`, or `opera`.
If user uses a different browser:
If it fails or user declines, fall through to Path B.
#### Path B: Server, or auto-import didn't work
Tell the user the easiest manual method:
> "I need cookies from your browser to unlock some platforms. Here's the fastest way (30 seconds per site):
>
> 1. Install the **Cookie-Editor** Chrome extension: https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
> 2. Go to the site (e.g. x.com) — make sure you're logged in
> 3. Click the Cookie-Editor icon → **Export** → **Header String**
> 4. Paste the result to me
>
> Which platforms do you use? I'll tell you which ones to export."
For each platform the user wants:
**Twitter/X** — export from https://x.com :
```bash
agent-eyes configure --from-browser firefox # or edge, brave, opera
agent-eyes configure twitter-cookies "PASTED_COOKIE_STRING"
```
(Accepts both: full cookie string OR just `auth_token ct0` as two values)
**XiaoHongShu** — export from https://www.xiaohongshu.com :
```bash
agent-eyes configure xhs-cookie "PASTED_COOKIE_STRING"
```
If the environment is **server** or the user declines, skip to Step 3.
**Bilibili** — export from https://www.bilibili.com :
(On local computers Bilibili already works without cookies. On servers it needs a proxy — see Step 4.)
### Step 3: Offer search upgrade
### Step 3: Set up search
> "Want to unlock web search? One free API key lets me search the entire web, Reddit, and Twitter.
> Go to https://exa.ai → sign up (free) → send me the API key.
> Or say 'skip'."
> "Want to unlock web search? One free API key lets me search the web, Reddit, and Twitter.
> Go to https://exa.ai → sign up (free, 1000 searches/month) → send me the key.
> Or say 'skip' — everything else still works."
If user provides key:
```bash
agent-eyes configure exa-key THE_KEY
```
### Step 4: Server-only — offer proxy
### Step 4: Server-only — proxy for Reddit/Bilibili
Only if auto-detected as server:
Only mention if environment was detected as server:
> "Reddit and Bilibili block server IPs. Reddit search still works free via Exa, but for full access you'd need a cheap proxy ($1/month).
> Get one at https://webshare.io if interested. Or skip — search still works!"
> "On servers, Reddit and Bilibili block direct access. Reddit *search* still works via Exa (free), but for reading full Reddit posts or using Bilibili, you'd need a residential proxy (~$1/month).
> Get one at https://webshare.io if you want. Or skip — not required."
If user provides proxy:
```bash
agent-eyes configure proxy http://user:pass@ip:port
```
@@ -72,24 +96,22 @@ agent-eyes configure proxy http://user:pass@ip:port
agent-eyes doctor
```
> "✅ All set! [list what's active]. Try asking me to search or read something!"
> "✅ All set! [list active channels]. Try: 'search Reddit for ...' or 'read this URL'"
**Users can always configure more later** by saying things like "set up Twitter for Agent Eyes" or "add my XiaoHongShu cookies".
Users can configure more channels anytime — just say "set up Twitter" or "add proxy".
---
## Manual configure (one channel at a time)
These commands are for manual setup or adding individual channels later:
## Quick Reference
| Command | What it does |
|---------|-------------|
| `agent-eyes configure --from-browser chrome` | Import ALL cookies at once |
| `agent-eyes configure --from-browser chrome` | Auto-import ALL cookies at once (local only) |
| `agent-eyes configure exa-key KEY` | Unlock search (web + Reddit + Twitter) |
| `agent-eyes configure twitter-cookies TOKEN CT0` | Twitter deep search (manual) |
| `agent-eyes configure xhs-cookie COOKIE` | XiaoHongShu (manual) |
| `agent-eyes configure youtube-cookies chrome` | Age-restricted YouTube |
| `agent-eyes configure proxy URL` | Reddit + Bilibili on servers |
| `agent-eyes doctor` | Show all channels and status |
| `agent-eyes configure twitter-cookies "COOKIE_STRING"` | Unlock Twitter (cookie string or auth_token + ct0) |
| `agent-eyes configure xhs-cookie "COOKIE_STRING"` | Unlock XiaoHongShu |
| `agent-eyes configure youtube-cookies chrome` | Unlock age-restricted YouTube |
| `agent-eyes configure proxy URL` | Unlock Reddit reader + Bilibili (server) |
| `agent-eyes doctor` | Show all channels and their status |
| `agent-eyes read URL` | Read any URL |
| `agent-eyes search "query"` | Search the web |