Make cookie-file auth env-only for multi-account use
This commit is contained in:
13
README.md
13
README.md
@@ -174,22 +174,17 @@ twitter follow elonmusk --json
|
||||
twitter-cli uses this auth priority:
|
||||
|
||||
1. **Environment variables**: `TWITTER_AUTH_TOKEN` + `TWITTER_CT0`
|
||||
2. **Cookie file**: `TWITTER_COOKIE_FILE` or `config.yaml -> auth.cookieFile`
|
||||
2. **Cookie file**: `TWITTER_COOKIE_FILE`
|
||||
3. **Browser cookies** (recommended): auto-extract from Arc/Chrome/Edge/Firefox/Brave
|
||||
|
||||
If you already exported a Netscape-format `cookies.txt`, point the CLI at it:
|
||||
|
||||
```bash
|
||||
export TWITTER_COOKIE_FILE=/path/to/cookies.txt
|
||||
twitter whoami
|
||||
TWITTER_COOKIE_FILE=/path/to/account-a.cookies.txt twitter whoami
|
||||
TWITTER_COOKIE_FILE=/path/to/account-b.cookies.txt twitter whoami
|
||||
```
|
||||
|
||||
Or in `config.yaml`:
|
||||
|
||||
```yaml
|
||||
auth:
|
||||
cookieFile: /path/to/cookies.txt
|
||||
```
|
||||
This keeps the CLI multi-account friendly: no cookie path is pinned in config, so each command can target a different account cleanly.
|
||||
|
||||
Browser extraction is recommended — it forwards ALL Twitter cookies (not just `auth_token` + `ct0`) and aligns request headers with your local runtime, which is closer to normal browser traffic than minimal cookie auth.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user