KosmoKrator

analytics

Langfuse CLI for AI Agents

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

Langfuse CLI Setup

Langfuse can be configured headlessly with `kosmokrator integrations:configure langfuse`.

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 langfuse --set public_key="$LANGFUSE_PUBLIC_KEY" --set secret_key="$LANGFUSE_SECRET_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor langfuse --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
public_key LANGFUSE_PUBLIC_KEY Text text yes Public Key
secret_key LANGFUSE_SECRET_KEY Secret secret yes Secret Key
url LANGFUSE_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 langfuse.langfuse_get_health '{}' --json
Provider shortcut
kosmo integrations:langfuse langfuse_get_health '{}' --json

Discovery

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

Discovery commands
kosmo integrations:docs langfuse --json
kosmo integrations:docs langfuse.langfuse_get_health --json
kosmo integrations:schema langfuse.langfuse_get_health --json
kosmo integrations:search "Langfuse" --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.

langfuse.langfuse_get_health

Check Langfuse Public API health.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_health '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_health '{}' --json

langfuse.langfuse_ingest_batch

Submit Langfuse ingestion batch events.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_ingest_batch '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_ingest_batch '{}' --json

langfuse.langfuse_list_traces

List Langfuse traces with filters and pagination.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_traces '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_traces '{}' --json

langfuse.langfuse_get_trace

Retrieve a Langfuse trace by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_trace '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_trace '{}' --json

langfuse.langfuse_delete_trace

Delete a Langfuse trace by ID.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_delete_trace '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_delete_trace '{}' --json

langfuse.langfuse_list_observations

List Langfuse observations with v2 filters.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_observations '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_observations '{}' --json

langfuse.langfuse_get_observation

Retrieve a Langfuse observation by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_observation '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_observation '{}' --json

langfuse.langfuse_create_score

Create a trace, observation, session, or dataset score.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_score '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_score '{}' --json

langfuse.langfuse_list_scores

List Langfuse v2 scores with filters.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_scores '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_scores '{}' --json

langfuse.langfuse_get_score

Retrieve a Langfuse score by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_score '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_score '{}' --json

langfuse.langfuse_delete_score

Delete a Langfuse score by ID.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_delete_score '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_delete_score '{}' --json

langfuse.langfuse_list_sessions

List Langfuse sessions.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_sessions '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_sessions '{}' --json

langfuse.langfuse_get_session

Retrieve a Langfuse session by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_session '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_session '{}' --json

langfuse.langfuse_list_datasets

List Langfuse v2 datasets.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_datasets '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_datasets '{}' --json

langfuse.langfuse_create_dataset

Create a Langfuse v2 dataset.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_dataset '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_dataset '{}' --json

langfuse.langfuse_get_dataset

Retrieve a Langfuse dataset by name.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_dataset '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_dataset '{}' --json

langfuse.langfuse_create_dataset_item

Create a Langfuse dataset item.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_dataset_item '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_dataset_item '{}' --json

langfuse.langfuse_list_dataset_items

List Langfuse dataset items.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_dataset_items '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_dataset_items '{}' --json

langfuse.langfuse_get_dataset_item

Retrieve a Langfuse dataset item by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_dataset_item '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_dataset_item '{}' --json

langfuse.langfuse_delete_dataset_item

Delete a Langfuse dataset item by ID.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_delete_dataset_item '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_delete_dataset_item '{}' --json

langfuse.langfuse_create_dataset_run_item

Create a Langfuse dataset run item.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_dataset_run_item '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_dataset_run_item '{}' --json

langfuse.langfuse_list_dataset_run_items

List Langfuse dataset run items.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_dataset_run_items '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_dataset_run_items '{}' --json

langfuse.langfuse_list_prompts

List Langfuse v2 prompts.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_prompts '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_prompts '{}' --json

langfuse.langfuse_create_prompt

Create a Langfuse prompt version.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_prompt '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_prompt '{}' --json

langfuse.langfuse_get_prompt

Retrieve a Langfuse prompt by name.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_prompt '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_prompt '{}' --json

langfuse.langfuse_delete_prompt

Delete a Langfuse prompt by name.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_delete_prompt '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_delete_prompt '{}' --json

langfuse.langfuse_update_prompt_version

Update labels or config for a prompt version.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_update_prompt_version '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_update_prompt_version '{}' --json

langfuse.langfuse_create_comment

Create a Langfuse comment.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_comment '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_comment '{}' --json

langfuse.langfuse_list_comments

List Langfuse comments.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_comments '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_comments '{}' --json

langfuse.langfuse_get_comment

Retrieve a Langfuse comment by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_comment '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_comment '{}' --json

langfuse.langfuse_metrics

Query Langfuse v2 metrics.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_metrics '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_metrics '{}' --json

langfuse.langfuse_list_models

List Langfuse model definitions.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_list_models '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_list_models '{}' --json

langfuse.langfuse_create_model

Create a Langfuse model definition.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_create_model '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_create_model '{}' --json

langfuse.langfuse_get_model

Retrieve a Langfuse model definition by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_get_model '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_get_model '{}' --json

langfuse.langfuse_delete_model

Delete a Langfuse model definition by ID.

Write write
Parameters
none
Generic call
kosmo integrations:call langfuse.langfuse_delete_model '{}' --json
Shortcut
kosmo integrations:langfuse langfuse_delete_model '{}' --json

Function Schemas

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

langfuse.langfuse_get_health 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_health --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_ingest_batch 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_ingest_batch --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_traces 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_traces --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_trace 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_trace --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_delete_trace 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_delete_trace --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_observations 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_observations --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_observation 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_observation --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_score 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_score --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_scores 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_scores --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_score 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_score --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_delete_score 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_delete_score --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_sessions 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_sessions --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_session 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_session --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_datasets 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_datasets --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_dataset 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_dataset --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_dataset 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_dataset --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_dataset_item 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_dataset_item --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_dataset_items 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_dataset_items --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_dataset_item 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_dataset_item --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_delete_dataset_item 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_delete_dataset_item --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_dataset_run_item 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_dataset_run_item --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_dataset_run_items 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_dataset_run_items --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_prompts 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_prompts --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_prompt 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_prompt --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_prompt 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_prompt --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_delete_prompt 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_delete_prompt --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_update_prompt_version 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_update_prompt_version --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_comment 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_comment --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_comments 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_comments --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_comment 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_comment --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_metrics 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_metrics --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_list_models 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_list_models --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_create_model 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_create_model --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_get_model 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_get_model --json
ParameterTypeRequiredDescription
No parameters.
langfuse.langfuse_delete_model 0 parameters
Schema command
kosmo integrations:schema langfuse.langfuse_delete_model --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.