pp-x-twitter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- GENERATED FILE — DO NOT EDIT. This file is a verbatim mirror of library/social-and-messaging/x-twitter/SKILL.md, regenerated post-merge by tools/generate-skills/. Hand-edits here are silently overwritten on the next regen. Edit the library/ source instead. See AGENTS.md "Generated artifacts: registry.json, cli-skills/". -->
<!-- 生成文件 — 请勿编辑。 此文件是library/social-and-messaging/x-twitter/SKILL.md的完全镜像, 由tools/generate-skills/在合并后重新生成。此处的手动编辑会在下次重新生成时被静默覆盖。请改为编辑library/中的源文件。 参见AGENTS.md中的“生成产物:registry.json, cli-skills/”。 -->

X (Twitter) — Printing Press CLI

X (Twitter) — Printing Press CLI

Prerequisites: Install the CLI

前提条件:安装CLI

This skill drives the
x-twitter-pp-cli
binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
  1. Install via the Printing Press installer:
    bash
    npx -y @mvanhorn/printing-press install x-twitter --cli-only
  2. Verify:
    x-twitter-pp-cli --version
  3. Ensure
    $GOPATH/bin
    (or
    $HOME/go/bin
    ) is on
    $PATH
    .
If the
npx
install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.3 or newer):
bash
go install github.com/mvanhorn/printing-press-library/library/social-and-messaging/x-twitter/cmd/x-twitter-pp-cli@latest
If
--version
reports "command not found" after install, the install step did not put the binary on
$PATH
. Do not proceed with skill commands until verification succeeds.
Combined CLI for multiple API services
此技能驱动
x-twitter-pp-cli
二进制文件。在调用此技能的任何命令之前,您必须验证CLI已安装。如果未安装,请先进行安装:
  1. 通过Printing Press安装程序安装:
    bash
    npx -y @mvanhorn/printing-press install x-twitter --cli-only
  2. 验证:
    x-twitter-pp-cli --version
  3. 确保
    $GOPATH/bin
    (或
    $HOME/go/bin
    )已添加到
    $PATH
    中。
如果
npx
安装失败(无Node环境、离线等),可回退到直接通过Go安装(需要Go 1.26.3或更高版本):
bash
go install github.com/mvanhorn/printing-press-library/library/social-and-messaging/x-twitter/cmd/x-twitter-pp-cli@latest
如果安装后
--version
提示“command not found”,说明安装步骤未将二进制文件添加到
$PATH
中。在验证成功前,请不要继续执行技能命令。
整合多API服务的CLI工具

HTTP Transport

HTTP传输

This CLI uses Chrome-compatible HTTP transport for browser-facing endpoints. It does not require a resident browser process for normal API calls.
此CLI使用兼容Chrome的HTTP传输来处理面向浏览器的端点。正常API调用不需要常驻浏览器进程。

Command Reference

命令参考

account-activity — Endpoints relating to retrieving, managing AAA subscriptions
  • x-twitter-pp-cli account-activity create-subscription
    — Creates an Account Activity subscription for the user and the given webhook.
  • x-twitter-pp-cli account-activity delete-subscription
    — Deletes an Account Activity subscription for the given webhook and user ID.
  • x-twitter-pp-cli account-activity get-subscription-count
    — Retrieves a count of currently active Account Activity subscriptions.
  • x-twitter-pp-cli account-activity get-subscriptions
    — Retrieves a list of all active subscriptions for a given webhook.
  • x-twitter-pp-cli account-activity validate-subscription
    — Checks a user’s Account Activity subscription for a given webhook.
activity — Manage activity
  • x-twitter-pp-cli activity create-subscription
    — Creates a subscription for an X activity event
  • x-twitter-pp-cli activity delete-subscription
    — Deletes a subscription for an X activity event
  • x-twitter-pp-cli activity delete-subscriptions-by-ids
    — Deletes multiple subscriptions for X activity events by their IDs
  • x-twitter-pp-cli activity get-subscriptions
    — Get a list of active subscriptions for XAA
  • x-twitter-pp-cli activity stream
    — Stream of X Activities
  • x-twitter-pp-cli activity update-subscription
    — Updates a subscription for an X activity event
articles — X Articles (long-form posts) authoring + media upload
  • x-twitter-pp-cli articles create_draft
    — POST /i/api/graphql/g1l5N8BxGewYuCy5USe_bQ/ArticleEntityDraftCreate
  • x-twitter-pp-cli articles delete
    — POST /i/api/graphql/e4lWqB6m2TA8Fn_j9L9xEA/ArticleEntityDelete
  • x-twitter-pp-cli articles list
    — GET /i/api/graphql/N1zzFzRPspT-sP9Q42n_bg/ArticleEntitiesSlice
  • x-twitter-pp-cli articles publish
    — POST /i/api/graphql/m4SHicYMoWO_qkLvjhDk7Q/ArticleEntityPublish
  • x-twitter-pp-cli articles update_content
    — POST /i/api/graphql/M7N2FrPrlOmu-YrVIBxFnQ/ArticleEntityUpdateContent
  • x-twitter-pp-cli articles update_cover_media
    — POST /i/api/graphql/Es8InPh7mEkK9PxclxFAVQ/ArticleEntityUpdateCoverMedia
  • x-twitter-pp-cli articles update_title
    — POST /i/api/graphql/x75E2ABzm8_mGTg1bz8hcA/ArticleEntityUpdateTitle
  • x-twitter-pp-cli articles upload_media
    — POST /i/media/upload.json
chat — Manage chat
  • x-twitter-pp-cli chat add-group-members
    — Adds one or more members to an existing encrypted Chat group conversation, rotating the conversation key.
  • x-twitter-pp-cli chat create-conversation
    — Creates a new encrypted Chat group conversation on behalf of the authenticated user.
  • x-twitter-pp-cli chat get-conversation
    — Retrieves messages and key change events for a specific Chat conversation with pagination support. For 1:1...
  • x-twitter-pp-cli chat get-conversations
    — Retrieves a list of Chat conversations for the authenticated user's inbox.
  • x-twitter-pp-cli chat initialize-conversation-keys
    — Initializes encryption keys for a Chat conversation. This is the first step before sending messages in a new 1:1...
  • x-twitter-pp-cli chat initialize-group
    — Initializes a new XChat group conversation and returns a unique conversation ID. This endpoint is the first step in...
  • x-twitter-pp-cli chat mark-conversation-read
    — Marks a specific Chat conversation as read on behalf of the authenticated user. For 1:1 conversations, provide the...
  • x-twitter-pp-cli chat media-download
    — Downloads encrypted media bytes from an XChat conversation. The response body contains raw binary bytes. For 1:1...
  • x-twitter-pp-cli chat media-upload-append
    — Appends media data to an XChat upload session.
  • x-twitter-pp-cli chat media-upload-finalize
    — Finalizes an XChat media upload session.
  • x-twitter-pp-cli chat media-upload-initialize
    — Initializes an XChat media upload session.
  • x-twitter-pp-cli chat send-message
    — Sends an encrypted message to a specific Chat conversation. For 1:1 conversations, provide the recipient's user ID;...
  • x-twitter-pp-cli chat send-typing-indicator
    — Sends a typing indicator to a specific Chat conversation on behalf of the authenticated user. For 1:1 conversations,...
communities — Manage communities
  • x-twitter-pp-cli communities get-by-id
    — Retrieves details of a specific Community by its ID.
  • x-twitter-pp-cli communities search
    — Retrieves a list of Communities matching the specified search query.
compliance — Endpoints related to keeping X data in your systems compliant
  • x-twitter-pp-cli compliance create-jobs
    — Creates a new Compliance Job for the specified job type.
  • x-twitter-pp-cli compliance get-jobs
    — Retrieves a list of Compliance Jobs filtered by job type and optional status.
  • x-twitter-pp-cli compliance get-jobs-by-id
    — Retrieves details of a specific Compliance Job by its ID.
connections — Endpoints related to streaming connections
  • x-twitter-pp-cli connections delete-all
    — Terminates all active streaming connections for the authenticated application.
  • x-twitter-pp-cli connections delete-by-endpoint
    — Terminates all streaming connections for a specific endpoint ID for the authenticated application.
  • x-twitter-pp-cli connections delete-by-uuids
    — Terminates multiple streaming connections by their UUIDs for the authenticated application.
  • x-twitter-pp-cli connections get-history
    — Returns active and historical streaming connections with disconnect reasons for the authenticated application.
dm-conversations — Manage dm conversations
  • x-twitter-pp-cli dm-conversations create-direct-messages-by-participant-id
    — Sends a new direct message to a specific participant by their ID.
  • x-twitter-pp-cli dm-conversations create-direct-messages-conversation
    — Initiates a new direct message conversation with specified participants.
  • x-twitter-pp-cli dm-conversations get-direct-messages-events-by-participant-id
    — Retrieves direct message events for a specific conversation.
  • x-twitter-pp-cli dm-conversations media-download
    — Downloads media attached to a legacy Direct Message. The requesting user must be a participant in the conversation...
dm-events — Manage dm events
  • x-twitter-pp-cli dm-events delete-direct-messages-events
    — Deletes a specific direct message event by its ID, if owned by the authenticated user.
  • x-twitter-pp-cli dm-events get-direct-messages-events
    — Retrieves a list of recent direct message events across all conversations.
  • x-twitter-pp-cli dm-events get-direct-messages-events-by-id
    — Retrieves details of a specific direct message event by its ID.
evaluate-note — Manage evaluate note
  • x-twitter-pp-cli evaluate-note
    — Endpoint to evaluate a community note.
insights — Manage insights
  • x-twitter-pp-cli insights get-historical
    — Retrieves historical engagement metrics for specified Posts within a defined time range.
  • x-twitter-pp-cli insights get-insights28-hr
    — Retrieves engagement metrics for specified Posts over the last 28 hours.
likes — Manage likes
  • x-twitter-pp-cli likes stream-compliance
    — Streams all compliance data related to Likes for Users.
  • x-twitter-pp-cli likes stream-firehose
    — Streams all public Likes in real-time.
  • x-twitter-pp-cli likes stream-sample10
    — Streams a 10% sample of public Likes in real-time.
lists — Endpoints related to retrieving, managing Lists
  • x-twitter-pp-cli lists create
    — Creates a new List for the authenticated user.
  • x-twitter-pp-cli lists delete
    — Deletes a specific List owned by the authenticated user by its ID.
  • x-twitter-pp-cli lists get-by-id
    — Retrieves details of a specific List by its ID.
  • x-twitter-pp-cli lists update
    — Updates the details of a specific List owned by the authenticated user by its ID.
media — Endpoints related to Media
  • x-twitter-pp-cli media append-upload
    — Appends data to a Media upload request.
  • x-twitter-pp-cli media create-metadata
    — Creates metadata for a Media file.
  • x-twitter-pp-cli media create-subtitles
    — Creates subtitles for a specific Media file.
  • x-twitter-pp-cli media delete-subtitles
    — Deletes subtitles for a specific Media file.
  • x-twitter-pp-cli media finalize-upload
    — Finalizes a Media upload request.
  • x-twitter-pp-cli media get-analytics
    — Retrieves analytics data for media.
  • x-twitter-pp-cli media get-by-key
    — Retrieves details of a specific Media file by its media key.
  • x-twitter-pp-cli media get-by-keys
    — Retrieves details of Media files by their media keys.
  • x-twitter-pp-cli media get-upload-status
    — Retrieves the status of a Media upload by its ID.
  • x-twitter-pp-cli media initialize-upload
    — Initializes a media upload.
  • x-twitter-pp-cli media upload
    — Uploads a media file for use in posts or other content.
news — Endpoint for retrieving news stories
  • x-twitter-pp-cli news get
    — Retrieves news story by its ID.
  • x-twitter-pp-cli news search
    — Retrieves a list of News stories matching the specified search query.
notes — Manage notes
  • x-twitter-pp-cli notes create-community
    — Creates a community note endpoint for LLM use case.
  • x-twitter-pp-cli notes delete-community
    — Deletes a community note.
  • x-twitter-pp-cli notes search-community-written
    — Returns all the community notes written by the user.
  • x-twitter-pp-cli notes search-eligible-posts
    — Returns all the posts that are eligible for community notes.
openapi-json — Manage openapi json
  • x-twitter-pp-cli openapi-json
    — Retrieves the full OpenAPI Specification in JSON format. (See...
spaces — Endpoints related to retrieving, managing Spaces
  • x-twitter-pp-cli spaces get-by-creator-ids
    — Retrieves details of Spaces created by specified User IDs.
  • x-twitter-pp-cli spaces get-by-id
    — Retrieves details of a specific space by its ID.
  • x-twitter-pp-cli spaces get-by-ids
    — Retrieves details of multiple Spaces by their IDs.
  • x-twitter-pp-cli spaces search
    — Retrieves a list of Spaces matching the specified search query.
trends — Manage trends
  • x-twitter-pp-cli trends <woeid>
    — Retrieves trending topics for a specific location identified by its WOEID.
tweets — Endpoints related to retrieving, searching, and modifying Tweets
  • x-twitter-pp-cli tweets create-posts
    — Creates a new Post for the authenticated user, or edits an existing Post when edit_options are provided. Supports...
  • x-twitter-pp-cli tweets create-webhooks-stream-link
    — Creates a link to deliver FilteredStream events to the given webhook.
  • x-twitter-pp-cli tweets delete-posts
    — Deletes a specific Post by its ID, if owned by the authenticated user.
  • x-twitter-pp-cli tweets delete-webhooks-stream-link
    — Deletes a link from FilteredStream events to the given webhook.
  • x-twitter-pp-cli tweets get-posts-analytics
    — Retrieves analytics data for specified Posts within a defined time range.
  • x-twitter-pp-cli tweets get-posts-by-id
    — Retrieves details of a specific Post by its ID.
  • x-twitter-pp-cli tweets get-posts-by-ids
    — Retrieves details of multiple Posts by their IDs.
  • x-twitter-pp-cli tweets get-posts-counts-recent
    — Retrieves the count of Posts from the last 7 days matching a search query.
  • x-twitter-pp-cli tweets get-webhooks-stream-links
    — Get a list of webhook links associated with a filtered stream ruleset.
  • x-twitter-pp-cli tweets search-posts-recent
    — Retrieves Posts from the last 7 days matching a search query.
  • x-twitter-pp-cli tweets stream-labels-compliance
    — Streams all labeling events applied to Posts.
  • x-twitter-pp-cli tweets stream-posts-compliance
    — Streams all compliance data related to Posts.
  • x-twitter-pp-cli tweets stream-posts-firehose
    — Streams all public Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-firehose-en
    — Streams all public English-language Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-firehose-ja
    — Streams all public Japanese-language Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-firehose-ko
    — Streams all public Korean-language Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-firehose-pt
    — Streams all public Portuguese-language Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-sample
    — Streams a 1% sample of public Posts in real-time.
  • x-twitter-pp-cli tweets stream-posts-sample10
    — Streams a 10% sample of public Posts in real-time.
usage — Manage usage
  • x-twitter-pp-cli usage
    — Retrieves usage statistics for Posts over a specified number of days.
users — Endpoints related to retrieving, managing relationships of Users
  • x-twitter-pp-cli users get-by-id
    — Retrieves details of a specific User by their ID.
  • x-twitter-pp-cli users get-by-ids
    — Retrieves details of multiple Users by their IDs.
  • x-twitter-pp-cli users get-by-username
    — Retrieves details of a specific User by their username.
  • x-twitter-pp-cli users get-by-usernames
    — Retrieves details of multiple Users by their usernames.
  • x-twitter-pp-cli users get-me
    — Retrieves details of the authenticated user.
  • x-twitter-pp-cli users get-public-keys
    — Returns the public keys and Juicebox configuration for the specified users.
  • x-twitter-pp-cli users get-reposts-of-me
    — Retrieves a list of Posts that repost content from the authenticated user.
  • x-twitter-pp-cli users get-trends-personalized-trends
    — Retrieves personalized trending topics for the authenticated user.
  • x-twitter-pp-cli users search
    — Retrieves a list of Users matching a search query.
  • x-twitter-pp-cli users stream-compliance
    — Streams all compliance data related to Users.
webhooks — Manage webhooks
  • x-twitter-pp-cli webhooks create
    — Creates a new webhook configuration.
  • x-twitter-pp-cli webhooks create-replay-job
    — Creates a replay job to retrieve events from up to the past 24 hours for all events delivered or attempted to be...
  • x-twitter-pp-cli webhooks delete
    — Deletes an existing webhook configuration.
  • x-twitter-pp-cli webhooks get
    — Get a list of webhook configs associated with a client app.
  • x-twitter-pp-cli webhooks validate
    — Triggers a CRC check for a given webhook.
account-activity — 与检索、管理AAA订阅相关的端点
  • x-twitter-pp-cli account-activity create-subscription
    — 为用户和指定webhook创建Account Activity订阅。
  • x-twitter-pp-cli account-activity delete-subscription
    — 删除指定webhook和用户ID对应的Account Activity订阅。
  • x-twitter-pp-cli account-activity get-subscription-count
    — 获取当前活跃的Account Activity订阅数量。
  • x-twitter-pp-cli account-activity get-subscriptions
    — 获取指定webhook下所有活跃订阅的列表。
  • x-twitter-pp-cli account-activity validate-subscription
    — 检查用户针对指定webhook的Account Activity订阅状态。
activity — 管理活动
  • x-twitter-pp-cli activity create-subscription
    — 为X活动事件创建订阅
  • x-twitter-pp-cli activity delete-subscription
    — 删除X活动事件的订阅
  • x-twitter-pp-cli activity delete-subscriptions-by-ids
    — 通过ID删除多个X活动事件的订阅
  • x-twitter-pp-cli activity get-subscriptions
    — 获取XAA的活跃订阅列表
  • x-twitter-pp-cli activity stream
    — X活动流
  • x-twitter-pp-cli activity update-subscription
    — 更新X活动事件的订阅
articles — X文章(长文帖子)创作 + 媒体上传
  • x-twitter-pp-cli articles create_draft
    — POST /i/api/graphql/g1l5N8BxGewYuCy5USe_bQ/ArticleEntityDraftCreate
  • x-twitter-pp-cli articles delete
    — POST /i/api/graphql/e4lWqB6m2TA8Fn_j9L9xEA/ArticleEntityDelete
  • x-twitter-pp-cli articles list
    — GET /i/api/graphql/N1zzFzRPspT-sP9Q42n_bg/ArticleEntitiesSlice
  • x-twitter-pp-cli articles publish
    — POST /i/api/graphql/m4SHicYMoWO_qkLvjhDk7Q/ArticleEntityPublish
  • x-twitter-pp-cli articles update_content
    — POST /i/api/graphql/M7N2FrPrlOmu-YrVIBxFnQ/ArticleEntityUpdateContent
  • x-twitter-pp-cli articles update_cover_media
    — POST /i/api/graphql/Es8InPh7mEkK9PxclxFAVQ/ArticleEntityUpdateCoverMedia
  • x-twitter-pp-cli articles update_title
    — POST /i/api/graphql/x75E2ABzm8_mGTg1bz8hcA/ArticleEntityUpdateTitle
  • x-twitter-pp-cli articles upload_media
    — POST /i/media/upload.json
chat — 管理聊天
  • x-twitter-pp-cli chat add-group-members
    — 将一个或多个成员添加到现有的加密Chat群组对话中,并轮换对话密钥。
  • x-twitter-pp-cli chat create-conversation
    — 代表已认证用户创建新的加密Chat群组对话。
  • x-twitter-pp-cli chat get-conversation
    — 检索特定Chat对话的消息和密钥变更事件,支持分页。对于一对一对话...
  • x-twitter-pp-cli chat get-conversations
    — 检索已认证用户收件箱中的Chat对话列表。
  • x-twitter-pp-cli chat initialize-conversation-keys
    — 为Chat对话初始化加密密钥。这是在新的一对一对话中发送消息之前的第一步...
  • x-twitter-pp-cli chat initialize-group
    — 初始化新的XChat群组对话并返回唯一的对话ID。此端点是...的第一步
  • x-twitter-pp-cli chat mark-conversation-read
    — 代表已认证用户将特定Chat对话标记为已读。对于一对一对话,请提供...
  • x-twitter-pp-cli chat media-download
    — 从XChat对话中下载加密媒体字节。响应主体包含原始二进制字节。对于一对一对话...
  • x-twitter-pp-cli chat media-upload-append
    — 将媒体数据附加到XChat上传会话中。
  • x-twitter-pp-cli chat media-upload-finalize
    — 完成XChat媒体上传会话。
  • x-twitter-pp-cli chat media-upload-initialize
    — 初始化XChat媒体上传会话。
  • x-twitter-pp-cli chat send-message
    — 向特定Chat对话发送加密消息。对于一对一对话,请提供收件人的用户ID;...
  • x-twitter-pp-cli chat send-typing-indicator
    — 代表已认证用户向特定Chat对话发送输入状态提示。对于一对一对话...
communities — 管理社区
  • x-twitter-pp-cli communities get-by-id
    — 通过ID检索特定社区的详细信息。
  • x-twitter-pp-cli communities search
    — 检索与指定搜索查询匹配的社区列表。
compliance — 与保持X数据合规相关的端点
  • x-twitter-pp-cli compliance create-jobs
    — 为指定作业类型创建新的合规作业。
  • x-twitter-pp-cli compliance get-jobs
    — 检索按作业类型和可选状态筛选的合规作业列表。
  • x-twitter-pp-cli compliance get-jobs-by-id
    — 通过ID检索特定合规作业的详细信息。
connections — 与流连接相关的端点
  • x-twitter-pp-cli connections delete-all
    — 终止已认证应用的所有活跃流连接。
  • x-twitter-pp-cli connections delete-by-endpoint
    — 终止已认证应用针对特定端点ID的所有流连接。
  • x-twitter-pp-cli connections delete-by-uuids
    — 通过UUID终止已认证应用的多个流连接。
  • x-twitter-pp-cli connections get-history
    — 返回已认证应用的活跃和历史流连接及其断开原因。
dm-conversations — 管理私信对话
  • x-twitter-pp-cli dm-conversations create-direct-messages-by-participant-id
    — 通过参与者ID向特定参与者发送新私信。
  • x-twitter-pp-cli dm-conversations create-direct-messages-conversation
    — 与指定参与者发起新的私信对话。
  • x-twitter-pp-cli dm-conversations get-direct-messages-events-by-participant-id
    — 检索特定对话的私信事件。
  • x-twitter-pp-cli dm-conversations media-download
    — 下载附加到旧版私信的媒体。请求用户必须是对话的参与者...
dm-events — 管理私信事件
  • x-twitter-pp-cli dm-events delete-direct-messages-events
    — 如果由已认证用户拥有,则通过ID删除特定私信事件。
  • x-twitter-pp-cli dm-events get-direct-messages-events
    — 检索所有对话中的近期私信事件列表。
  • x-twitter-pp-cli dm-events get-direct-messages-events-by-id
    — 通过ID检索特定私信事件的详细信息。
evaluate-note — 管理社区笔记评估
  • x-twitter-pp-cli evaluate-note
    — 评估社区笔记的端点。
insights — 管理洞察数据
  • x-twitter-pp-cli insights get-historical
    — 在指定时间范围内检索指定帖子的历史互动指标。
  • x-twitter-pp-cli insights get-insights28-hr
    — 检索指定帖子过去28小时的互动指标。
likes — 管理点赞
  • x-twitter-pp-cli likes stream-compliance
    — 流式传输与用户点赞相关的所有合规数据。
  • x-twitter-pp-cli likes stream-firehose
    — 实时流式传输所有公开点赞。
  • x-twitter-pp-cli likes stream-sample10
    — 实时流式传输10%的公开点赞样本。
lists — 与检索、管理列表相关的端点
  • x-twitter-pp-cli lists create
    — 为已认证用户创建新列表。
  • x-twitter-pp-cli lists delete
    — 通过ID删除已认证用户拥有的特定列表。
  • x-twitter-pp-cli lists get-by-id
    — 通过ID检索特定列表的详细信息。
  • x-twitter-pp-cli lists update
    — 通过ID更新已认证用户拥有的特定列表的详细信息。
media — 与媒体相关的端点
  • x-twitter-pp-cli media append-upload
    — 将数据附加到媒体上传请求中。
  • x-twitter-pp-cli media create-metadata
    — 为媒体文件创建元数据。
  • x-twitter-pp-cli media create-subtitles
    — 为特定媒体文件创建字幕。
  • x-twitter-pp-cli media delete-subtitles
    — 删除特定媒体文件的字幕。
  • x-twitter-pp-cli media finalize-upload
    — 完成媒体上传请求。
  • x-twitter-pp-cli media get-analytics
    — 检索媒体的分析数据。
  • x-twitter-pp-cli media get-by-key
    — 通过媒体密钥检索特定媒体文件的详细信息。
  • x-twitter-pp-cli media get-by-keys
    — 通过媒体密钥检索多个媒体文件的详细信息。
  • x-twitter-pp-cli media get-upload-status
    — 通过ID检索媒体上传的状态。
  • x-twitter-pp-cli media initialize-upload
    — 初始化媒体上传。
  • x-twitter-pp-cli media upload
    — 上传媒体文件以用于帖子或其他内容。
news — 检索新闻报道的端点
  • x-twitter-pp-cli news get
    — 通过ID检索新闻报道。
  • x-twitter-pp-cli news search
    — 检索与指定搜索查询匹配的新闻报道列表。
notes — 管理社区笔记
  • x-twitter-pp-cli notes create-community
    — 为LLM用例创建社区笔记端点。
  • x-twitter-pp-cli notes delete-community
    — 删除社区笔记。
  • x-twitter-pp-cli notes search-community-written
    — 返回用户撰写的所有社区笔记。
  • x-twitter-pp-cli notes search-eligible-posts
    — 返回所有符合社区笔记条件的帖子。
openapi-json — 管理OpenAPI JSON
  • x-twitter-pp-cli openapi-json
    — 检索JSON格式的完整OpenAPI规范。(参见...
spaces — 与检索、管理Spaces相关的端点
  • x-twitter-pp-cli spaces get-by-creator-ids
    — 检索指定用户ID创建的Spaces的详细信息。
  • x-twitter-pp-cli spaces get-by-id
    — 通过ID检索特定Space的详细信息。
  • x-twitter-pp-cli spaces get-by-ids
    — 通过ID检索多个Spaces的详细信息。
  • x-twitter-pp-cli spaces search
    — 检索与指定搜索查询匹配的Spaces列表。
trends — 管理趋势
  • x-twitter-pp-cli trends <woeid>
    — 通过WOEID检索特定位置的热门话题。
tweets — 与检索、搜索和修改推文相关的端点
  • x-twitter-pp-cli tweets create-posts
    — 为已认证用户创建新帖子,或在提供edit_options时编辑现有帖子。支持...
  • x-twitter-pp-cli tweets create-webhooks-stream-link
    — 创建链接以将FilteredStream事件传递到指定webhook。
  • x-twitter-pp-cli tweets delete-posts
    — 如果由已认证用户拥有,则通过ID删除特定帖子。
  • x-twitter-pp-cli tweets delete-webhooks-stream-link
    — 删除FilteredStream事件到指定webhook的链接。
  • x-twitter-pp-cli tweets get-posts-analytics
    — 在指定时间范围内检索指定帖子的分析数据。
  • x-twitter-pp-cli tweets get-posts-by-id
    — 通过ID检索特定帖子的详细信息。
  • x-twitter-pp-cli tweets get-posts-by-ids
    — 通过ID检索多个帖子的详细信息。
  • x-twitter-pp-cli tweets get-posts-counts-recent
    — 检索过去7天内与搜索查询匹配的帖子数量。
  • x-twitter-pp-cli tweets get-webhooks-stream-links
    — 获取与过滤流规则集关联的webhook链接列表。
  • x-twitter-pp-cli tweets search-posts-recent
    — 检索过去7天内与搜索查询匹配的帖子。
  • x-twitter-pp-cli tweets stream-labels-compliance
    — 流式传输应用于帖子的所有标记事件。
  • x-twitter-pp-cli tweets stream-posts-compliance
    — 流式传输与帖子相关的所有合规数据。
  • x-twitter-pp-cli tweets stream-posts-firehose
    — 实时流式传输所有公开帖子。
  • x-twitter-pp-cli tweets stream-posts-firehose-en
    — 实时流式传输所有公开英文帖子。
  • x-twitter-pp-cli tweets stream-posts-firehose-ja
    — 实时流式传输所有公开日文帖子。
  • x-twitter-pp-cli tweets stream-posts-firehose-ko
    — 实时流式传输所有公开韩文帖子。
  • x-twitter-pp-cli tweets stream-posts-firehose-pt
    — 实时流式传输所有公开葡萄牙文帖子。
  • x-twitter-pp-cli tweets stream-posts-sample
    — 实时流式传输1%的公开帖子样本。
  • x-twitter-pp-cli tweets stream-posts-sample10
    — 实时流式传输10%的公开帖子样本。
usage — 管理使用情况
  • x-twitter-pp-cli usage
    — 检索指定天数内的帖子使用统计数据。
users — 与检索、管理用户关系相关的端点
  • x-twitter-pp-cli users get-by-id
    — 通过ID检索特定用户的详细信息。
  • x-twitter-pp-cli users get-by-ids
    — 通过ID检索多个用户的详细信息。
  • x-twitter-pp-cli users get-by-username
    — 通过用户名检索特定用户的详细信息。
  • x-twitter-pp-cli users get-by-usernames
    — 通过用户名检索多个用户的详细信息。
  • x-twitter-pp-cli users get-me
    — 检索已认证用户的详细信息。
  • x-twitter-pp-cli users get-public-keys
    — 返回指定用户的公钥和Juicebox配置。
  • x-twitter-pp-cli users get-reposts-of-me
    — 检索转发已认证用户内容的帖子列表。
  • x-twitter-pp-cli users get-trends-personalized-trends
    — 检索已认证用户的个性化热门话题。
  • x-twitter-pp-cli users search
    — 检索与搜索查询匹配的用户列表。
  • x-twitter-pp-cli users stream-compliance
    — 流式传输与用户相关的所有合规数据。
webhooks — 管理webhooks
  • x-twitter-pp-cli webhooks create
    — 创建新的webhook配置。
  • x-twitter-pp-cli webhooks create-replay-job
    — 创建重放作业,以检索过去24小时内所有已交付或尝试交付的事件...
  • x-twitter-pp-cli webhooks delete
    — 删除现有的webhook配置。
  • x-twitter-pp-cli webhooks get
    — 获取与客户端应用关联的webhook配置列表。
  • x-twitter-pp-cli webhooks validate
    — 触发指定webhook的CRC检查。

Finding the right command

查找合适的命令

When you know what you want to do but not which command does it, ask the CLI directly:
bash
x-twitter-pp-cli which "<capability in your own words>"
which
resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code
0
means at least one match; exit code
2
means no confident match — fall back to
--help
or use a narrower query.
当您知道要执行的操作但不知道对应命令时,可以直接询问CLI:
bash
x-twitter-pp-cli which "<用您自己的话描述功能>"
which
会将自然语言功能查询解析为此CLI精选功能索引中最匹配的命令。退出码
0
表示至少有一个匹配项;退出码
2
表示没有确定的匹配项 — 请回退使用
--help
或使用更精确的查询。

Auth Setup

认证设置

Store your access token:
bash
x-twitter-pp-cli auth set-token YOUR_TOKEN_HERE
Or set
X_OAUTH2_USER_TOKEN
as an environment variable.
Run
x-twitter-pp-cli doctor
to verify setup.
存储您的访问令牌:
bash
x-twitter-pp-cli auth set-token YOUR_TOKEN_HERE
或者将
X_OAUTH2_USER_TOKEN
设置为环境变量。
运行
x-twitter-pp-cli doctor
以验证设置是否正确。

Agent Mode

Agent模式

Add
--agent
to any command. Expands to:
--json --compact --no-input --no-color --yes
.
  • Pipeable — JSON on stdout, errors on stderr
  • Filterable
    --select
    keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
    bash
    x-twitter-pp-cli articles list --agent --select id,name,status
  • Previewable
    --dry-run
    shows the request without sending
  • Offline-friendly — sync/search commands can use the local SQLite store when available
  • Non-interactive — never prompts, every input is a flag
  • Explicit retries — use
    --idempotent
    only when an already-existing create should count as success, and
    --ignore-missing
    only when a missing delete target should count as success
在任何命令后添加
--agent
参数。等效于:
--json --compact --no-input --no-color --yes
  • 可管道传输 — 标准输出为JSON,错误输出到标准错误
  • 可过滤
    --select
    保留字段子集。点路径可深入嵌套结构;数组会遍历每个元素。对于冗长的API,这是保持上下文精简的关键:
    bash
    x-twitter-pp-cli articles list --agent --select id,name,status
  • 可预览
    --dry-run
    显示请求但不发送
  • 离线友好 — 同步/搜索命令在可用时可使用本地SQLite存储
  • 非交互式 — 从不提示,所有输入均为标志参数
  • 显式重试 — 仅当已存在的创建操作应视为成功时使用
    --idempotent
    ,仅当缺失的删除目标应视为成功时使用
    --ignore-missing

Response envelope

响应包

Commands that read from the local store or the API wrap output in a provenance envelope:
json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}
Parse
.results
for data and
.meta.source
to know whether it's live or local. A human-readable
N results (live)
summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
从本地存储或API读取数据的命令会将输出包装在来源包中:
json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}
解析
.results
获取数据,
.meta.source
可了解数据是实时的还是本地的。仅当标准输出为终端时,才会向标准错误打印人类可读的
N results (live)
摘要 — 管道/Agent消费者会在标准输出获得纯JSON。

Agent Feedback

Agent反馈

When you (or the agent) notice something off about this CLI, record it:
x-twitter-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
x-twitter-pp-cli feedback --stdin < notes.txt
x-twitter-pp-cli feedback list --json --limit 10
Entries are stored locally at
~/.x-twitter-pp-cli/feedback.jsonl
. They are never POSTed unless
X_FEEDBACK_ENDPOINT
is set AND either
--send
is passed or
X_FEEDBACK_AUTO_SEND=true
. Default behavior is local-only.
Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
当您(或Agent)发现此CLI存在问题时,记录反馈:
x-twitter-pp-cli feedback "--since标志是包含性的,但文档说是排他性的"
x-twitter-pp-cli feedback --stdin < notes.txt
x-twitter-pp-cli feedback list --json --limit 10
反馈条目存储在本地
~/.x-twitter-pp-cli/feedback.jsonl
中。仅当设置了
X_FEEDBACK_ENDPOINT
且传递了
--send
X_FEEDBACK_AUTO_SEND=true
时,才会POST反馈。默认行为仅存储在本地。
写下让您感到意外的内容,而不是错误报告。简短、具体、单行:这才是有价值的部分。

Output Delivery

输出交付

Every command accepts
--deliver <sink>
. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
SinkEffect
stdout
Default; write to stdout only
file:<path>
Atomically write output to
<path>
(tmp + rename)
webhook:<url>
POST the output body to the URL (
application/json
or
application/x-ndjson
when
--compact
)
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
每个命令都支持
--deliver <sink>
参数。输出会发送到指定的接收器,同时(或替代)输出到标准输出,因此Agent无需手动管道即可路由命令结果。支持三种接收器:
接收器效果
stdout
默认;仅写入标准输出
file:<path>
原子性地将输出写入
<path>
(先写入临时文件再重命名)
webhook:<url>
将输出主体POST到指定URL(
application/json
格式,使用
--compact
时为
application/x-ndjson
格式)
未知的协议会被拒绝,并返回结构化错误,列出支持的协议集。Webhook失败会返回非零退出码,并在标准错误中记录URL和HTTP状态码。

Named Profiles

命名配置文件

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
x-twitter-pp-cli profile save briefing --json
x-twitter-pp-cli --profile briefing articles list
x-twitter-pp-cli profile list --json
x-twitter-pp-cli profile show briefing
x-twitter-pp-cli profile delete briefing --yes
Explicit flags always win over profile values; profile values win over defaults.
agent-context
lists all available profiles under
available_profiles
so introspecting agents discover them at runtime.
配置文件是一组保存的标志值,可在多次调用中复用。当调度Agent每次运行都使用相同配置调用同一命令时,可使用此功能 — 即HeyGen的“Beacon”模式。
x-twitter-pp-cli profile save briefing --json
x-twitter-pp-cli --profile briefing articles list
x-twitter-pp-cli profile list --json
x-twitter-pp-cli profile show briefing
x-twitter-pp-cli profile delete briefing --yes
显式标志始终优先于配置文件值;配置文件值优先于默认值。
agent-context
会在
available_profiles
下列出所有可用配置文件,以便内省Agent在运行时发现它们。

Async Jobs

异步作业

For endpoints that submit long-running work, the generator detects the submit-then-poll pattern (a
job_id
/
task_id
/
operation_id
field in the response plus a sibling status endpoint) and wires up three extra flags on the submitting command:
FlagPurpose
--wait
Block until the job reaches a terminal status instead of returning the job ID immediately
--wait-timeout
Maximum wait duration (default 10m, 0 means no timeout)
--wait-interval
Initial poll interval (default 2s; grows with exponential backoff up to 30s)
Use async submission without
--wait
when you want to fire-and-forget; use
--wait
when you want one command to return the finished artifact.
对于提交长时间运行任务的端点,生成器会检测提交-轮询模式(响应中包含
job_id
/
task_id
/
operation_id
字段,且有对应的状态端点),并在提交命令上添加三个额外标志:
标志用途
--wait
阻塞直到作业进入终端状态,而不是立即返回作业ID
--wait-timeout
最大等待时长(默认10分钟,0表示无超时)
--wait-interval
初始轮询间隔(默认2秒;指数退避增长至最多30秒)
当您想触发即忘时,使用不带
--wait
的异步提交;当您希望一个命令返回完成的产物时,使用
--wait

Exit Codes

退出码

CodeMeaning
0Success
2Usage error (wrong arguments)
3Resource not found
4Authentication required
5API error (upstream issue)
7Rate limited (wait and retry)
10Config error
代码含义
0成功
2使用错误(参数错误)
3资源未找到
4需要认证
5API错误(上游问题)
7速率限制(等待后重试)
10配置错误

Argument Parsing

参数解析

Parse
$ARGUMENTS
:
  1. Empty,
    help
    , or
    --help
    → show
    x-twitter-pp-cli --help
    output
  2. Starts with
    install
    → ends with
    mcp
    → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with
    --agent
    )
解析
$ARGUMENTS
  1. 为空、
    help
    --help
    → 显示
    x-twitter-pp-cli --help
    输出
  2. install
    开头
    → 以
    mcp
    结尾 → MCP安装;否则 → 参见上方的前提条件
  3. 其他情况 → 直接使用(以
    --agent
    标志执行CLI命令)

MCP Server Installation

MCP服务器安装

  1. Install the MCP server:
    bash
    go install github.com/mvanhorn/printing-press-library/library/social-and-messaging/x-twitter/cmd/x-twitter-pp-mcp@latest
  2. Register with Claude Code:
    bash
    claude mcp add x-twitter-pp-mcp -- x-twitter-pp-mcp
  3. Verify:
    claude mcp list
  1. 安装MCP服务器:
    bash
    go install github.com/mvanhorn/printing-press-library/library/social-and-messaging/x-twitter/cmd/x-twitter-pp-mcp@latest
  2. 注册到Claude Code:
    bash
    claude mcp add x-twitter-pp-mcp -- x-twitter-pp-mcp
  3. 验证:
    claude mcp list

Direct Use

直接使用

  1. Check if installed:
    which x-twitter-pp-cli
    If not found, offer to install (see Prerequisites at the top of this skill).
  2. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  3. Execute with the
    --agent
    flag:
    bash
    x-twitter-pp-cli <command> [subcommand] [args] --agent
  4. If ambiguous, drill into subcommand help:
    x-twitter-pp-cli <command> --help
    .

  1. 检查是否已安装:
    which x-twitter-pp-cli
    如果未找到,提供安装选项(参见顶部的前提条件)。
  2. 将用户查询与上述独特功能和命令参考中最匹配的命令匹配。
  3. 使用
    --agent
    标志执行:
    bash
    x-twitter-pp-cli <command> [subcommand] [args] --agent
  4. 如果存在歧义,查看子命令帮助:
    x-twitter-pp-cli <command> --help

Hand-written notes (survive regen with
printing-press regen-merge
)

手写笔记(通过
printing-press regen-merge
可在重新生成后保留)

Auth model — two sources

认证模型 — 两个来源

The X surface is split across two auth sources. The CLI selects per-host automatically.
Source A — OAuth 2.0 PKCE. Used for
api.x.com
v2 endpoints (tweets, users, lists, spaces, bookmarks, likes, etc.). Standard CLI flow:
bash
x-twitter-pp-cli auth login        # opens browser, captures token
export X_OAUTH2_USER_TOKEN=<token>   # or set in config
x-twitter-pp-cli doctor            # verifies
Source B — Browser session cookies. Used for
x.com
Articles GraphQL endpoints and
upload.x.com
media upload. X's Articles editor is browser-only; OAuth 2.0 does NOT authenticate it. One-time capture:
  1. In Chrome, open DevTools on
    x.com
    while logged in.
  2. Application → Cookies → x.com → copy
    auth_token
    and
    ct0
    values.
  3. Network → reload → click any
    /i/api/graphql/...
    request → Request Headers → copy the
    Authorization: Bearer ...
    value (this is the web app's hardcoded bearer, NOT a user OAuth token).
  4. Write to
    ~/.config/x-twitter-pp-cli/cookies.json
    :
    json
    {
      "auth_token": "<paste>",
      "ct0":        "<paste>",
      "web_bearer": "<paste, without the 'Bearer ' prefix>",
      "captured_at": "2026-05-08T22:00:00Z"
    }
  5. chmod 600 ~/.config/x-twitter-pp-cli/cookies.json
    .
When X invalidates the session (logout, security events, ~weeks of inactivity),
articles *
commands return 401 — repeat the capture.
Note: Chrome's "Save all as HAR with content" SILENTLY redacts cookies and the Authorization header. Do not try to extract them from a HAR — they will be missing. Use the DevTools Application/Network tabs above.
X的接口分为两个认证来源。CLI会自动按主机选择。
来源A — OAuth 2.0 PKCE。用于
api.x.com
v2端点(推文、用户、列表、Spaces、书签、点赞等)。标准CLI流程:
bash
x-twitter-pp-cli auth login        # 打开浏览器,捕获令牌
export X_OAUTH2_USER_TOKEN=<token>   # 或在配置中设置
x-twitter-pp-cli doctor            # 验证
来源B — 浏览器会话Cookie。用于
x.com
文章GraphQL端点和
upload.x.com
媒体上传。X的文章编辑器仅支持浏览器;OAuth 2.0无法对其进行认证。需一次性捕获:
  1. 在Chrome中,打开
    x.com
    并登录,打开开发者工具。
  2. Application → Cookies → x.com → 复制
    auth_token
    ct0
    的值。
  3. Network → 重新加载 → 点击任何
    /i/api/graphql/...
    请求 → Request Headers → 复制
    Authorization: Bearer ...
    的值(这是Web应用的硬编码Bearer令牌,不是用户OAuth令牌)。
  4. 将内容写入
    ~/.config/x-twitter-pp-cli/cookies.json
    json
    {
      "auth_token": "<粘贴>",
      "ct0":        "<粘贴>",
      "web_bearer": "<粘贴,不带'Bearer '前缀>",
      "captured_at": "2026-05-08T22:00:00Z"
    }
  5. chmod 600 ~/.config/x-twitter-pp-cli/cookies.json
当X使会话失效(登出、安全事件、约数周未活动)时,
articles *
命令会返回401 — 重复捕获步骤。
注意:Chrome的“保存所有内容为HAR”会静默删除Cookie和Authorization头。不要尝试从HAR中提取它们 — 它们会丢失。请使用上述开发者工具的Application/Network标签。

Articles GraphQL operation hashes — runtime config

文章GraphQL操作哈希 — 运行时配置

X Articles uses GraphQL with rotating operation hashes in the URL path (e.g.
/i/api/graphql/M7N2FrPrlOmu-YrVIBxFnQ/ArticleEntityUpdateContent
). The hash rotates when X redeploys their web app.
Hashes are loaded at runtime from
~/.config/x-twitter-pp-cli/article-ops.json
. A default capture from generation time (2026-05-08) is built into the binary as fallback. When
articles *
commands return 404 with "no such operation," refresh:
  1. Re-sniff the Articles editor with the printing-press tool, OR
  2. Capture a HAR via DevTools Network (any Articles operation), then:
    bash
    python3 -c "
    import json, re
    from sys import argv
    with open(argv[1]) as f: h = json.load(f)
    ops = {}
    for e in h['log']['entries']:
        g = re.search(r'/i/api/graphql/([A-Za-z0-9_-]+)/(Article[A-Za-z0-9_]+)', e['request']['url'])
        if g: ops[g.group(2)] = g.group(1)
    import os, datetime
    path = os.path.expanduser('~/.config/x-twitter-pp-cli/article-ops.json')
    with open(path, 'w') as f: json.dump({'operations': ops, 'captured_at': datetime.datetime.now().isoformat()}, f, indent=2)
    print(f'wrote {len(ops)} ops to {path}')
    " /path/to/your.har
X文章使用GraphQL,URL路径中包含轮换的操作哈希(例如
/i/api/graphql/M7N2FrPrlOmu-YrVIBxFnQ/ArticleEntityUpdateContent
)。当X重新部署其Web应用时,哈希会轮换。
哈希在运行时从
~/.config/x-twitter-pp-cli/article-ops.json
加载。生成时(2026-05-08)的默认捕获内容内置在二进制文件中作为回退。当
articles *
命令返回404并提示“no such operation”时,刷新哈希:
  1. 使用printing-press工具重新嗅探文章编辑器,或者
  2. 通过开发者工具Network捕获HAR(任何文章操作),然后执行:
    bash
    python3 -c "
    import json, re
    from sys import argv
    with open(argv[1]) as f: h = json.load(f)
    ops = {}
    for e in h['log']['entries']:
        g = re.search(r'/i/api/graphql/([A-Za-z0-9_-]+)/(Article[A-Za-z0-9_]+)', e['request']['url'])
        if g: ops[g.group(2)] = g.group(1)
    import os, datetime
    path = os.path.expanduser('~/.config/x-twitter-pp-cli/article-ops.json')
    with open(path, 'w') as f: json.dump({'operations': ops, 'captured_at': datetime.datetime.now().isoformat()}, f, indent=2)
    print(f'wrote {len(ops)} ops to {path}')
    " /path/to/your.har

Hand-written compound commands

手写复合命令

These are NOT auto-generated; they wrap multiple endpoints into single agent-friendly calls.
x-twitter-pp-cli thread compose <markdown-file>
[--post]
Splits a markdown document into a numbered tweet thread (≤280 chars per tweet, atom-aware: paragraphs, list items, code fences are atoms; never splits inside a code fence). The "(N/M)" suffix length is reserved BEFORE packing so final tweets stay within the limit. Default behavior is dry-run (preview);
--post
is gated and not yet wired.
bash
x-twitter-pp-cli thread compose draft.md         # dry-run preview
x-twitter-pp-cli thread compose draft.md --post  # (not yet wired — preview only)
x-twitter-pp-cli articles-publish-md <markdown-file>
[--post]
Parses YAML frontmatter (
title
,
cover
,
tags
,
summary
) and converts the markdown body to Draft.js
content_state
JSON — the format the X Articles editor server-side expects.
Supported in v1: cover image from frontmatter (
cover: ./cover.png
), body image lines (
![alt](./body.png)
), paragraph, header-one (
#
), header-two (
##
), unordered-list-item (
-
/
*
), ordered-list-item (
1.
), blockquote (
>
), fenced code blocks, inline
**bold**
and
*italic*
.
bash
undefined
这些命令不是自动生成的;它们将多个端点包装为单个Agent友好的调用。
x-twitter-pp-cli thread compose <markdown-file>
[--post]
将Markdown文档拆分为带编号的推文线程(每条推文≤280字符,支持原子识别:段落、列表项、代码块为原子;绝不会在代码块内拆分)。在打包前会预留“(N/M)”后缀的长度,确保最终推文符合限制。默认行为是试运行(预览);
--post
功能尚未启用。
bash
x-twitter-pp-cli thread compose draft.md         # 试运行预览
x-twitter-pp-cli thread compose draft.md --post  # (尚未启用 — 仅预览)
x-twitter-pp-cli articles-publish-md <markdown-file>
[--post]
解析YAML前置元数据(
title
cover
tags
summary
)并将Markdown正文转换为Draft.js
content_state
JSON格式 — 这是X文章编辑器服务器端期望的格式。
v1版本支持:前置元数据中的封面图片(
cover: ./cover.png
)、正文中的图片行(
![alt](./body.png)
)、段落、一级标题(
#
)、二级标题(
##
)、无序列表项(
-
/
*
)、有序列表项(
1.
)、块引用(
>
)、代码块、行内
**粗体**
*斜体*
bash
undefined

Markdown with frontmatter

带前置元数据的Markdown

cat > draft.md <<EOF

title: My Article cover: ./cover.png tags: [test]

cat > draft.md <<EOF

title: My Article cover: ./cover.png tags: [test]

Header

标题

A paragraph with bold text.
Screenshot alt text
  • bullet one
  • bullet two
bash
x-twitter-pp-cli articles-publish-md draft.md --post
EOF
x-twitter-pp-cli articles-publish-md draft.md # dry-run; prints constructed content_state JSON x-twitter-pp-cli articles-publish-md draft.md --post # create, update, set cover, and publish the article

With `--post`, the command creates a draft, updates the title, uploads body images and binds them into the Draft.js `entity_map`, updates the content, uploads and assigns a cover image when `cover` is set, and publishes it as a public X Article using Source B cookie auth and the article-ops.json hash config. The wrapper requires a frontmatter `title`.

**`x-twitter-pp-cli articles set-cover <article-id> <image-file>`**

Uploads a local image through X's browser media-upload flow and assigns the returned media ID as the Article cover.
一段包含粗体文本的段落。
截图替代文本
  • 项目符号一
  • 项目符号二
bash
x-twitter-pp-cli articles-publish-md draft.md --post
EOF
x-twitter-pp-cli articles-publish-md draft.md # 试运行;打印构造的content_state JSON x-twitter-pp-cli articles-publish-md draft.md --post # 创建草稿、更新标题、上传正文图片并绑定到Draft.js
entity_map
、更新内容、当设置
cover
时上传并分配封面图片,然后使用来源B的Cookie认证和article-ops.json哈希配置发布为公开X文章。此包装器需要前置元数据中的
title

**`x-twitter-pp-cli articles set-cover <article-id> <image-file>`**

通过X的浏览器媒体上传流程上传本地图片,并将返回的媒体ID分配为文章封面。

Known limitations of v1

v1版本的已知限制

  • thread compose --post
    is gated as a dry-run only. Real thread posting is the next engineering step.
  • OAuth live acceptance is blocked until the registered callback setup is available.
  • thread compose --post
    仅支持试运行。实际推文线程发布是下一步工程任务。
  • OAuth实时认证被阻止,直到注册回调设置可用。",