field-service
ServiceM8 CLI for Cron Jobs
Use the ServiceM8 CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write Manual OAuth token auth
ServiceM8 CLI for Cron Jobs
Schedule repeatable integration workflows from cron while keeping credentials in KosmoKrator config.
Use the headless CLI from cron when an operation should run without an interactive agent session. The ServiceM8 CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# ServiceM8 CLI for Cron Jobs
kosmokrator integrations:configure service_m8 --set access_token="$SERVICE_M8_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call service_m8.servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json Discovery Before Execution
Agents and scripts can inspect ServiceM8 docs and schemas before choosing a function.
kosmo integrations:docs service_m8 --json
kosmo integrations:docs service_m8.servicem8_list_jobs --json
kosmo integrations:schema service_m8.servicem8_list_jobs --json
kosmo integrations:search "ServiceM8" --json
kosmo integrations:list --json Useful ServiceM8 CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
service_m8.servicem8_list_jobs | Read | status, limit, offset | List jobs from ServiceM8. Returns job details including status, client, dates, and descriptions. Supports filtering by status and pagination. |
service_m8.servicem8_get_job | Read | uuid | Get detailed information about a specific ServiceM8 job by its UUID. Returns full job details including status, client, description, dates, and assigned staff. |
service_m8.servicem8_list_clients | Read | limit, offset | List clients from ServiceM8. Returns client details including name, email, phone, and address. Supports pagination. |
service_m8.servicem8_get_client | Read | uuid | Get detailed information about a specific ServiceM8 client by their UUID. Returns client details including name, email, phone, billing address, and notes. |
service_m8.servicem8_create_job | Write | client_id, template_id, description | Create a new job in ServiceM8. Requires a client UUID. Optionally specify a job template and description to pre-populate the job. |
service_m8.servicem8_list_activities | Read | job_uuid, limit, offset | List activity records from ServiceM8. Returns a timeline of events such as job status changes, comments, and notes. Supports filtering by job and pagination. |
service_m8.servicem8_get_current_user | Read | none | Get the profile of the currently authenticated ServiceM8 user. Returns name, email, role, and account details. |
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.