ai
Anthropic CLI for Cron Jobs
Use the Anthropic CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API key auth
Anthropic CLI for Cron Jobs
Schedule repeatable integration workflows from cron while keeping credentials in KosmoKrator config.
Use the headless CLI from cron when an operation should run without an interactive agent session. The Anthropic CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Anthropic CLI for Cron Jobs
kosmokrator integrations:configure anthropic --set api_key="$ANTHROPIC_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call anthropic.anthropic_list_messages '{"model":"example_model","limit":1,"before_id":"example_before_id","after_id":"example_after_id"}' --json Discovery Before Execution
Agents and scripts can inspect Anthropic docs and schemas before choosing a function.
kosmo integrations:docs anthropic --json
kosmo integrations:docs anthropic.anthropic_list_messages --json
kosmo integrations:schema anthropic.anthropic_list_messages --json
kosmo integrations:search "Anthropic" --json
kosmo integrations:list --json Useful Anthropic CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
anthropic.anthropic_list_messages | Read | model, limit, before_id, after_id | List messages in the Anthropic conversation history. Returns paginated message resources with optional filtering by model, date, and ID. |
anthropic.anthropic_create_message | Write | model, messages, max_tokens, system, temperature, top_p, stop_sequences, stream | Send a prompt to Claude and receive an AI-generated response. Supports multi-turn conversations, system prompts, temperature control, and configurable output length. |
anthropic.anthropic_list_models | Read | limit, before_id, after_id | List available Anthropic AI models. Returns model identifiers, creation dates, and display names. |
anthropic.anthropic_get_model | Read | id | Get detailed information about a specific Anthropic model, including its display name, creation date, and capabilities. |
anthropic.anthropic_list_workspaces | Read | limit, before_id, after_id | List Anthropic workspaces. Returns workspace identifiers, names, and configuration details. |
anthropic.anthropic_get_workspace | Read | id | Get detailed information about a specific Anthropic workspace, including its name, configuration, and usage settings. |
anthropic.anthropic_get_current_user | Read | none | Get the authenticated user's profile and account information. |
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.