Extended Service Configuration, Import/Export, and Verification
The Lovrabet CLI stores extended services in a local service.json. After importing, business commands such as lovrabet crm customer list appear in help, schema, and doctor.
Where the config file lives
The service config file the Lovrabet CLI reads and maintains is called service.json, located by default at:
| System | Default path |
|---|---|
| macOS | ~/.lovrabet/service.json, typically /Users/<用户名>/.lovrabet/service.json |
| Windows | %USERPROFILE%\.lovrabet\service.json, typically C:\Users\<用户名>\.lovrabet\service.json |
| Linux / WSL | ~/.lovrabet/service.json, typically /home/<用户名>/.lovrabet/service.json |
This file is managed by the Lovrabet CLI — don't edit it by hand. To add, overwrite, export, or remove a service, use the lovrabet service ... commands.
When importing, --file only means "which JSON to read the config from this time". The Lovrabet CLI doesn't care where that JSON originally lived; after a successful import, the local service.json is what counts.
The service commands
lovrabet service manages local extended services.
| Command | Purpose |
|---|---|
lovrabet service validate --file <file> | Validate a service config file. Checks only — imports nothing. |
lovrabet service import --file <file> | Import a service config into the local service.json. |
lovrabet service export --service <service> --file <file> | Export a service from the local service.json. |
lovrabet service list | See which services are imported locally. |
lovrabet service detail --service <service> | View a service's details. |
lovrabet service remove --service <service> | Remove a service from the local service.json. |
Here <service> is the service code, for example crm.
Validate before importing
Before importing, validate the JSON:
lovrabet service validate --file crm-service.jsonWhen validation passes, you'll see something like:
Service manifest validation passed.If a field is wrong, you'll get a specific error. Fix it, then import.
Import a config
Preview before importing:
lovrabet service import --file crm-service.json --dry-runOnce everything checks out, run the import:
lovrabet service import --file crm-service.jsonAfter a successful import, the service is written into the local service.json. If a service with the same name already exists locally — say crm — this import overwrites the old version.
Export a config
To export an imported service as a JSON file:
lovrabet service export --service crm --file crm-service.exported.jsonThe exported file can serve as a backup, for comparison, or for migration to another machine.
View local services
See which services are imported locally:
lovrabet service listSample output:
total: 1
services:
- serviceCode: crm
name: CRM
commandCount: 5View one service's details:
lovrabet service detail --service crmThe details show the service name, command list, parameters, and the target capabilities.
Check the effect in help
After a successful import, the new business service appears in the top-level help.
lovrabet --helpYou can also inspect one service only:
lovrabet crm --helpSample output:
lovrabet crm <command> [flags]
CRM
客户、联系人和跟进记录的业务服务
Commands:
customer list 查询客户列表
customer mine 查询我负责的客户
customer detail 查询某个客户详情
contact list 查询客户联系人
followup list 查询客户跟进记录
Use `lovrabet service detail --service crm` to inspect the manifest.To actually run a business command, type it in full:
lovrabet crm customer list --status activeCheck the effect in schema
schema is the machine-readable command catalog for Agents and tools. After importing a service, the new service appears there too.
lovrabet schema export --format prettySample excerpt:
{
"service": "crm",
"commands": [
{
"command": "customer list",
"description": "查询客户列表",
"risk": "read"
}
]
}This means the Agent can discover and use lovrabet crm customer list.
Check the effect in doctor
doctor inspects the current local state of the Lovrabet CLI.
lovrabet doctorAfter importing a service, you'll see a Service Tree section like this:
Service Tree
──────────────────────────────
Service file: /Users/<用户名>/.lovrabet/service.json
Status: ✓ Loaded
Services: 1
Commands: 5
crm: CRM (5 commands)On Windows, Service file shows something like:
C:\Users\<用户名>\.lovrabet\service.jsonWalk through a full verification
Here is a complete flow using crm-service.json:
lovrabet service validate --file crm-service.json
lovrabet service import --file crm-service.json
lovrabet service list
lovrabet crm --help
lovrabet schema export --format pretty
lovrabet doctor
lovrabet crm customer list --status active --keyword 科技 --dry-runYou should expect to see:
crminservice list.- Business entry points like
customer listincrm --help. - The
crmservice and its commands inschema export. - The doctor output showing the local
service.jsonloaded. --dry-runpreviewing which target capability and parameters the underlying call would use, without executing any query or write.
Next steps
This page covers only how the Lovrabet CLI imports, exports, and verifies extended services. For field meanings, the JSON structure, how to write mapTo, and choosing between datasetCode and datatable, see the service.json configuration reference.