xcli
Installation
SKILL.md
X CLI Operations
Procedures
Step 1: Identify the Operation
- Determine the intent of the request (e.g., post a tweet, read bookmarks, search users).
- Run
python3 scripts/find-operation.py --search "<keyword>"to locate the matching operation ID. - If the keyword search returns no results, broaden the search or run
python3 scripts/find-operation.py --tag "<tag>"with one of:Tweets,Users,Bookmarks,Lists,Direct Messages,Spaces,Media,Communities,Trends,News. - If uncertain about an operation's parameters, run
xcli spec <operationId>to inspect required and optional fields.
Step 2: Construct the Command
- Read
references/operations.mdto identify the correct parameter format and common field sets for the target operation. - Build the xcli command following these rules:
- Path parameters (e.g., user ID, tweet ID) use
-p "key=value"and auto-substitute in the URL. - Query parameters (e.g.,
tweet.fields,max_results) also use-p "key=value". - Request body fields use
-f "key=value"for simple payloads or-b '{"json": "here"}'for complex nested bodies. - Append
-rwhen piping output or when raw JSON is needed for further processing.
- Path parameters (e.g., user ID, tweet ID) use
Step 3: Execute the Operation
- Run
python3 scripts/exec-operation.py <operationId> [options]to execute the command. - Parse the JSON response from stdout.
- If the response contains
meta.next_token, pagination is available. Re-run with-p "pagination_token=<token>"to fetch the next page.
Step 4: Handle Multi-Step Workflows
- For operations requiring the authenticated user's ID, first run:
python3 scripts/exec-operation.py getUsersMe -p "user.fields=id"Extractdata.idfrom the response. - For reply threads, extract
data.idfrom acreatePostsresponse and pass it asreply.in_reply_to_tweet_idin the next post. - For bulk lookups, use comma-separated values:
-p "ids=123,456,789".
Error Handling
- If
scripts/exec-operation.pyreturns an HTTP 401/403 error, the OAuth tokens may be expired. Runxcli call getUsersMeto verify authentication. If that also fails, the MCP server needs to be restarted to refresh tokens. - If an HTTP 402 "CreditsDepleted" error occurs, the operation requires a paid X API plan. Switch to an endpoint available on the free tier or inform the user about the plan limitation.
- If an HTTP 429 "TooManyRequests" error occurs, wait and retry after the rate limit window resets.
- If
scripts/find-operation.pyreturns no results, runxcli listwithout filters and scan the full operation list for the closest match.
Weekly Installs
1
Repository
pedronauck/skillsGitHub Stars
301
First Seen
12 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
warp1