← 返回
数据分析 Key 中文

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...
使用官方 API v2 向 X/Twitter 发推文、回复和引用。请使用此功能代替 bird 进行发布。消耗 API 配额,仅在明确指示时发帖...
0xmythril
数据分析 clawhub v1.0.0 1 版本 99911.8 Key: 需要
★ 0
Stars
📥 1,133
下载
💾 9
安装
1
版本
#latest

概述

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

  1. Install (pinned to release tag):
  2. npm install -g github:0xmythril/tweet-cli#v1.0.0
    
  3. Get API keys from https://developer.x.com/en/portal/dashboard (Free tier works)
  4. Configure credentials (file is created with restricted permissions):
  5. 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
    
  6. Verify: tweet-cli whoami

Security

  • Credentials: Stored in ~/.config/tweet-cli/.env (read by dotenv at runtime). Set chmod 600 to restrict access.
  • No postinstall scripts: The package has zero install scripts — verify via npm pack --dry-run or inspect package.json.
  • No telemetry or network calls except to the official X API (api.x.com) when you run a command.
  • 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 — twitter-api-v2 (official X API client), commander (CLI parsing), dotenv (env file loading). No transitive dependencies.

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 bird (not tweet-cli).
  • 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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 04:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,180
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,628
ai-intelligence

Review Skills on Clawdtm

0xmythril
审阅并评分Claude Code技能,查看人类与AI智能体的推荐。
★ 3 📥 1,937