data
Twitch CLI for AI Agents
Use the Twitch CLI from KosmoKrator to call Twitch tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Twitch CLI Setup
Twitch can be configured headlessly with `kosmokrator integrations:configure twitch`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure twitch --set access_token="$TWITCH_ACCESS_TOKEN" --set client_id="$TWITCH_CLIENT_ID" --enable --read allow --write ask --json
kosmokrator integrations:doctor twitch --json
kosmokrator integrations:status --json Credentials
Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | TWITCH_ACCESS_TOKEN | Secret secret | yes | Access Token |
client_id | TWITCH_CLIENT_ID | Text string | yes | Client ID |
base_url | TWITCH_BASE_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call twitch.twitch_list_streams '{"game_id":"example_game_id","language":"example_language","user_id":"example_user_id","user_login":"example_user_login","first":1,"after":"example_after","before":"example_before"}' --json kosmo integrations:twitch twitch_list_streams '{"game_id":"example_game_id","language":"example_language","user_id":"example_user_id","user_login":"example_user_login","first":1,"after":"example_after","before":"example_before"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs twitch --json
kosmo integrations:docs twitch.twitch_list_streams --json
kosmo integrations:schema twitch.twitch_list_streams --json
kosmo integrations:search "Twitch" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
twitch.twitch_list_streams
List live streams on Twitch. Filter by game, language, or specific users. Returns stream title, viewer count, and broadcaster info.
read - Parameters
- game_id, language, user_id, user_login, first, after, before
kosmo integrations:call twitch.twitch_list_streams '{"game_id":"example_game_id","language":"example_language","user_id":"example_user_id","user_login":"example_user_login","first":1,"after":"example_after","before":"example_before"}' --json kosmo integrations:twitch twitch_list_streams '{"game_id":"example_game_id","language":"example_language","user_id":"example_user_id","user_login":"example_user_login","first":1,"after":"example_after","before":"example_before"}' --json twitch.twitch_get_user
Get information about a Twitch user by user ID or login name. Returns display name, bio, profile image, and account details.
read - Parameters
- id, login
kosmo integrations:call twitch.twitch_get_user '{"id":"example_id","login":"example_login"}' --json kosmo integrations:twitch twitch_get_user '{"id":"example_id","login":"example_login"}' --json twitch.twitch_list_games
Get information about Twitch games/categories by ID or name. Returns game name, box art URL, and IGDB ID.
read - Parameters
- id, name
kosmo integrations:call twitch.twitch_list_games '{"id":"example_id","name":"example_name"}' --json kosmo integrations:twitch twitch_list_games '{"id":"example_id","name":"example_name"}' --json twitch.twitch_get_game
Get information about a specific Twitch game/category by its ID. Returns game name, box art URL, and IGDB ID.
read - Parameters
- id
kosmo integrations:call twitch.twitch_get_game '{"id":"example_id"}' --json kosmo integrations:twitch twitch_get_game '{"id":"example_id"}' --json twitch.twitch_list_channels
List channel information on Twitch. Filter by broadcaster ID. Returns channel description, game, and broadcast settings.
read - Parameters
- broadcaster_id, first, after
kosmo integrations:call twitch.twitch_list_channels '{"broadcaster_id":"example_broadcaster_id","first":1,"after":"example_after"}' --json kosmo integrations:twitch twitch_list_channels '{"broadcaster_id":"example_broadcaster_id","first":1,"after":"example_after"}' --json twitch.twitch_get_channel
Get information about a specific Twitch channel by broadcaster ID. Returns channel title, game, description, and broadcast settings.
read - Parameters
- broadcaster_id
kosmo integrations:call twitch.twitch_get_channel '{"broadcaster_id":"example_broadcaster_id"}' --json kosmo integrations:twitch twitch_get_channel '{"broadcaster_id":"example_broadcaster_id"}' --json twitch.twitch_search_categories
Search for games/categories on Twitch by name. Returns matching categories with IDs you can use to filter streams.
read - Parameters
- query, first, after
kosmo integrations:call twitch.twitch_search_categories '{"query":"example_query","first":1,"after":"example_after"}' --json kosmo integrations:twitch twitch_search_categories '{"query":"example_query","first":1,"after":"example_after"}' --json twitch.twitch_get_current_user
Get information about the currently authenticated Twitch user. Returns display name, bio, profile image, and account type.
read - Parameters
- none
kosmo integrations:call twitch.twitch_get_current_user '{}' --json kosmo integrations:twitch twitch_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
twitch.twitch_list_streams 7 parameters
kosmo integrations:schema twitch.twitch_list_streams --json | Parameter | Type | Required | Description |
|---|---|---|---|
game_id | string | no | Filter by game/category ID. Use search_categories to find the ID. |
language | string | no | Filter by stream language (e.g., "en", "es", "fr", "de", "pt", "ko", "ja"). |
user_id | string | no | Filter by broadcaster user ID. |
user_login | string | no | Filter by broadcaster login name. |
first | integer | no | Number of results to return (max 100, default 20). |
after | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
before | string | no | Cursor for backward pagination. |
twitch.twitch_get_user 2 parameters
kosmo integrations:schema twitch.twitch_get_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | no | The user ID to look up. |
login | string | no | The login name to look up (e.g., "ninja"). |
twitch.twitch_list_games 2 parameters
kosmo integrations:schema twitch.twitch_list_games --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | no | Game ID to look up. |
name | string | no | Game name to look up (e.g., "Fortnite"). |
twitch.twitch_get_game 1 parameters
kosmo integrations:schema twitch.twitch_get_game --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The game/category ID (e.g., "21779" for League of Legends). |
twitch.twitch_list_channels 3 parameters
kosmo integrations:schema twitch.twitch_list_channels --json | Parameter | Type | Required | Description |
|---|---|---|---|
broadcaster_id | string | no | Filter by broadcaster user ID. |
first | integer | no | Number of results to return (max 100, default 20). |
after | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
twitch.twitch_get_channel 1 parameters
kosmo integrations:schema twitch.twitch_get_channel --json | Parameter | Type | Required | Description |
|---|---|---|---|
broadcaster_id | string | yes | The broadcaster's user ID. |
twitch.twitch_search_categories 3 parameters
kosmo integrations:schema twitch.twitch_search_categories --json | Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | Search query (e.g., "League of Legends", "Just Chatting"). |
first | integer | no | Number of results to return (max 100, default 20). |
after | string | no | Cursor for pagination — pass the value from a previous response to get the next page. |
twitch.twitch_get_current_user 0 parameters
kosmo integrations:schema twitch.twitch_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.