productivity
Modal CLI for AI Agents
Use the Modal CLI from KosmoKrator to call Modal tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Modal CLI Setup
Modal can be configured headlessly with `kosmokrator integrations:configure modal`.
# 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 modal --set api_key="$MODAL_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor modal --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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | MODAL_API_KEY | Secret secret | yes | API Key |
url | MODAL_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call modal.modal_list_apps '{}' --json kosmo integrations:modal modal_list_apps '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs modal --json
kosmo integrations:docs modal.modal_list_apps --json
kosmo integrations:schema modal.modal_list_apps --json
kosmo integrations:search "Modal" --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.
modal.modal_list_apps
List all Modal apps. Returns app IDs, names, and status details.
read - Parameters
- none
kosmo integrations:call modal.modal_list_apps '{}' --json kosmo integrations:modal modal_list_apps '{}' --json modal.modal_get_app
Get details for a specific Modal app by ID, including status and metadata.
read - Parameters
- app_id
kosmo integrations:call modal.modal_get_app '{"app_id":"example_app_id"}' --json kosmo integrations:modal modal_get_app '{"app_id":"example_app_id"}' --json modal.modal_list_functions
List all functions for a Modal app. Returns function IDs, names, and runtime details.
read - Parameters
- app_id
kosmo integrations:call modal.modal_list_functions '{"app_id":"example_app_id"}' --json kosmo integrations:modal modal_list_functions '{"app_id":"example_app_id"}' --json modal.modal_list_schedules
List all scheduled functions for a Modal app. Returns schedule IDs, cron expressions, and function details.
read - Parameters
- app_id
kosmo integrations:call modal.modal_list_schedules '{"app_id":"example_app_id"}' --json kosmo integrations:modal modal_list_schedules '{"app_id":"example_app_id"}' --json modal.modal_list_volumes
List all Modal volumes. Returns volume IDs, names, and size details.
read - Parameters
- none
kosmo integrations:call modal.modal_list_volumes '{}' --json kosmo integrations:modal modal_list_volumes '{}' --json modal.modal_list_secrets
List all Modal secrets. Returns secret names and creation dates (values are not exposed).
read - Parameters
- none
kosmo integrations:call modal.modal_list_secrets '{}' --json kosmo integrations:modal modal_list_secrets '{}' --json modal.modal_get_current_user
Get the current authenticated Modal user information, including name, email, and account details.
read - Parameters
- none
kosmo integrations:call modal.modal_get_current_user '{}' --json kosmo integrations:modal modal_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
modal.modal_list_apps 0 parameters
kosmo integrations:schema modal.modal_list_apps --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal.modal_get_app 1 parameters
kosmo integrations:schema modal.modal_get_app --json | Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app. |
modal.modal_list_functions 1 parameters
kosmo integrations:schema modal.modal_list_functions --json | Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app to list functions for. |
modal.modal_list_schedules 1 parameters
kosmo integrations:schema modal.modal_list_schedules --json | Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app to list schedules for. |
modal.modal_list_volumes 0 parameters
kosmo integrations:schema modal.modal_list_volumes --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal.modal_list_secrets 0 parameters
kosmo integrations:schema modal.modal_list_secrets --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal.modal_get_current_user 0 parameters
kosmo integrations:schema modal.modal_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.