Use when the user shares an x.com or twitter.com URL, asks to read/search tweets, check mentions or timelines, or perform tweet actions with the bird CLI.
Read tweets, search, and browse timelines directly via bird CLI using Bash only.
bird directly. Do not use browser tools or WebFetch.bird returns.tweet, reply, follow, unfollow, unbookmark) as requiring explicit user confirmation.Run this sequence before the first command in a user turn:
if command -v bird >/dev/null 2>&1; then
:
elif [ -x "$HOME/.local/bin/bird" ]; then
export PATH="$HOME/.local/bin:$PATH"
else
: "need-install"
fi
bird --version
bird check
bird whoami
bird check --plain || bird whoami --plain || true
for profile in "Default" "Profile 1" "Profile 2" "Profile 3"; do
bird --chrome-profile "$profile" check --plain >/tmp/bird-check.txt 2>&1 || true
if rg -q 'Ready to tweet|auth_token: .*|ct0: .*|source: Chrome profile' /tmp/bird-check.txt; then
mkdir -p "$HOME/.config/bird"
cat > "$HOME/.config/bird/config.json5" <<EOF
{
chromeProfile: "$profile",
cookieSource: ["chrome"],
}
EOF
bird check --plain
bird whoami --plain
break
fi
done
If Chrome profiles fail, also check whether the user has a custom browser profile path and retry with:
bird --chrome-profile-dir "<path-to-cookies-or-profile>" check --plain
The purpose of the fallback is:
~/.config/bird/config.json5 makes the fix apply across Codex, Claude Code, and other agent shells on the same machine.Auth-sensitive actions:
mentions, home, bookmarks, likes, news, user-tweets, follow, unfollow, tweet, reply, unbookmarkIf bird is missing:
bird isn't installed, offer to install it, and wait for yes/no.curl -L https://github.com/zaydiscold/bird/releases/download/v0.8.0/bird -o /tmp/bird \
&& chmod +x /tmp/bird \
&& mkdir -p "$HOME/.local/bin" \
&& mv /tmp/bird "$HOME/.local/bin/bird" \
&& export PATH="$HOME/.local/bin:$PATH"
If PATH still does not include ~/.local/bin, advise manual install from
https://github.com/zaydiscold/bird and stop.
If auth checks fail:
~/.config/bird/config.json5Normalize URLs before dispatch:
Accept only these hosts:
x.comtwitter.commobile.twitter.comConvert host to https://x.com.
Keep tweet/status path only; strip tracking params such as
utm_*, s, ref, ref_src, f, t, fbclid.
Reject non-Twitter URLs early with:
I can only process x.com or twitter.com links. Share a tweet URL, status ID, or a search/query request.
Handle multiple URLs sequentially when present.
bird read <id-or-url> by default.thread, conversation, replies chain, etc.), use bird thread <id-or-url>.bird read (or bird thread when explicitly threaded).mentions, home, home --following, bookmarks, likes, news, user-tweets, about, following, followers.bird search "query" -n <N>.N=12 for list-style results (search, home, mentions, threads).show more to fetch next chunk.Use JSON/plain output rules:
--plain for downstream analysis.See references for detailed command mapping:
references/search-operators.mdreferences/write-actions.mdreferences/troubleshooting.mdFor tweet, reply, follow, unfollow, and unbookmark:
Proceed with <command>?yes/y).unauthorized / 401: auth unavailable; run bird check and bird whoami, prefer Safari first, then probe Chrome fallback if Safari fails in the agent shell.rate limit: request limit reached; pause and retry after a short delay.not found: deleted tweet/account, stale thread, or malformed ID; ask for corrected input.private / protected: account or content visibility restricted; explain limitation and request required access.suspended / deleted user: target user no longer accessible; ask for an alternate target.malformed URL/ID: input is invalid; reject early and prompt for supported examples.Safari vs Chrome auth source mismatch: mismatch in cookie source; keep Safari as default when available, otherwise persist a working Chrome fallback.Safari cookie permission failure: Safari works in the user's interactive shell but fails in the agent shell due macOS cookie/keychain access; probe Chrome profiles, then persist a working ~/.config/bird/config.json5 fallback.network / DNS failure: connectivity issue; suggest checking network/DNS and retry.timeout / hanging command: transient service issue; stop and ask user to rerun after waiting.For detailed remediation by case, use:
references/troubleshooting.md