KosmoKrator

data

Lob CLI for AI Agents

Use the Lob CLI from KosmoKrator to call Lob tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Lob CLI Setup

Lob can be configured headlessly with `kosmokrator integrations:configure lob`.

Install, configure, and verify
# 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 lob --set api_key="$LOB_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor lob --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.

KeyEnv varTypeRequiredLabel
api_key LOB_API_KEY Secret secret yes API Key
url LOB_URL URL url no Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call lob.lob_list_letters '{"limit":1,"offset":1}' --json
Provider shortcut
kosmo integrations:lob lob_list_letters '{"limit":1,"offset":1}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
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

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.

lob.lob_list_letters

List letters with pagination. Returns a page of letter objects sorted by creation date (newest first).

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call lob.lob_list_letters '{"limit":1,"offset":1}' --json
Shortcut
kosmo integrations:lob lob_list_letters '{"limit":1,"offset":1}' --json

lob.lob_get_letter

Retrieve details of a specific letter by its Lob ID, including delivery status, tracking info, and the letter URL.

Read read
Parameters
id
Generic call
kosmo integrations:call lob.lob_get_letter '{"id":"example_id"}' --json
Shortcut
kosmo integrations:lob lob_get_letter '{"id":"example_id"}' --json

lob.lob_create_letter

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.

Write write
Parameters
to, from, description, file, color, double_sided
Generic call
kosmo integrations:call lob.lob_create_letter '{"to":"example_to","from":"example_from","description":"example_description","file":"example_file","color":true,"double_sided":true}' --json
Shortcut
kosmo integrations:lob lob_create_letter '{"to":"example_to","from":"example_from","description":"example_description","file":"example_file","color":true,"double_sided":true}' --json

lob.lob_list_postcards

List postcards with pagination. Returns a page of postcard objects sorted by creation date (newest first).

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call lob.lob_list_postcards '{"limit":1,"offset":1}' --json
Shortcut
kosmo integrations:lob lob_list_postcards '{"limit":1,"offset":1}' --json

lob.lob_get_postcard

Retrieve details of a specific postcard by its Lob ID, including delivery status, tracking info, and thumbnails.

Read read
Parameters
id
Generic call
kosmo integrations:call lob.lob_get_postcard '{"id":"example_id"}' --json
Shortcut
kosmo integrations:lob lob_get_postcard '{"id":"example_id"}' --json

lob.lob_create_postcard

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.

Write write
Parameters
to, from, description, front, back
Generic call
kosmo integrations:call lob.lob_create_postcard '{"to":"example_to","from":"example_from","description":"example_description","front":"example_front","back":"example_back"}' --json
Shortcut
kosmo integrations:lob lob_create_postcard '{"to":"example_to","from":"example_from","description":"example_description","front":"example_front","back":"example_back"}' --json

lob.lob_get_current_user

List saved addresses in the Lob account. Returns all verified addresses that can be used as sender or recipient for letters and postcards.

Read read
Parameters
none
Generic call
kosmo integrations:call lob.lob_get_current_user '{}' --json
Shortcut
kosmo integrations:lob lob_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

lob.lob_list_letters 2 parameters
Schema command
kosmo integrations:schema lob.lob_list_letters --json
ParameterTypeRequiredDescription
limit integer no Number of results per page (default: 10, max: 100).
offset integer no Number of results to skip for pagination (default: 0).
lob.lob_get_letter 1 parameters
Schema command
kosmo integrations:schema lob.lob_get_letter --json
ParameterTypeRequiredDescription
id string yes The letter ID (e.g., "ltr_abcdef123456").
lob.lob_create_letter 6 parameters
Schema command
kosmo integrations:schema lob.lob_create_letter --json
ParameterTypeRequiredDescription
to string yes Recipient — an address ID (e.g., "adr_...") or an inline address object.
from string no Sender — an address ID or inline address object. Optional if a default return address is configured.
description string no An internal description for the letter (not printed on the letter itself).
file string yes HTML string or template ID for the letter content (e.g., "<html>...</html>" or "tmpl_...").
color boolean no Print in color (default: true). Set to false for black & white.
double_sided boolean no Print double-sided (default: true). Set to false for single-sided.
lob.lob_list_postcards 2 parameters
Schema command
kosmo integrations:schema lob.lob_list_postcards --json
ParameterTypeRequiredDescription
limit integer no Number of results per page (default: 10, max: 100).
offset integer no Number of results to skip for pagination (default: 0).
lob.lob_get_postcard 1 parameters
Schema command
kosmo integrations:schema lob.lob_get_postcard --json
ParameterTypeRequiredDescription
id string yes The postcard ID (e.g., "psc_abcdef123456").
lob.lob_create_postcard 5 parameters
Schema command
kosmo integrations:schema lob.lob_create_postcard --json
ParameterTypeRequiredDescription
to string yes Recipient — an address ID (e.g., "adr_...") or an inline address object (name, address_line1, city, state, zip).
from string no Sender — an address ID or inline address object. Optional if a default return address is configured.
description string no An internal description for the postcard (not printed on the postcard itself).
front string yes HTML string or template ID for the front of the postcard (e.g., "<html>...</html>" or "tmpl_...").
back string yes HTML string or template ID for the back of the postcard.
lob.lob_get_current_user 0 parameters
Schema command
kosmo integrations:schema lob.lob_get_current_user --json
ParameterTypeRequiredDescription
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.