data
Onfleet CLI for AI Agents
Use the Onfleet CLI from KosmoKrator to call Onfleet tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Onfleet CLI Setup
Onfleet can be configured headlessly with `kosmokrator integrations:configure onfleet`.
# 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 onfleet --set api_key="$ONFLEET_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor onfleet --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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | ONFLEET_API_KEY | Secret secret | yes | API Key |
url | ONFLEET_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
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 kosmo integrations: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
These commands return structured output for coding agents that need to inspect capabilities 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 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.
onfleet.onfleet_list_tasks
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.
read - Parameters
- state, worker, organization, team, completeBeforeAfter, completeBeforeBefore, from, to, lastUpdated, query
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 kosmo integrations: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 onfleet.onfleet_get_task
Get detailed information about a specific delivery task by its ID. Returns destination, recipient, worker assignment, completion details, and tracking info.
read - Parameters
- task_id
kosmo integrations:call onfleet.onfleet_get_task '{"task_id":"example_task_id"}' --json kosmo integrations:onfleet onfleet_get_task '{"task_id":"example_task_id"}' --json onfleet.onfleet_create_task
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.
write - Parameters
- 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
kosmo integrations:call onfleet.onfleet_create_task '{"destination_address":"example_destination_address","destination_address_unparsed":"example_destination_address_unparsed","recipient_name":"example_recipient_name","recipient_phone":"example_recipient_phone","recipient_email":"example_recipient_email","notes":"example_notes","complete_after":"example_complete_after","complete_before":"example_complete_before"}' --json kosmo integrations:onfleet onfleet_create_task '{"destination_address":"example_destination_address","destination_address_unparsed":"example_destination_address_unparsed","recipient_name":"example_recipient_name","recipient_phone":"example_recipient_phone","recipient_email":"example_recipient_email","notes":"example_notes","complete_after":"example_complete_after","complete_before":"example_complete_before"}' --json onfleet.onfleet_update_task
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.
write - Parameters
- task_id, destination_address, notes, complete_after, complete_before, worker, team, quantity, service_time, appearance, metadata
kosmo integrations:call onfleet.onfleet_update_task '{"task_id":"example_task_id","destination_address":"example_destination_address","notes":"example_notes","complete_after":"example_complete_after","complete_before":"example_complete_before","worker":"example_worker","team":"example_team","quantity":1}' --json kosmo integrations:onfleet onfleet_update_task '{"task_id":"example_task_id","destination_address":"example_destination_address","notes":"example_notes","complete_after":"example_complete_after","complete_before":"example_complete_before","worker":"example_worker","team":"example_team","quantity":1}' --json onfleet.onfleet_delete_task
Delete a delivery task from Onfleet. Only unassigned or unsuccessfully completed tasks can be deleted. This action is permanent.
write - Parameters
- task_id
kosmo integrations:call onfleet.onfleet_delete_task '{"task_id":"example_task_id"}' --json kosmo integrations:onfleet onfleet_delete_task '{"task_id":"example_task_id"}' --json onfleet.onfleet_list_workers
List all workers (drivers) in Onfleet. Optionally filter by team or worker state. Returns worker name, phone, vehicle details, and current status.
read - Parameters
- teams, states, name, phone, query
kosmo integrations:call onfleet.onfleet_list_workers '{"teams":"example_teams","states":"example_states","name":"example_name","phone":"example_phone","query":"example_query"}' --json kosmo integrations:onfleet onfleet_list_workers '{"teams":"example_teams","states":"example_states","name":"example_name","phone":"example_phone","query":"example_query"}' --json onfleet.onfleet_list_teams
List all teams in your Onfleet organization. Returns team name, manager, assigned workers, and hub location.
read - Parameters
- none
kosmo integrations:call onfleet.onfleet_list_teams '{}' --json kosmo integrations:onfleet onfleet_list_teams '{}' --json onfleet.onfleet_list_recipients
List recipients (delivery customers) from Onfleet. Search by name, phone, or email. Returns recipient contact details.
read - Parameters
- name, phone, email, query
kosmo integrations:call onfleet.onfleet_list_recipients '{"name":"example_name","phone":"example_phone","email":"example_email","query":"example_query"}' --json kosmo integrations:onfleet onfleet_list_recipients '{"name":"example_name","phone":"example_phone","email":"example_email","query":"example_query"}' --json onfleet.onfleet_get_current_user
Get the currently authenticated Onfleet user profile. Returns name, email, organization, and account details. Useful for verifying API connectivity.
read - Parameters
- none
kosmo integrations:call onfleet.onfleet_get_current_user '{}' --json kosmo integrations:onfleet onfleet_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
onfleet.onfleet_list_tasks 10 parameters
kosmo integrations:schema onfleet.onfleet_list_tasks --json | Parameter | Type | Required | Description |
|---|---|---|---|
state | integer | no | Task state filter: 0=unassigned, 1=assigned, 2=active, 3=completed. |
worker | string | no | Filter tasks assigned to a specific worker ID. |
organization | string | no | Filter tasks by organization ID. |
team | string | no | Filter tasks by team ID. |
completeBeforeAfter | string | no | ISO 8601 timestamp — list tasks completed after this time. |
completeBeforeBefore | string | no | ISO 8601 timestamp — list tasks with completeBefore before this time. |
from | string | no | ISO 8601 timestamp — list tasks created after this time. |
to | string | no | ISO 8601 timestamp — list tasks created before this time. |
lastUpdated | string | no | ISO 8601 timestamp — list tasks updated after this time. |
query | string | no | Search query to filter tasks by recipient name, notes, or tracking URL. |
onfleet.onfleet_get_task 1 parameters
kosmo integrations:schema onfleet.onfleet_get_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | The Onfleet task ID (24-character hex string). |
onfleet.onfleet_create_task 17 parameters
kosmo integrations:schema onfleet.onfleet_create_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
destination_address | string | yes | Destination street address (e.g., "123 Main St, San Francisco, CA 94105"). |
destination_address_unparsed | string | no | Full unparsed address string if you prefer Onfleet to geocode it. |
recipient_name | string | yes | Recipient full name. |
recipient_phone | string | no | Recipient phone number (E.164 format preferred). |
recipient_email | string | no | Recipient email address. |
notes | string | no | Notes for the driver about the task. |
complete_after | string | no | ISO 8601 timestamp — earliest time task can be completed. |
complete_before | string | no | ISO 8601 timestamp — latest time task must be completed by. |
pickup_task | boolean | no | Set to true if this is a pickup task instead of a dropoff. |
worker | string | no | Worker ID to directly assign the task to. |
team | string | no | Team ID to assign the task to (for auto-dispatch). |
merchant | string | no | Merchant/organization ID for the task. |
executor | string | no | Organization ID of the executor (for interconnected fleets). |
quantity | integer | no | Number of units for the task. |
service_time | integer | no | Estimated service time in seconds. |
appearance | array | no | Visual customization: {"triangleColor": "#RRGGBB"}. |
metadata | array | no | Custom metadata array: [{"name": "key", "value": "val", "visibility": ["worker"]}]. |
onfleet.onfleet_update_task 11 parameters
kosmo integrations:schema onfleet.onfleet_update_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | The Onfleet task ID to update (24-character hex string). |
destination_address | string | no | New destination address. |
notes | string | no | Updated driver notes. |
complete_after | string | no | ISO 8601 timestamp — earliest completion time. |
complete_before | string | no | ISO 8601 timestamp — latest completion deadline. |
worker | string | no | Worker ID to assign (pass null or empty to unassign). |
team | string | no | Team ID to assign to. |
quantity | integer | no | Updated quantity. |
service_time | integer | no | Updated estimated service time in seconds. |
appearance | array | no | Visual customization: {"triangleColor": "#RRGGBB"}. |
metadata | array | no | Updated custom metadata. |
onfleet.onfleet_delete_task 1 parameters
kosmo integrations:schema onfleet.onfleet_delete_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | The Onfleet task ID to delete (24-character hex string). |
onfleet.onfleet_list_workers 5 parameters
kosmo integrations:schema onfleet.onfleet_list_workers --json | Parameter | Type | Required | Description |
|---|---|---|---|
teams | array | no | Array of team IDs to filter workers by. |
states | array | no | Array of worker states to filter by: 0=off-duty, 1=on-duty. |
name | string | no | Filter workers by name. |
phone | string | no | Filter workers by phone number. |
query | string | no | General search query for workers. |
onfleet.onfleet_list_teams 0 parameters
kosmo integrations:schema onfleet.onfleet_list_teams --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
onfleet.onfleet_list_recipients 4 parameters
kosmo integrations:schema onfleet.onfleet_list_recipients --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | no | Filter recipients by name. |
phone | string | no | Filter recipients by phone number. |
email | string | no | Filter recipients by email address. |
query | string | no | General search query for recipients. |
onfleet.onfleet_get_current_user 0 parameters
kosmo integrations:schema onfleet.onfleet_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.