TypeScript-first Twitter/X toolkit with:
twitter-tsCLI for timeline/search/profile/bookmark/list workflows- importable package API for app code (
twitter-cli-tsroot export)
From GitHub:
npm install github:empotts/twitter-cli-tsor
pnpm add github:empotts/twitter-cli-tsimport {
createConfiguredClient,
feed,
searchTweets,
getUserProfile,
} from "twitter-cli-ts";
const client = createConfiguredClient();
const timeline = await feed(client, { type: "for-you", count: 20 });
const results = await searchTweets(client, { query: "typescript", product: "Latest" });
const user = await getUserProfile(client, "jack");twitter-ts feed --json
twitter-ts search "typescript" --type Latest --json
twitter-ts user jack --yaml
twitter-ts article <tweet-id> --markdownAuth priority:
TWITTER_COOKIE_STRINGTWITTER_AUTH_TOKEN+TWITTER_CT0TWITTER_COOKIE_FILE(JSON, raw Cookie header, or Netscape cookies export)
Fast path:
twitter-ts auth guide
twitter-ts auth import ./cookies.txt --write-env .env.twitter
set -a; source .env.twitter; set +a
twitter-ts auth statuspnpm install
pnpm -r typecheck
pnpm -r test
pnpm -r buildStructured command output follows SCHEMA.md.
Apache-2.0