Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

twitter-cli

Skill by public-clis

Use twitter-cli to read, post, reply, quote, like, retweet, follow and search on Twitter/X from an AI agent or terminal. It suits developers and agents that need to automate Twitter/X tasks through a command line tool.

  • Score 89
  • 3k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install twitter-cli

Built from the published package, never by AI.

git clone --depth 1 https://github.com/public-clis/twitter-cli /tmp/twitter-cli && mkdir -p ~/.claude/skills && cp -r /tmp/twitter-cli ~/.claude/skills/twitter-cli

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install twitter-cli in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

twitter-cli is a command line tool for Twitter/X, installed with uv or pipx and run with the twitter command. It covers reading the home timeline, following timelines, bookmarks, search results, user profiles, user posts and follower lists. It also handles write actions such as posting, replying, quoting, liking, retweeting, following and bookmarking. Output can be a rich table, YAML, JSON, or a compact format meant to save tokens for LLM context.

Authentication uses browser cookies that the tool extracts automatically from supported browsers, or auth_token and ct0 environment variables. The source notes that write operations need full browser cookies, since env vars alone may trigger error 226. The skill is written for AI agents, which are told to check authentication first and guide the user through setup. It suits agents and developers who want to automate Twitter/X tasks from a terminal.

Written from the project's SKILL.md and checked against it.

What it can do

  • Read timelinesReads the home feed, following timeline, bookmarks and list timelines.
  • Search tweetsSearches tweets by keyword with optional Latest sorting and a result limit.
  • User lookupsShows user profiles, user posts, likes, followers and following lists.
  • Post and replyPosts tweets, replies to tweets and creates quote-tweets, with optional images.
  • Engagement actionsLikes, retweets and bookmarks tweets, and can undo each of these actions.
  • Follow managementFollows and unfollows users by handle.
  • Structured outputReturns rich tables, YAML, JSON or compact output for LLM context.

What you need

  • Python 3.8 or newer
  • uv or pipx to install the tool
  • A logged-in x.com session in Arc, Chrome, Edge, Firefox or Brave, or auth_token and ct0 values

Try asking

  • Search Twitter for recent posts about AI agents and show the top 20.
  • Post a tweet with this photo and the text 'Launch day'.
  • Show me the latest posts from @elonmusk in compact format.

Good to know

  • Video and GIF animation upload is not supported. Images only.
  • No direct messages, notifications or poll creation.
  • Works with one account at a time.
  • Likes are private on X, so the likes command only works for your own account.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • .gitignore110 B
  • AGENTS.md2 KB
  • LICENSE11 KB
  • README.md29 KB
  • SCHEMA.md2 KB
Show all 9 files
  • SKILL.md14 KB
  • config.yaml597 B
  • pyproject.toml2 KB
  • uv.lock135 KB

Alternatives to twitter-cli

All alternatives →

Compare with setup-zoom-webhooks, baoyu-post-to-weibo or add-dial-number

twitter-cli: common questions

Why does posting fail with error 226?

The source says env vars with only auth_token and ct0 may trigger error 226 for write operations. Using browser cookie extraction is recommended instead.

What image formats can I post?

The source lists JPEG, PNG, GIF and WebP, with a 5 MB limit per image and up to 4 images per tweet.

Can I see another user's likes?

No. The source says Twitter/X made all likes private in June 2024, so the likes command only works for your own account.

How do I install twitter-cli?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is twitter-cli free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is twitter-cli safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to twitter-cli?

Similar skills: setup-zoom-webhooks, baoyu-post-to-weibo, add-dial-number, setup-zoom-websockets.

twitter-cli Install

Add to stack

Loading.