x-cli  by Infatoshi

X/Twitter API v2 CLI

Created 1 week ago

New!

282 stars

Top 92.7% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

A command-line interface (CLI) for interacting with the X/Twitter API v2, x-cli enables users to perform actions like posting tweets, searching content, managing bookmarks, and retrieving user information directly from their terminal. It is designed for power users, developers, and AI agents seeking programmatic or scriptable access to X/Twitter functionalities without needing a graphical interface. The primary benefit is streamlined, efficient management of X/Twitter activities via a familiar command-line environment.

How It Works

x-cli directly interfaces with the X/Twitter API v2, offering a comprehensive set of commands for various operations. It supports flexible authentication, seamlessly integrating with existing x-mcp configurations by symlinking credentials, or by using a dedicated ~/.config/x-cli/.env file. This direct API approach ensures access to the latest features and data available through Twitter's developer platform.

Quick Start & Requirements

  • Installation: Install from source using git clone https://github.com/INFATOSHI/x-cli.git, cd x-cli, then uv tool install .. Installation from PyPI is planned.
  • Prerequisites: Requires 5 X Developer Portal credentials: API Key, API Secret, Bearer Token, Access Token, and Access Token Secret. These should be configured in ~/.config/x-cli/.env or a local .env file.
  • Setup: Configuration involves obtaining API keys and setting up the .env file.
  • Documentation: Command reference and codebase map available in LLMs.md.

Highlighted Details

  • Supports posting tweets, replies, quotes, and deletions.
  • Enables searching tweets, retrieving user timelines, and managing bookmarks.
  • Offers commands for user lookups, follower/following lists, and engagement actions like liking and retweeting.
  • Provides multiple output formats: default colored panels, raw JSON (-j), TSV (-p), Markdown (-md), and verbose (-v) for detailed information.

Maintenance & Community

The repository is hosted on GitHub at Infatoshi/x-cli. Specific details regarding active maintenance, notable contributors, or community channels (like Discord/Slack) are not explicitly detailed in the README.

Licensing & Compatibility

The project is licensed under the MIT License. This permissive license generally allows for broad use, modification, and distribution, including within commercial and closed-source applications, with minimal restrictions beyond attribution.

Limitations & Caveats

Users may encounter standard API-related issues such as 403 errors (requiring re-authentication after permission changes), 401 Unauthorized errors (due to incorrect credentials), or 429 Rate Limited errors, which necessitate waiting for reset timestamps. Ensuring all five required environment variables are correctly populated is crucial for startup.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
3
Star History
284 stars in the last 11 days

Explore Similar Projects

Feedback? Help us improve.