Skip to content

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:

SystemDefault 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.

CommandPurpose
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 listSee 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:

bash
lovrabet service validate --file crm-service.json

When validation passes, you'll see something like:

text
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:

bash
lovrabet service import --file crm-service.json --dry-run

Once everything checks out, run the import:

bash
lovrabet service import --file crm-service.json

After 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:

bash
lovrabet service export --service crm --file crm-service.exported.json

The exported file can serve as a backup, for comparison, or for migration to another machine.

View local services

See which services are imported locally:

bash
lovrabet service list

Sample output:

text
total: 1
services:
  - serviceCode: crm
    name: CRM
    commandCount: 5

View one service's details:

bash
lovrabet service detail --service crm

The 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.

bash
lovrabet --help

You can also inspect one service only:

bash
lovrabet crm --help

Sample output:

text
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:

bash
lovrabet crm customer list --status active

Check 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.

bash
lovrabet schema export --format pretty

Sample excerpt:

json
{
  "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.

bash
lovrabet doctor

After importing a service, you'll see a Service Tree section like this:

text
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:

text
C:\Users\<用户名>\.lovrabet\service.json

Walk through a full verification

Here is a complete flow using crm-service.json:

bash
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-run

You should expect to see:

  • crm in service list.
  • Business entry points like customer list in crm --help.
  • The crm service and its commands in schema export.
  • The doctor output showing the local service.json loaded.
  • --dry-run previewing 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.

基于飞书知识库同步生成,内容以飞书源文档为准