KosmoKrator

print

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.

7 functions 5 read 2 write API key auth

Lob CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call Lob Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:lob lob_list_letters '{
  "limit": 1,
  "offset": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities 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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Lob.

lob.lob_list_letters

Read read

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

Parameters
limit, offset

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

lob.lob_get_letter

Read read

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

Parameters
id

Generic CLI call

kosmo integrations:call lob.lob_get_letter '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:lob lob_get_letter '{"id":"example_id"}' --json

lob.lob_create_letter

Write write

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.

Parameters
to, from, description, file, color, double_sided

Generic CLI 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

Provider 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

Read read

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

Parameters
limit, offset

Generic CLI call

kosmo integrations:call lob.lob_list_postcards '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:lob lob_list_postcards '{"limit":1,"offset":1}' --json

lob.lob_get_postcard

Read read

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

Parameters
id

Generic CLI call

kosmo integrations:call lob.lob_get_postcard '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:lob lob_get_postcard '{"id":"example_id"}' --json

lob.lob_create_postcard

Write write

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.

Parameters
to, from, description, front, back

Generic CLI call

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

Provider 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

Read read

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

Parameters
none

Generic CLI call

kosmo integrations:call lob.lob_get_current_user '{}' --json

Provider 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

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

Operation
Read read
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

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

Operation
Read read
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

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.

Operation
Write write
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

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

Operation
Read read
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

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

Operation
Read read
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

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.

Operation
Write write
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

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

Operation
Read read
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.