logistics
Onfleet CLI for Headless Automation
Use the Onfleet CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
9 functions 6 read 3 write API key auth
Onfleet 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 Onfleet CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Onfleet CLI for Headless Automation
kosmokrator integrations:configure onfleet --set api_key="$ONFLEET_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call onfleet.onfleet_list_tasks '{"state":1,"worker":"example_worker","organization":"example_organization","team":"example_team","completeBeforeAfter":"example_completeBeforeAfter","completeBeforeBefore":"example_completeBeforeBefore","from":"example_from","to":"example_to"}' --json Discovery Before Execution
Agents and scripts can inspect Onfleet docs and schemas before choosing a function.
kosmo integrations:docs onfleet --json
kosmo integrations:docs onfleet.onfleet_list_tasks --json
kosmo integrations:schema onfleet.onfleet_list_tasks --json
kosmo integrations:search "Onfleet" --json
kosmo integrations:list --json Useful Onfleet CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
onfleet.onfleet_list_tasks | Read | state, worker, organization, team, completeBeforeAfter, completeBeforeBefore, from, to, lastUpdated, query | List delivery tasks from Onfleet. Filter by state (0=unassigned, 1=assigned, 2=active, 3=completed), worker, team, or time range. Returns task details including destination, recipient, and completion status. |
onfleet.onfleet_get_task | Read | task_id | Get detailed information about a specific delivery task by its ID. Returns destination, recipient, worker assignment, completion details, and tracking info. |
onfleet.onfleet_create_task | Write | destination_address, destination_address_unparsed, recipient_name, recipient_phone, recipient_email, notes, complete_after, complete_before, pickup_task, worker, team, merchant, executor, quantity, service_time, appearance, metadata | Create a new delivery task in Onfleet. Requires a destination address and recipient details. Optionally assign to a worker or team, set time windows, and add notes. |
onfleet.onfleet_update_task | Write | task_id, destination_address, notes, complete_after, complete_before, worker, team, quantity, service_time, appearance, metadata | Update an existing delivery task in Onfleet. Only the fields you provide will be changed. You can update destination, assignment, notes, time windows, and more. |
onfleet.onfleet_delete_task | Write | task_id | Delete a delivery task from Onfleet. Only unassigned or unsuccessfully completed tasks can be deleted. This action is permanent. |
onfleet.onfleet_list_workers | Read | teams, states, name, phone, query | List all workers (drivers) in Onfleet. Optionally filter by team or worker state. Returns worker name, phone, vehicle details, and current status. |
onfleet.onfleet_list_teams | Read | none | List all teams in your Onfleet organization. Returns team name, manager, assigned workers, and hub location. |
onfleet.onfleet_list_recipients | Read | name, phone, email, query | List recipients (delivery customers) from Onfleet. Search by name, phone, or email. Returns recipient contact details. |
onfleet.onfleet_get_current_user | Read | none | Get the currently authenticated Onfleet user profile. Returns name, email, organization, and account details. Useful for verifying API connectivity. |
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.