Lob CLI for Cron Jobs
Use the Lob CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 5 read 2 write API key auth
Lob 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 Lob CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Lob CLI for Cron Jobs
kosmokrator integrations:configure lob --set api_key="$LOB_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call lob.lob_list_letters '{"limit":1,"offset":1}' --json Discovery Before Execution
Agents and scripts can inspect Lob docs and schemas before choosing a function.
kosmo integrations:docs lob --json
kosmo integrations:docs lob.lob_list_letters --json
kosmo integrations:schema lob.lob_list_letters --json
kosmo integrations:search "Lob" --json
kosmo integrations:list --json Useful Lob CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
lob.lob_list_letters | Read | limit, offset | List letters with pagination. Returns a page of letter objects sorted by creation date (newest first). |
lob.lob_get_letter | Read | id | Retrieve details of a specific letter by its Lob ID, including delivery status, tracking info, and the letter URL. |
lob.lob_create_letter | Write | to, from, description, file, color, double_sided | Create and send a letter via Lob. Provide recipient and sender addresses (as address IDs or inline address objects), plus an HTML file or template ID for the letter content. |
lob.lob_list_postcards | Read | limit, offset | List postcards with pagination. Returns a page of postcard objects sorted by creation date (newest first). |
lob.lob_get_postcard | Read | id | Retrieve details of a specific postcard by its Lob ID, including delivery status, tracking info, and thumbnails. |
lob.lob_create_postcard | Write | to, from, description, front, back | Create and send a postcard via Lob. Provide recipient and sender addresses (as address IDs or inline address objects), plus HTML or template IDs for the front and back. |
lob.lob_get_current_user | Read | none | List saved addresses in the Lob account. Returns all verified addresses that can be used as sender or recipient for letters and postcards. |
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.