sales
Square CLI for Headless Automation
Use the Square CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 7 read 0 write Bearer token auth
Square CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Square CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Square CLI for Headless Automation
kosmokrator integrations:configure square --set access_token="$SQUARE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call square.square_get_current_user '{}' --json Discovery Before Execution
Agents and scripts can inspect Square docs and schemas before choosing a function.
kosmo integrations:docs square --json
kosmo integrations:docs square.square_get_current_user --json
kosmo integrations:schema square.square_get_current_user --json
kosmo integrations:search "Square" --json
kosmo integrations:list --json Useful Square CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
square.square_get_current_user | Read | none | Get the current authenticated Square merchant account. Returns merchant details including business name, country, currency, and status. |
square.square_get_customer | Read | id | Retrieve a Square customer by ID. Returns full customer details including email, phone, address, and cards on file. |
square.square_get_order | Read | id | Retrieve a Square order by ID. Returns full order details including line items, totals, taxes, and discounts. |
square.square_get_payment | Read | id | Retrieve a Square payment by ID. Returns full payment details including amount, status, card details, and processing fees. |
square.square_list_customers | Read | limit, cursor, sort_field, sort_order | List Square customers with optional filtering. Supports pagination with cursor. |
square.square_list_orders | Read | location_id, limit, cursor, states | List Square orders for a specific location. Requires a location_id. Supports filtering by order states and pagination with cursor. |
square.square_list_payments | Read | location_id, begin_time, end_time, limit, cursor | List Square payments with optional filtering. Supports filtering by location ID, begin_time / end_time (ISO 8601), and pagination with cursor. |
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.