KosmoKrator

analytics

Microsoft Power BI CLI for AI Agents

Use the Microsoft Power BI CLI from KosmoKrator to call Microsoft Power BI tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Microsoft Power BI CLI Setup

Microsoft Power BI can be configured headlessly with `kosmokrator integrations:configure powerbi`.

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 powerbi --set access_token="$POWERBI_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor powerbi --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 POWERBI_ACCESS_TOKEN Secret secret yes Access Token
url POWERBI_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 powerbi.powerbi_list_workspaces '{"top":1}' --json
Provider shortcut
kosmo integrations:powerbi powerbi_list_workspaces '{"top":1}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs powerbi --json
kosmo integrations:docs powerbi.powerbi_list_workspaces --json
kosmo integrations:schema powerbi.powerbi_list_workspaces --json
kosmo integrations:search "Microsoft Power BI" --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.

powerbi.powerbi_list_workspaces

List Power BI workspaces (groups) the authenticated user has access to. Returns workspace IDs and names that can be used to query datasets and reports.

Read read
Parameters
top
Generic call
kosmo integrations:call powerbi.powerbi_list_workspaces '{"top":1}' --json
Shortcut
kosmo integrations:powerbi powerbi_list_workspaces '{"top":1}' --json

powerbi.powerbi_get_workspace

Get details for a specific Power BI workspace (group) by its ID.

Read read
Parameters
id
Generic call
kosmo integrations:call powerbi.powerbi_get_workspace '{"id":"example_id"}' --json
Shortcut
kosmo integrations:powerbi powerbi_get_workspace '{"id":"example_id"}' --json

powerbi.powerbi_list_datasets

List datasets within a Power BI workspace. Returns dataset IDs, names, and configuration details.

Read read
Parameters
workspace_id
Generic call
kosmo integrations:call powerbi.powerbi_list_datasets '{"workspace_id":"example_workspace_id"}' --json
Shortcut
kosmo integrations:powerbi powerbi_list_datasets '{"workspace_id":"example_workspace_id"}' --json

powerbi.powerbi_get_dataset

Get details for a specific Power BI dataset within a workspace, including schema and refresh configuration.

Read read
Parameters
workspace_id, dataset_id
Generic call
kosmo integrations:call powerbi.powerbi_get_dataset '{"workspace_id":"example_workspace_id","dataset_id":"example_dataset_id"}' --json
Shortcut
kosmo integrations:powerbi powerbi_get_dataset '{"workspace_id":"example_workspace_id","dataset_id":"example_dataset_id"}' --json

powerbi.powerbi_list_reports

List reports within a Power BI workspace. Returns report IDs, names, embed URLs, and associated dataset IDs.

Read read
Parameters
workspace_id
Generic call
kosmo integrations:call powerbi.powerbi_list_reports '{"workspace_id":"example_workspace_id"}' --json
Shortcut
kosmo integrations:powerbi powerbi_list_reports '{"workspace_id":"example_workspace_id"}' --json

powerbi.powerbi_get_report

Get details for a specific Power BI report within a workspace, including embed URL and associated dataset.

Read read
Parameters
workspace_id, report_id
Generic call
kosmo integrations:call powerbi.powerbi_get_report '{"workspace_id":"example_workspace_id","report_id":"example_report_id"}' --json
Shortcut
kosmo integrations:powerbi powerbi_get_report '{"workspace_id":"example_workspace_id","report_id":"example_report_id"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

powerbi.powerbi_list_workspaces 1 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_list_workspaces --json
ParameterTypeRequiredDescription
top integer no Maximum number of workspaces to return (default: 100).
powerbi.powerbi_get_workspace 1 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_get_workspace --json
ParameterTypeRequiredDescription
id string yes The workspace (group) ID (a GUID).
powerbi.powerbi_list_datasets 1 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_list_datasets --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID containing the datasets (a GUID).
powerbi.powerbi_get_dataset 2 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_get_dataset --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID (a GUID).
dataset_id string yes The dataset ID (a GUID).
powerbi.powerbi_list_reports 1 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_list_reports --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID containing the reports (a GUID).
powerbi.powerbi_get_report 2 parameters
Schema command
kosmo integrations:schema powerbi.powerbi_get_report --json
ParameterTypeRequiredDescription
workspace_id string yes The workspace (group) ID (a GUID).
report_id string yes The report ID (a GUID).

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.