KosmoKrator

ai

Anthropic CLI for Shell Scripts

Use the Anthropic CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.

7 functions 6 read 1 write API key auth

Anthropic 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 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 Shell Scripts
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

FunctionTypeParametersDescription
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

Related Anthropic CLI Pages