KosmoKrator

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, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
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
Provider shortcut
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.

Discovery commands
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 read
Parameters
game_id, language, user_id, user_login, first, after, before
Generic call
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
Shortcut
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 read
Parameters
id, login
Generic call
kosmo integrations:call twitch.twitch_get_user '{"id":"example_id","login":"example_login"}' --json
Shortcut
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 read
Parameters
id, name
Generic call
kosmo integrations:call twitch.twitch_list_games '{"id":"example_id","name":"example_name"}' --json
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call twitch.twitch_get_game '{"id":"example_id"}' --json
Shortcut
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 read
Parameters
broadcaster_id, first, after
Generic call
kosmo integrations:call twitch.twitch_list_channels '{"broadcaster_id":"example_broadcaster_id","first":1,"after":"example_after"}' --json
Shortcut
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 read
Parameters
broadcaster_id
Generic call
kosmo integrations:call twitch.twitch_get_channel '{"broadcaster_id":"example_broadcaster_id"}' --json
Shortcut
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 read
Parameters
query, first, after
Generic call
kosmo integrations:call twitch.twitch_search_categories '{"query":"example_query","first":1,"after":"example_after"}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call twitch.twitch_get_current_user '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema twitch.twitch_list_streams --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema twitch.twitch_get_user --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema twitch.twitch_list_games --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema twitch.twitch_get_game --json
ParameterTypeRequiredDescription
id string yes The game/category ID (e.g., "21779" for League of Legends).
twitch.twitch_list_channels 3 parameters
Schema command
kosmo integrations:schema twitch.twitch_list_channels --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema twitch.twitch_get_channel --json
ParameterTypeRequiredDescription
broadcaster_id string yes The broadcaster's user ID.
twitch.twitch_search_categories 3 parameters
Schema command
kosmo integrations:schema twitch.twitch_search_categories --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema twitch.twitch_get_current_user --json
ParameterTypeRequiredDescription
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.