KosmoKrator

streaming

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.

8 functions 8 read 0 write Manual OAuth token auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call Twitch Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

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

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Twitch.

twitch.twitch_list_streams

Read read

List live streams on Twitch. Filter by game, language, or specific users. Returns stream title, viewer count, and broadcaster info.

Parameters
game_id, language, user_id, user_login, first, after, before

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

twitch.twitch_get_user

Read read

Get information about a Twitch user by user ID or login name. Returns display name, bio, profile image, and account details.

Parameters
id, login

Generic CLI call

kosmo integrations:call twitch.twitch_get_user '{"id":"example_id","login":"example_login"}' --json

Provider shortcut

kosmo integrations:twitch twitch_get_user '{"id":"example_id","login":"example_login"}' --json

twitch.twitch_list_games

Read read

Get information about Twitch games/categories by ID or name. Returns game name, box art URL, and IGDB ID.

Parameters
id, name

Generic CLI call

kosmo integrations:call twitch.twitch_list_games '{"id":"example_id","name":"example_name"}' --json

Provider shortcut

kosmo integrations:twitch twitch_list_games '{"id":"example_id","name":"example_name"}' --json

twitch.twitch_get_game

Read read

Get information about a specific Twitch game/category by its ID. Returns game name, box art URL, and IGDB ID.

Parameters
id

Generic CLI call

kosmo integrations:call twitch.twitch_get_game '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:twitch twitch_get_game '{"id":"example_id"}' --json

twitch.twitch_list_channels

Read read

List channel information on Twitch. Filter by broadcaster ID. Returns channel description, game, and broadcast settings.

Parameters
broadcaster_id, first, after

Generic CLI call

kosmo integrations:call twitch.twitch_list_channels '{"broadcaster_id":"example_broadcaster_id","first":1,"after":"example_after"}' --json

Provider shortcut

kosmo integrations:twitch twitch_list_channels '{"broadcaster_id":"example_broadcaster_id","first":1,"after":"example_after"}' --json

twitch.twitch_get_channel

Read read

Get information about a specific Twitch channel by broadcaster ID. Returns channel title, game, description, and broadcast settings.

Parameters
broadcaster_id

Generic CLI call

kosmo integrations:call twitch.twitch_get_channel '{"broadcaster_id":"example_broadcaster_id"}' --json

Provider shortcut

kosmo integrations:twitch twitch_get_channel '{"broadcaster_id":"example_broadcaster_id"}' --json

twitch.twitch_search_categories

Read read

Search for games/categories on Twitch by name. Returns matching categories with IDs you can use to filter streams.

Parameters
query, first, after

Generic CLI call

kosmo integrations:call twitch.twitch_search_categories '{"query":"example_query","first":1,"after":"example_after"}' --json

Provider shortcut

kosmo integrations:twitch twitch_search_categories '{"query":"example_query","first":1,"after":"example_after"}' --json

twitch.twitch_get_current_user

Read read

Get information about the currently authenticated Twitch user. Returns display name, bio, profile image, and account type.

Parameters
none

Generic CLI call

kosmo integrations:call twitch.twitch_get_current_user '{}' --json

Provider 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

List live streams on Twitch. Filter by game, language, or specific users. Returns stream title, viewer count, and broadcaster info.

Operation
Read read
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

Get information about a Twitch user by user ID or login name. Returns display name, bio, profile image, and account details.

Operation
Read read
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

Get information about Twitch games/categories by ID or name. Returns game name, box art URL, and IGDB ID.

Operation
Read read
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

Get information about a specific Twitch game/category by its ID. Returns game name, box art URL, and IGDB ID.

Operation
Read read
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

List channel information on Twitch. Filter by broadcaster ID. Returns channel description, game, and broadcast settings.

Operation
Read read
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

Get information about a specific Twitch channel by broadcaster ID. Returns channel title, game, description, and broadcast settings.

Operation
Read read
Schema command
kosmo integrations:schema twitch.twitch_get_channel --json
ParameterTypeRequiredDescription
broadcaster_id string yes The broadcaster's user ID.

twitch.twitch_search_categories

Search for games/categories on Twitch by name. Returns matching categories with IDs you can use to filter streams.

Operation
Read read
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

Get information about the currently authenticated Twitch user. Returns display name, bio, profile image, and account type.

Operation
Read read
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.