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.

7 functions 7 read 0 write Manual OAuth token auth

Microsoft Power BI CLI Setup

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

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

KeyEnv varTypeRequiredLabel
access_token POWERBI_ACCESS_TOKEN Secret secret yes Access Token
url POWERBI_URL URL url no API Base URL

Call Microsoft Power BI Headlessly

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

kosmo integrations:call powerbi.powerbi_list_workspaces '{
  "top": 1
}' --json

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

kosmo integrations:powerbi powerbi_list_workspaces '{
  "top": 1
}' --json

Agent Discovery Commands

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

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

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 Microsoft Power BI.

powerbi.powerbi_list_workspaces

Read read

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.

Parameters
top

Generic CLI call

kosmo integrations:call powerbi.powerbi_list_workspaces '{"top":1}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_list_workspaces '{"top":1}' --json

powerbi.powerbi_get_workspace

Read read

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

Parameters
id

Generic CLI call

kosmo integrations:call powerbi.powerbi_get_workspace '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_get_workspace '{"id":"example_id"}' --json

powerbi.powerbi_list_datasets

Read read

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

Parameters
workspace_id

Generic CLI call

kosmo integrations:call powerbi.powerbi_list_datasets '{"workspace_id":"example_workspace_id"}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_list_datasets '{"workspace_id":"example_workspace_id"}' --json

powerbi.powerbi_get_dataset

Read read

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

Parameters
workspace_id, dataset_id

Generic CLI call

kosmo integrations:call powerbi.powerbi_get_dataset '{"workspace_id":"example_workspace_id","dataset_id":"example_dataset_id"}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_get_dataset '{"workspace_id":"example_workspace_id","dataset_id":"example_dataset_id"}' --json

powerbi.powerbi_list_reports

Read read

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

Parameters
workspace_id

Generic CLI call

kosmo integrations:call powerbi.powerbi_list_reports '{"workspace_id":"example_workspace_id"}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_list_reports '{"workspace_id":"example_workspace_id"}' --json

powerbi.powerbi_get_report

Read read

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

Parameters
workspace_id, report_id

Generic CLI call

kosmo integrations:call powerbi.powerbi_get_report '{"workspace_id":"example_workspace_id","report_id":"example_report_id"}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_get_report '{"workspace_id":"example_workspace_id","report_id":"example_report_id"}' --json

powerbi.powerbi_get_current_user

Read read

Get the authenticated user's Power BI profile, including display name and email address.

Parameters
none

Generic CLI call

kosmo integrations:call powerbi.powerbi_get_current_user '{}' --json

Provider shortcut

kosmo integrations:powerbi powerbi_get_current_user '{}' --json

Function Schemas

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

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.

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

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

Operation
Read read
Schema command
kosmo integrations:schema powerbi.powerbi_get_workspace --json
ParameterTypeRequiredDescription
id string yes The workspace (group) ID (a GUID).

powerbi.powerbi_list_datasets

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

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

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

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

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

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

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

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

powerbi.powerbi_get_current_user

Get the authenticated user's Power BI profile, including display name and email address.

Operation
Read read
Schema command
kosmo integrations:schema powerbi.powerbi_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.