automation
Apify CLI for Cron Jobs
Use the Apify CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.
10 functions 9 read 1 write API token auth
Apify 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 Apify CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Apify CLI for Cron Jobs
kosmokrator integrations:configure apify --set api_token="$APIFY_API_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call apify.apify_run_actor '{"actorId":"example_actorId","input":"example_input","build":"example_build","waitForFinish":1,"timeout":1,"memory":1}' --json Discovery Before Execution
Agents and scripts can inspect Apify docs and schemas before choosing a function.
kosmo integrations:docs apify --json
kosmo integrations:docs apify.apify_run_actor --json
kosmo integrations:schema apify.apify_run_actor --json
kosmo integrations:search "Apify" --json
kosmo integrations:list --json Useful Apify CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
apify.apify_run_actor | Write | actorId, input, build, waitForFinish, timeout, memory | Run an Apify actor. Provide the actor ID and input configuration to start a new run. Returns the run details including run ID and status. Use apify_get_run to check progress. |
apify.apify_get_run | Read | runId | Get details and status of an Apify actor run. Returns the run status (READY, RUNNING, SUCCEEDED, FAILED, ABORTED, TIMING-OUT, TIMED-OUT), output dataset ID, and other metadata. |
apify.apify_list_actors | Read | offset, limit | List Apify actors available to the authenticated user. Returns actor names, IDs, descriptions, and versions. Supports pagination with offset and limit. |
apify.apify_get_actor | Read | actorId | Get details of a specific Apify actor, including its description, input schema, default run options, and available versions. Use this to understand what input an actor requires before running it. |
apify.apify_list_datasets | Read | offset, limit | List Apify datasets accessible to the authenticated user. Returns dataset IDs, names, item counts, and sizes. Supports pagination. |
apify.apify_get_dataset | Read | datasetId | Get details of a specific Apify dataset, including its item count, size, name, and associated actor run. Use apify_get_dataset_items to retrieve the actual data. |
apify.apify_get_dataset_items | Read | datasetId, format, limit, offset | Retrieve items from an Apify dataset. Supports JSON, CSV, and other formats. Use this to get the results from completed actor runs. Datasets are referenced by ID from run results. |
apify.apify_list_key_value_stores | Read | offset, limit | List Apify key-value stores accessible to the authenticated user. Key-value stores hold actor outputs like screenshots, PDFs, or JSON results. Supports pagination. |
apify.apify_get_record | Read | storeId, key | Get a record from an Apify key-value store by its key. Common keys include "OUTPUT" for actor results, "SCREENSHOT" for page screenshots, or custom keys set by actor runs. |
apify.apify_get_current_user | Read | none | Get the profile of the currently authenticated Apify user. Returns user ID, username, email, plan details, and monthly usage 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.