productivity
ServiceM8 CLI for AI Agents
Use the ServiceM8 CLI from KosmoKrator to call ServiceM8 tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.ServiceM8 CLI Setup
ServiceM8 can be configured headlessly with `kosmokrator integrations:configure service-m8`.
# 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 service-m8 --set access_token="$SERVICE_M8_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor service-m8 --json
kosmokrator integrations:status --json Credentials
Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | SERVICE_M8_ACCESS_TOKEN | Secret secret | yes | Access Token |
url | SERVICE_M8_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 service-m8.servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json kosmo integrations:service-m8 servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities 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 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.
service-m8.servicem8_list_jobs
List jobs from ServiceM8. Returns job details including status, client, dates, and descriptions. Supports filtering by status and pagination.
read - Parameters
- status, limit, offset
kosmo integrations:call service-m8.servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json kosmo integrations:service-m8 servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json service-m8.servicem8_get_job
Get detailed information about a specific ServiceM8 job by its UUID. Returns full job details including status, client, description, dates, and assigned staff.
read - Parameters
- uuid
kosmo integrations:call service-m8.servicem8_get_job '{"uuid":"example_uuid"}' --json kosmo integrations:service-m8 servicem8_get_job '{"uuid":"example_uuid"}' --json service-m8.servicem8_list_clients
List clients from ServiceM8. Returns client details including name, email, phone, and address. Supports pagination.
read - Parameters
- limit, offset
kosmo integrations:call service-m8.servicem8_list_clients '{"limit":1,"offset":1}' --json kosmo integrations:service-m8 servicem8_list_clients '{"limit":1,"offset":1}' --json service-m8.servicem8_get_client
Get detailed information about a specific ServiceM8 client by their UUID. Returns client details including name, email, phone, billing address, and notes.
read - Parameters
- uuid
kosmo integrations:call service-m8.servicem8_get_client '{"uuid":"example_uuid"}' --json kosmo integrations:service-m8 servicem8_get_client '{"uuid":"example_uuid"}' --json service-m8.servicem8_create_job
Create a new job in ServiceM8. Requires a client UUID. Optionally specify a job template and description to pre-populate the job.
write - Parameters
- client_id, template_id, description
kosmo integrations:call service-m8.servicem8_create_job '{"client_id":"example_client_id","template_id":"example_template_id","description":"example_description"}' --json kosmo integrations:service-m8 servicem8_create_job '{"client_id":"example_client_id","template_id":"example_template_id","description":"example_description"}' --json service-m8.servicem8_list_activities
List activity records from ServiceM8. Returns a timeline of events such as job status changes, comments, and notes. Supports filtering by job and pagination.
read - Parameters
- job_uuid, limit, offset
kosmo integrations:call service-m8.servicem8_list_activities '{"job_uuid":"example_job_uuid","limit":1,"offset":1}' --json kosmo integrations:service-m8 servicem8_list_activities '{"job_uuid":"example_job_uuid","limit":1,"offset":1}' --json service-m8.servicem8_get_current_user
List staff members visible to the authenticated ServiceM8 token. ServiceM8 does not expose a dedicated /me endpoint in the public API.
read - Parameters
- none
kosmo integrations:call service-m8.servicem8_get_current_user '{}' --json kosmo integrations:service-m8 servicem8_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
service-m8.servicem8_list_jobs 3 parameters
kosmo integrations:schema service-m8.servicem8_list_jobs --json | Parameter | Type | Required | Description |
|---|---|---|---|
status | string | no | Filter by job status (e.g. "open", "in_progress", "completed", "cancelled"). |
limit | integer | no | Maximum number of jobs to return per page. |
offset | integer | no | Number of records to skip for pagination. |
service-m8.servicem8_get_job 1 parameters
kosmo integrations:schema service-m8.servicem8_get_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string | yes | The UUID of the job to retrieve. |
service-m8.servicem8_list_clients 2 parameters
kosmo integrations:schema service-m8.servicem8_list_clients --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of clients to return per page. |
offset | integer | no | Number of records to skip for pagination. |
service-m8.servicem8_get_client 1 parameters
kosmo integrations:schema service-m8.servicem8_get_client --json | Parameter | Type | Required | Description |
|---|---|---|---|
uuid | string | yes | The UUID of the client to retrieve. |
service-m8.servicem8_create_job 3 parameters
kosmo integrations:schema service-m8.servicem8_create_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
client_id | string | yes | The UUID of the client to assign the job to. |
template_id | string | no | The UUID of a job template to apply. |
description | string | no | A description for the new job. |
service-m8.servicem8_list_activities 3 parameters
kosmo integrations:schema service-m8.servicem8_list_activities --json | Parameter | Type | Required | Description |
|---|---|---|---|
job_uuid | string | no | Filter activities to a specific job by its UUID. |
limit | integer | no | Maximum number of activities to return per page. |
offset | integer | no | Number of records to skip for pagination. |
service-m8.servicem8_get_current_user 0 parameters
kosmo integrations:schema service-m8.servicem8_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.