feat: support relay profile selection
CI / test (push) Successful in 10m2s

This commit is contained in:
2026-06-24 18:30:24 +09:00
parent 7a036e244d
commit 3f370cc4b6
24 changed files with 160 additions and 25 deletions
+7 -1
View File
@@ -134,7 +134,8 @@ By default, the command fetches from For You, News, Sports, and Entertainment ta
import { TwitterClient } from '@yuta/bird';
const client = new TwitterClient({
relayBaseUrl: process.env.TWITTER_RELAY_BASE_URL
relayBaseUrl: process.env.TWITTER_RELAY_BASE_URL,
profileName: process.env.BIRD_PROFILE_NAME
});
// Search for tweets
@@ -185,6 +186,7 @@ const sportsNews = await client.getNews(10, {
Global options:
- `--relay-base-url <url>`: twitter safe relay base URL (defaults to `TWITTER_RELAY_BASE_URL`).
- `--profile-name <name>`: twitter safe relay profile name (sent as `x-profile-name`).
- `--timeout <ms>`: abort requests after the given timeout (milliseconds).
- `--quote-depth <n>`: max quoted tweet depth in JSON output (default: 1; 0 disables).
- `--plain`: stable output (no emoji, no color).
@@ -203,6 +205,8 @@ Write operations:
- If GraphQL returns error `226` (“automated request”), `bird` falls back to the legacy `statuses/update.json` endpoint.
Configure the relay URL with `TWITTER_RELAY_BASE_URL` or `--relay-base-url`.
When your relay has multiple profiles, select one with `--profile-name`, `BIRD_PROFILE_NAME`, or `profileName`
in config; bird forwards it as the `x-profile-name` header.
## Config (JSON5)
@@ -216,6 +220,7 @@ Example `~/.config/bird/config.json5`:
```json5
{
relayBaseUrl: "http://localhost:6900",
profileName: "main",
timeoutMs: 20000,
quoteDepth: 1
}
@@ -223,6 +228,7 @@ Example `~/.config/bird/config.json5`:
Environment shortcuts:
- `TWITTER_RELAY_BASE_URL`
- `BIRD_PROFILE_NAME`
- `BIRD_TIMEOUT_MS`
- `BIRD_QUOTE_DEPTH`