social
Twitter / X CLI for Shell Scripts
Use the Twitter / X CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
162 functions 96 read 66 write multi auth auth
Twitter / X CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Twitter / X CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Twitter / X CLI for Shell Scripts
kosmokrator integrations:configure x --enable --read allow --write ask --json
kosmo integrations:call x.x_get_account_activity_subscription_count '{}' --json Discovery Before Execution
Agents and scripts can inspect Twitter / X docs and schemas before choosing a function.
kosmo integrations:docs x --json
kosmo integrations:docs x.x_get_account_activity_subscription_count --json
kosmo integrations:schema x.x_get_account_activity_subscription_count --json
kosmo integrations:search "Twitter / X" --json
kosmo integrations:list --json Useful Twitter / X CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
x.x_get_account_activity_subscription_count | Read | none | Get subscription count |
x.x_validate_account_activity_subscription | Read | webhook_id | Validate subscription |
x.x_create_account_activity_subscription | Write | webhook_id, body | Create subscription |
x.x_get_account_activity_subscriptions | Read | webhook_id | Get subscriptions |
x.x_delete_account_activity_subscription | Write | webhook_id, user_id | Delete subscription |
x.x_activity_stream | Read | backfill_minutes, start_time, end_time | Activity Stream |
x.x_delete_activity_subscriptions_by_ids | Write | ids | Delete X activity subscriptions by IDs |
x.x_get_activity_subscriptions | Read | max_results, pagination_token | Get X activity subscriptions |
x.x_create_activity_subscription | Write | body | Create X activity subscription |
x.x_delete_activity_subscription | Write | subscription_id | Deletes X activity subscription |
x.x_update_activity_subscription | Write | subscription_id, body | Update X activity subscription |
x.x_get_chat_conversations | Read | max_results, pagination_token, chat_conversation.fields, expansions, user.fields | Get Chat Conversations |
x.x_create_chat_conversation | Write | body | Create Chat Group Conversation |
x.x_initialize_chat_group | Write | none | Initialize Chat Group |
x.x_get_chat_conversation | Read | id, max_results, pagination_token, chat_message_event.fields | Get Chat Conversation |
x.x_initialize_chat_conversation_keys | Write | id, body | Initialize Conversation Keys |
x.x_add_chat_group_members | Write | id, body | Add members to a Chat group conversation |
x.x_send_chat_message | Write | id, body | Send Chat Message |
x.x_mark_chat_conversation_read | Write | id, body | Mark Conversation as Read |
x.x_send_chat_typing_indicator | Write | id | Send Typing Indicator |
x.x_chat_media_upload_initialize | Write | body | Initialize Chat Media Upload |
x.x_chat_media_upload_append | Write | id, body | Append Chat Media Upload |
x.x_chat_media_upload_finalize | Write | id, body | Finalize Chat Media Upload |
x.x_chat_media_download | Read | id, media_hash_key | Download Chat Media |
x.x_search_communities | Read | query, max_results, next_token, pagination_token, community.fields | Search Communities |
x.x_get_communities_by_id | Read | id, community.fields | Get Community by ID |
x.x_get_compliance_jobs | Read | type, status, compliance_job.fields | Get Compliance Jobs |
x.x_create_compliance_jobs | Write | body | Create Compliance Job |
x.x_get_compliance_jobs_by_id | Read | id, compliance_job.fields | Get Compliance Job by ID |
x.x_delete_connections_by_uuids | Write | body | Terminate multiple connections |
x.x_get_connection_history | Read | status, endpoints, max_results, pagination_token, connection.fields | Get Connection History |
x.x_delete_all_connections | Write | none | Terminate all connections |
x.x_delete_connections_by_endpoint | Write | endpoint_id | Terminate connections by endpoint |
x.x_create_direct_messages_conversation | Write | body | Create DM conversation |
x.x_dm_conversations_media_download | Read | dm_id, media_id, resource_id | Download DM Media |
x.x_get_direct_messages_events_by_participant_id | Read | participant_id, max_results, pagination_token, event_types, dm_event.fields, expansions, media.fields, user.fields, tweet.fields | Get DM events for a DM conversation |
x.x_create_direct_messages_by_participant_id | Write | participant_id, body | Create DM message by participant ID |
x.x_create_direct_messages_by_conversation_id | Write | dm_conversation_id, body | Create DM message by conversation ID |
x.x_get_direct_messages_events_by_conversation_id | Read | id, max_results, pagination_token, event_types, dm_event.fields, expansions, media.fields, user.fields, tweet.fields | Get DM events for a DM conversation |
x.x_get_direct_messages_events | Read | max_results, pagination_token, event_types, dm_event.fields, expansions, media.fields, user.fields, tweet.fields | Get DM events |
Showing 40 of 162 functions. See the Twitter / X CLI reference for every function.
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.