data
Mux CLI for AI Agents
Use the Mux CLI from KosmoKrator to call Mux tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Mux CLI Setup
Mux can be configured headlessly with `kosmokrator integrations:configure mux`.
# 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 mux --set access_token="$MUX_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor mux --json
kosmokrator integrations:status --json Credentials
Authentication type: Bearer token bearer_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 | MUX_ACCESS_TOKEN | Secret secret | yes | Access Token |
url | MUX_URL | URL url | no | Mux API URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call mux.mux_list_assets '{"limit":1,"page":1}' --json kosmo integrations:mux mux_list_assets '{"limit":1,"page":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs mux --json
kosmo integrations:docs mux.mux_list_assets --json
kosmo integrations:schema mux.mux_list_assets --json
kosmo integrations:search "Mux" --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.
mux.mux_list_assets
List video assets stored in Mux. Returns a paginated list of assets with their IDs, status, duration, and playback information.
read - Parameters
- limit, page
kosmo integrations:call mux.mux_list_assets '{"limit":1,"page":1}' --json kosmo integrations:mux mux_list_assets '{"limit":1,"page":1}' --json mux.mux_get_asset
Retrieve details of a specific video asset by its ID, including status, playback IDs, duration, and tracks.
read - Parameters
- asset_id
kosmo integrations:call mux.mux_get_asset '{"asset_id":"example_asset_id"}' --json kosmo integrations:mux mux_get_asset '{"asset_id":"example_asset_id"}' --json mux.mux_create_asset
Create a new video asset in Mux from an input URL. The asset is ingested and encoded asynchronously. Optionally set a playback policy (public or signed).
write - Parameters
- input, playback_policy
kosmo integrations:call mux.mux_create_asset '{"input":"example_input","playback_policy":"example_playback_policy"}' --json kosmo integrations:mux mux_create_asset '{"input":"example_input","playback_policy":"example_playback_policy"}' --json mux.mux_list_live_streams
List live streams in Mux. Returns a paginated list of live streams with their IDs, status, stream key, and playback information.
read - Parameters
- limit, page
kosmo integrations:call mux.mux_list_live_streams '{"limit":1,"page":1}' --json kosmo integrations:mux mux_list_live_streams '{"limit":1,"page":1}' --json mux.mux_get_live_stream
Retrieve details of a specific live stream by its ID, including status, stream key, playback IDs, and reconnect window.
read - Parameters
- live_stream_id
kosmo integrations:call mux.mux_get_live_stream '{"live_stream_id":"example_live_stream_id"}' --json kosmo integrations:mux mux_get_live_stream '{"live_stream_id":"example_live_stream_id"}' --json mux.mux_create_live_stream
Create a new live stream in Mux. Returns the stream key and playback information. Optionally set playback policy and asset creation settings.
write - Parameters
- playback_policy, new_asset_settings
kosmo integrations:call mux.mux_create_live_stream '{"playback_policy":"example_playback_policy","new_asset_settings":"example_new_asset_settings"}' --json kosmo integrations:mux mux_create_live_stream '{"playback_policy":"example_playback_policy","new_asset_settings":"example_new_asset_settings"}' --json mux.mux_get_current_user
Get realtime viewer data from Mux Data, including current viewer counts across all properties and views.
read - Parameters
- none
kosmo integrations:call mux.mux_get_current_user '{}' --json kosmo integrations:mux mux_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
mux.mux_list_assets 2 parameters
kosmo integrations:schema mux.mux_list_assets --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of assets to return (1–100, default: 25). |
page | integer | no | Page offset for pagination (0-indexed, default: 0). |
mux.mux_get_asset 1 parameters
kosmo integrations:schema mux.mux_get_asset --json | Parameter | Type | Required | Description |
|---|---|---|---|
asset_id | string | yes | The ID of the asset to retrieve. |
mux.mux_create_asset 2 parameters
kosmo integrations:schema mux.mux_create_asset --json | Parameter | Type | Required | Description |
|---|---|---|---|
input | string | yes | The URL of the video file to ingest (e.g., "https://storage.example.com/video.mp4"). |
playback_policy | array | no | Playback policy for the asset. Use ["public"] for unrestricted access or ["signed"] for signed URLs. Defaults to the workspace default. |
mux.mux_list_live_streams 2 parameters
kosmo integrations:schema mux.mux_list_live_streams --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of live streams to return (1–100, default: 25). |
page | integer | no | Page offset for pagination (0-indexed, default: 0). |
mux.mux_get_live_stream 1 parameters
kosmo integrations:schema mux.mux_get_live_stream --json | Parameter | Type | Required | Description |
|---|---|---|---|
live_stream_id | string | yes | The ID of the live stream to retrieve. |
mux.mux_create_live_stream 2 parameters
kosmo integrations:schema mux.mux_create_live_stream --json | Parameter | Type | Required | Description |
|---|---|---|---|
playback_policy | array | no | Playback policy for the live stream. Use ["public"] for unrestricted access or ["signed"] for signed URLs. Defaults to the workspace default. |
new_asset_settings | object | no | Settings applied to assets created from this live stream. Supports any Mux asset creation parameters (e.g., {"playback_policy": ["public"], "mp4_support": "standard"}). |
mux.mux_get_current_user 0 parameters
kosmo integrations:schema mux.mux_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.