Skills tweet-cli
Post tweets, replies, and quotes to X/Twitter using the official API v2. Use this instead of bird for posting. Uses API credits so only post when explicitly asked or scheduled.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/0xmythril/tweet-cli" ~/.claude/skills/openclaw-skills-tweet-cli && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/0xmythril/tweet-cli" ~/.openclaw/skills/openclaw-skills-tweet-cli && rm -rf "$T"
manifest:
skills/0xmythril/tweet-cli/SKILL.mdsource content
tweet-cli
Post to X/Twitter using the official API v2. This tool uses API credits (limited to 1,500 posts/month on the Free tier), so only use it when the user explicitly asks you to post, or during scheduled cron tasks. Do not speculatively draft and post tweets.
For reading tweets, searching, and browsing timelines, use
bird instead (no credit cost).
Setup
- Install (pinned to release tag):
npm install -g github:0xmythril/tweet-cli#v1.0.0
- Get API keys from https://developer.x.com/en/portal/dashboard (Free tier works)
- Configure credentials (file is created with restricted permissions):
mkdir -p ~/.config/tweet-cli touch ~/.config/tweet-cli/.env chmod 600 ~/.config/tweet-cli/.env cat > ~/.config/tweet-cli/.env << 'EOF' X_API_KEY=your_consumer_key X_API_SECRET=your_secret_key X_ACCESS_TOKEN=your_access_token X_ACCESS_TOKEN_SECRET=your_access_token_secret EOF
- Verify:
tweet-cli whoami
Security
- Credentials: Stored in
(read by~/.config/tweet-cli/.env
at runtime). Setdotenv
to restrict access.chmod 600 - No postinstall scripts: The package has zero install scripts — verify via
or inspectnpm pack --dry-run
.package.json - No telemetry or network calls except to the official X API (
) when you run a command.api.x.com - Pinned install: The install command pins to a specific release tag. Audit the source at https://github.com/0xmythril/tweet-cli before installing.
- Dependencies: Only 3 runtime deps —
(official X API client),twitter-api-v2
(CLI parsing),commander
(env file loading). No transitive dependencies.dotenv
Commands
Verify auth
tweet-cli whoami
Post a tweet
tweet-cli post "Your tweet text here"
Reply to a tweet
tweet-cli reply <tweet-id-or-url> "Your reply text" tweet-cli reply https://x.com/user/status/123456 "Your reply text"
Quote a tweet
tweet-cli quote <tweet-id-or-url> "Your commentary" tweet-cli quote https://x.com/user/status/123456 "Your commentary"
Delete a tweet
tweet-cli delete <tweet-id-or-url>
Important rules
- Do NOT post unless the user explicitly asks or a cron job triggers it. Each post uses API credits.
- Always confirm with the user before posting, replying, or quoting. Show them the text first.
- For reading tweets, searching, or viewing timelines, use
(not tweet-cli).bird - tweet-cli accepts both raw tweet IDs and full URLs (x.com or twitter.com).
- If you get a 402 CreditsDepleted error, inform the user their monthly credits are exhausted.