| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
twexapi-cli is a Node.js command-line client for TwexAPI Twitter/X endpoints. It helps developers and AI agents fetch Twitter/X data, manage API credentials, preview write actions, publish X Articles from Markdown, and automate common X workflows from the terminal.
twexapi-cli is designed to be easy for AI coding agents and workflow agents to use safely:
twexapi --app prod about elonmusk
twexapi --app prod users elonmusk samatwexapi --app prod search tweets "founder" "ai" --count 20
twexapi --app prod search users "openai"twexapi --app prod trending tweets --country "United States" --topic "Sports" --content "NFL" --count 50twexapi --app prod --profile founder --dry-run article publish-md ./article.md --title "Launch Notes"
twexapi --app prod --profile founder article publish-md ./article.md --title "Launch Notes" --cover-image "https://example.com/cover.jpg" --visibility Publictwexapi --app prod -X POST -d '["elonmusk","sama"]' /twitter/usersInstall globally from npm:
npm install -g twexapi-cli
twexapi --helpRequires Node.js 18 or newer.
Install from a GitHub skill installer:
npx skills add yeahjjyy/twexapi-cliInstall from ClawHub:
npx clawhub@latest install twexapi-cliInstall as a Claude Code marketplace:
/plugin marketplace add yeahjjyy/twexapi-cli
/plugin install twexapi-cli@twexapi-cli
For manual Claude Code installs, this repository also includes:
.claude/skills/twexapi-cli/
Then install the CLI:
npm install -g twexapi-cliIn skills-enabled environments:
Get your API key from the twexapi dashboard:
Save an app config and make a first request:
twexapi auth apps add --name prod --api-key "twitterx_..."
twexapi auth apps use prod
twexapi --app prod about elonmuskIf you are developing from this repository, use:
cd /Users/jiangyong/code/twexapi-cli
node ./bin/twexapi.js --helpIf you want a local executable command while developing from source:
npm link
twexapi --helpWhen a request is missing an API key, the CLI will include that URL in the error output.
Save an app config:
twexapi auth apps add --name prod --api-key "twitterx_..."
twexapi auth apps list
twexapi auth apps use prodSave a write profile:
twexapi auth profiles add --name founder --cookie "ct0=...; auth_token=..."
twexapi auth profiles use founderCreate a profile from auth_token via the documented cookie endpoint:
twexapi auth cookie --auth-token "your_auth_token" --save-as founderInspect config:
twexapi config show
twexapi config pathBy default config is stored in ~/.twexapi/config.json. For testing, you can isolate it:
twexapi --config-dir ./.twexapi-local config showQuery an endpoint directly:
twexapi /twitter/elonmusk/aboutSend a JSON body with a POST:
twexapi -X POST -d '["elonmusk","sama"]' /twitter/usersPreview a request without sending it:
twexapi --app prod --dry-run users elonmusk sama
twexapi --app prod --profile founder --dry-run tweet create --text "hello"
twexapi --app prod --profile founder --dry-run article publish-md ./article.md --title "Launch Notes"Read commands:
# Twitter/X User and Search
twexapi --app prod users elonmusk sama # Lookup user profiles
twexapi --app prod about elonmusk # Fetch detailed user info
twexapi --app prod search tweets "founder" "ai" # Search for tweets
twexapi --app prod search users "openai" # Search for users
twexapi --app prod followers elonmusk # List user followers
twexapi --app prod following elonmusk # List user following
# Twitter/X Lists
twexapi --app prod list search --query "ai" # Search for public lists
twexapi --app prod list members 123456789 # List members of a list
twexapi --app prod list subscribers 123456789 # List subscribers of a list
# Twitter/X Articles & DMs
twexapi --app prod article markdown 123 # Get x article as Markdown
twexapi --app prod article lookup 123 456 # Batch lookup x articles
twexapi --app prod dm history elonmusk # Show Direct Message history
twexapi --app prod dm send elonmusk --text "hi" # Send a DM to a user
# Twitter/X Profile & Timeline
twexapi --app prod timeline user elonmusk # Fetch user timeline page
twexapi --app prod profile update --name "Name" # Update your own profile
# Twitter/X Global Trending
twexapi --app prod trending tweets --country "United States"
twexapi --app prod trending tweets --country "United States" --topic "Sports" --content "NFL" --count 50
# Twitter/X Tweets
twexapi --app prod tweet lookup 123 --summary # Batch tweet lookup (id:bool)
twexapi --app prod tweet replies 123 # Get replies for a tweetWrite commands:
twexapi --app prod --profile founder tweet create --text "hello from cli"
twexapi --app prod --profile founder tweet create --text "hello with image" --media-url "https://example.com/a.jpg"
twexapi --app prod --profile founder tweet quote --text "worth reading" --quote-url "https://x.com/user/status/123"
twexapi --app prod --profile founder tweet like 1900000000000000000
twexapi --app prod --profile founder tweet unlike 1900000000000000000
twexapi --app prod --profile founder tweet bookmark 1900000000000000000
twexapi --app prod --profile founder tweet unbookmark 1900000000000000000
twexapi --app prod --profile founder tweet retweet 1900000000000000000
twexapi --app prod --profile founder tweet unretweet 1900000000000000000
twexapi --app prod --profile founder article publish-md ./article.md --title "Launch Notes"
twexapi --app prod --profile founder article publish-md ./article.md --title "Launch Notes" --cover-image "https://example.com/cover.jpg" --visibility Public
twexapi --app prod --profile founder list create --name "AI Builders" --description "Interesting builders" --private
twexapi --app prod --profile founder user follow someuser
twexapi --app prod --profile founder user unfollow someusertwexapi-cli is a Node.js command-line client for TwexAPI Twitter/X endpoints. It lets users call Twitter/X API workflows from the terminal, including user lookup, tweet search, global trending tweets, tweet actions, list actions, DM workflows, profile updates, and X Article publishing.
Yes. Read requests require a TwexAPI API key passed with --api-key, TWEXAPI_KEY, or a saved app config created with twexapi auth apps add.
Yes. Write actions such as tweeting, liking, following, updating a profile, sending DMs, creating lists, and publishing X Articles require a saved profile or explicit cookie/auth token. Use --dry-run first to preview the request.
Yes. Use twexapi article publish-md <file.md> --title <title>. The CLI creates a draft, optionally sets a cover image, sets the article title, uploads Markdown content, and publishes the article.
Yes. It exposes deterministic commands, JSON responses, dry-run previews, saved credential profiles, and skill/plugin metadata for Claude, Codex, and OpenClaw-style environments.
Yes. Use the raw path form, for example twexapi /twitter/elonmusk/about or twexapi -X POST -d '["elonmusk"]' /twitter/users.
bin/twexapi.js # thin executable entrypoint
src/index.js # main boot flow
src/parser.js # global option parsing
src/config.js # config load/save and auth profile helpers
src/request.js # HTTP execution and dry-run preview
src/commands.js # command routing and endpoint mapping
src/help.js # help text
src/constants.js # defaults and option metadata
src/utils.js # shared helpers
| Back | FazBrowse Home | New Git URL |