KosmoKrator

analytics

Opsgenie CLI for AI Agents

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

7 functions 6 read 1 write API key auth

Opsgenie CLI Setup

Opsgenie can be configured headlessly with `kosmokrator integrations:configure opsgenie`.

# 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 opsgenie --set api_key="$OPSGENIE_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor opsgenie --json
kosmokrator integrations:status --json

Credentials

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

KeyEnv varTypeRequiredLabel
api_key OPSGENIE_API_KEY Secret secret yes API Key

Call Opsgenie Headlessly

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

kosmo integrations:call opsgenie.opsgenie_list_alerts '{
  "query": "example_query",
  "limit": 1,
  "offset": 1,
  "sort": "example_sort",
  "order": "example_order"
}' --json

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

kosmo integrations:opsgenie opsgenie_list_alerts '{
  "query": "example_query",
  "limit": 1,
  "offset": 1,
  "sort": "example_sort",
  "order": "example_order"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs opsgenie --json
kosmo integrations:docs opsgenie.opsgenie_list_alerts --json
kosmo integrations:schema opsgenie.opsgenie_list_alerts --json
kosmo integrations:search "Opsgenie" --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 Opsgenie.

opsgenie.opsgenie_list_alerts

Read read

List Opsgenie alerts. Optionally filter by query, status, or priority. Returns alert IDs, messages, statuses, and priorities.

Parameters
query, limit, offset, sort, order

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_list_alerts '{"query":"example_query","limit":1,"offset":1,"sort":"example_sort","order":"example_order"}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_list_alerts '{"query":"example_query","limit":1,"offset":1,"sort":"example_sort","order":"example_order"}' --json

opsgenie.opsgenie_get_alert

Read read

Get full details of a specific Opsgenie alert by its ID. Returns message, description, priority, status, tags, and recipients.

Parameters
alert_id

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_get_alert '{"alert_id":"example_alert_id"}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_get_alert '{"alert_id":"example_alert_id"}' --json

opsgenie.opsgenie_create_alert

Write write

Create a new Opsgenie alert. Specify message, priority (P1–P5), and optional description, alias, tags, teams, or recipients.

Parameters
message, alias, description, priority, teams, visibleTo, actions, tags, details, entity, source, user, note

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_create_alert '{"message":"example_message","alias":"example_alias","description":"example_description","priority":"example_priority","teams":"example_teams","visibleTo":"example_visibleTo","actions":"example_actions","tags":"example_tags"}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_create_alert '{"message":"example_message","alias":"example_alias","description":"example_description","priority":"example_priority","teams":"example_teams","visibleTo":"example_visibleTo","actions":"example_actions","tags":"example_tags"}' --json

opsgenie.opsgenie_list_incidents

Read read

List Opsgenie incidents. Optionally filter by query, status, or priority. Returns incident IDs, messages, statuses, and priorities.

Parameters
query, limit, offset, sort, order

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_list_incidents '{"query":"example_query","limit":1,"offset":1,"sort":"example_sort","order":"example_order"}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_list_incidents '{"query":"example_query","limit":1,"offset":1,"sort":"example_sort","order":"example_order"}' --json

opsgenie.opsgenie_get_incident

Read read

Get full details of a specific Opsgenie incident by its ID. Returns message, description, priority, status, impacted services, and responders.

Parameters
incident_id

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_get_incident '{"incident_id":"example_incident_id"}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_get_incident '{"incident_id":"example_incident_id"}' --json

opsgenie.opsgenie_list_teams

Read read

List all Opsgenie teams. Returns team IDs, names, and descriptions.

Parameters
none

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_list_teams '{}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_list_teams '{}' --json

opsgenie.opsgenie_get_current_user

Read read

Get the currently authenticated Opsgenie user. Useful for verifying credentials and identifying the connected account.

Parameters
none

Generic CLI call

kosmo integrations:call opsgenie.opsgenie_get_current_user '{}' --json

Provider shortcut

kosmo integrations:opsgenie opsgenie_get_current_user '{}' --json

Function Schemas

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

opsgenie.opsgenie_list_alerts

List Opsgenie alerts. Optionally filter by query, status, or priority. Returns alert IDs, messages, statuses, and priorities.

Operation
Read read
Schema command
kosmo integrations:schema opsgenie.opsgenie_list_alerts --json
ParameterTypeRequiredDescription
query string no Search query to filter alerts (e.g., "status:open AND priority:P1").
limit integer no Maximum number of alerts to return (default: 20, max: 100).
offset integer no Offset for pagination (default: 0).
sort string no Sort field (e.g., "createdAt", "updatedAt").
order string no Sort order: "asc" or "desc" (default: "desc").

opsgenie.opsgenie_get_alert

Get full details of a specific Opsgenie alert by its ID. Returns message, description, priority, status, tags, and recipients.

Operation
Read read
Schema command
kosmo integrations:schema opsgenie.opsgenie_get_alert --json
ParameterTypeRequiredDescription
alert_id string yes The Opsgenie alert ID.

opsgenie.opsgenie_create_alert

Create a new Opsgenie alert. Specify message, priority (P1–P5), and optional description, alias, tags, teams, or recipients.

Operation
Write write
Schema command
kosmo integrations:schema opsgenie.opsgenie_create_alert --json
ParameterTypeRequiredDescription
message string yes Alert message text.
alias string no Client-defined identifier for the alert (used for deduplication).
description string no Detailed description of the alert.
priority string no Alert priority: "P1", "P2", "P3", "P4", or "P5". Defaults to "P3".
teams array no List of team names to route the alert to (e.g., ["ops", "engineering"]).
visibleTo array no List of teams/users the alert will be visible to without sending notifications.
actions array no Custom actions available on the alert (e.g., ["Restart", "ScaleUp"]).
tags array no List of tags for the alert (e.g., ["production", "critical"]).
details object no Key-value map of additional alert details.
entity string no Entity field used to specify the domain of the alert.
source string no Source field of the alert (e.g., "monitoring", "custom").
user string no Display name of the request owner.
note string no Additional note to add to the alert.

opsgenie.opsgenie_list_incidents

List Opsgenie incidents. Optionally filter by query, status, or priority. Returns incident IDs, messages, statuses, and priorities.

Operation
Read read
Schema command
kosmo integrations:schema opsgenie.opsgenie_list_incidents --json
ParameterTypeRequiredDescription
query string no Search query to filter incidents (e.g., "status:open AND priority:P1").
limit integer no Maximum number of incidents to return (default: 20, max: 100).
offset integer no Offset for pagination (default: 0).
sort string no Sort field (e.g., "createdAt", "updatedAt").
order string no Sort order: "asc" or "desc" (default: "desc").

opsgenie.opsgenie_get_incident

Get full details of a specific Opsgenie incident by its ID. Returns message, description, priority, status, impacted services, and responders.

Operation
Read read
Schema command
kosmo integrations:schema opsgenie.opsgenie_get_incident --json
ParameterTypeRequiredDescription
incident_id string yes The Opsgenie incident ID.

opsgenie.opsgenie_list_teams

List all Opsgenie teams. Returns team IDs, names, and descriptions.

Operation
Read read
Schema command
kosmo integrations:schema opsgenie.opsgenie_list_teams --json
ParameterTypeRequiredDescription
No parameters.

opsgenie.opsgenie_get_current_user

Get the currently authenticated Opsgenie user. Useful for verifying credentials and identifying the connected account.

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