analytics
Opsgenie CLI for Shell Scripts
Use the Opsgenie CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API key auth
Opsgenie CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Opsgenie CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Opsgenie CLI for Shell Scripts
kosmokrator integrations:configure opsgenie --set api_key="$OPSGENIE_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call opsgenie.opsgenie_list_alerts '{"query":"example_query","limit":1,"offset":1,"sort":"example_sort","order":"example_order"}' --json Discovery Before Execution
Agents and scripts can inspect Opsgenie docs and schemas 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 Useful Opsgenie CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
opsgenie.opsgenie_list_alerts | Read | query, limit, offset, sort, order | List Opsgenie alerts. Optionally filter by query, status, or priority. Returns alert IDs, messages, statuses, and priorities. |
opsgenie.opsgenie_get_alert | Read | alert_id | Get full details of a specific Opsgenie alert by its ID. Returns message, description, priority, status, tags, and recipients. |
opsgenie.opsgenie_create_alert | Write | message, alias, description, priority, teams, visibleTo, actions, tags, details, entity, source, user, note | Create a new Opsgenie alert. Specify message, priority (P1–P5), and optional description, alias, tags, teams, or recipients. |
opsgenie.opsgenie_list_incidents | Read | query, limit, offset, sort, order | List Opsgenie incidents. Optionally filter by query, status, or priority. Returns incident IDs, messages, statuses, and priorities. |
opsgenie.opsgenie_get_incident | Read | incident_id | Get full details of a specific Opsgenie incident by its ID. Returns message, description, priority, status, impacted services, and responders. |
opsgenie.opsgenie_list_teams | Read | none | List all Opsgenie teams. Returns team IDs, names, and descriptions. |
opsgenie.opsgenie_get_current_user | Read | none | Get the currently authenticated Opsgenie user. Useful for verifying credentials and identifying the connected account. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.