Skip to content

The .lovrabet.json file holds the local preferences of the Lovrabet Runtime CLI: app selection, Access Key, output format, security ceilings, and the country/region or self-hosted domains.

This file is not a catalog of platform apps. The apps you can access on the platform are authoritative on the remote side; the local apps object only keeps a few stable app aliases. Configuration is normally generated by lovrabet workspace init, lovrabet auth login, and lovrabet config init — you should not need to hand-write one from an empty file.

INFO

Related docs

TIP

.lovrabet.json may contain an Access Key — do not commit it to Git. The file must be standard JSON: no comments, no trailing commas.

Config file locations

ScopeLocationPurpose
Current directory./.lovrabet.jsonApp binding and overrides for the current working directory
Global~/.lovrabet.jsonDefault credentials, output preferences, app candidates, country/region, and domains for this machine

The Runtime CLI only reads .lovrabet.json automatically — it does not read the Rabetbase CLI configuration or other legacy files. The current-directory config overrides the global config key by key; if the current directory explicitly sets apps, the entire apps object replaces the global one of the same name — the two are never merged item by item.

Recommended structure

With a single target app, you can bind the App Code directly:

json
{
  "appcode": "app-7786baaf",
  "format": "compress",
  "riskLevel": "write",
  "region": "cn"
}

When you need stable local aliases or multiple apps, use apps and defaultApp:

json
{
  "defaultApp": "crm",
  "apps": {
    "crm": {
      "appcode": "app-crm-001"
    },
    "finance": {
      "appcode": "app-finance-002"
    }
  },
  "format": "compress",
  "riskLevel": "write"
}

defaultApp is the default candidate when no more specific clue exists — it is not an unbreakable binding. An explicit --app or --appcode passed on the command line always takes precedence.

A complete config you can use directly

Below is standard JSON. Replace the sample values and delete the fields you do not need. For the official service, keeping only region is usually enough; the five domains are for self-hosted deployments or special routing.

json
{
  "defaultApp": "crm",
  "apps": {
    "crm": {
      "appcode": "app-crm-001"
    },
    "finance": {
      "appcode": "app-finance-002"
    }
  },
  "accessKey": "<lovrabet-access-key>",
  "format": "compress",
  "pageSize": 50,
  "riskLevel": "write",
  "locale": "en-US",
  "region": "cn",
  "userDomain": "https://user.example.com",
  "apiDomain": "https://api.example.com",
  "runtimeDomain": "https://runtime.example.com",
  "skillDomain": "https://skills.example.com",
  "kbDomain": "https://kb.example.com"
}

The complete config, annotated

The version below explains every field and cannot be saved as .lovrabet.json as-is. Before copying it for use, you must remove all // comments and replace the angle-bracket placeholders.

json
{
  // The app alias tried first when no --app or --appcode is given explicitly
  // The value must match one of the keys in apps
  "defaultApp": "crm",

  // Local app aliases; this is not a catalog of platform apps
  // Under the current config contract, each alias stores only the appcode
  "apps": {
    // A local alias — name it whatever fits your business
    "crm": {
      // The Lovrabet App Code this alias points to
      "appcode": "app-crm-001"
    },

    // A second local alias; delete the whole entry if not needed
    "finance": {
      // The Lovrabet App Code for the second alias
      "appcode": "app-finance-002"
    }
  },

  // The Access Key of the Runtime CLI; sensitive — do not commit to Git
  // Writing it via lovrabet auth login into the global config is preferred
  "accessKey": "<lovrabet-access-key>",

  // Default output format: compress, json, or pretty
  // The CLI default is single-line compress JSON, suited to scripting
  "format": "compress",

  // Default page size for commands that support pagination
  "pageSize": 50,

  // Highest risk level allowed to run: read, write, or high-risk-write
  // Defaults to write; only authorized personnel may change it by hand
  "riskLevel": "write",

  // App localization setting; not the CLI interface language, not consumed yet
  "locale": "en-US",

  // Country/region of the official service: cn = mainland China, id = Indonesia
  // Mainland China is the default; region can be omitted
  "region": "cn",

  // HTTPS origin of the login and user services
  "userDomain": "https://user.example.com",

  // HTTPS origin of the platform API
  "apiDomain": "https://api.example.com",

  // HTTPS origin of runtime services such as the common Runtime and File
  "runtimeDomain": "https://runtime.example.com",

  // HTTPS origin of the SkillHub service
  "skillDomain": "https://skills.example.com",

  // HTTPS origin of the knowledge base service
  // Falls back to runtimeDomain or the Runtime address of the current country/region
  "kbDomain": "https://kb.example.com"
}

accessKey is sensitive. Remove the field before committing project files to Git; for day-to-day login, prefer lovrabet auth login so the credential lands in the permission-restricted global config.

Field reference

App selection

FieldTypeDefaultDescription
appcodestringnoneBinds a single App Code directly; suits single-app directories
defaultAppstringnoneDefault app candidate — a local alias or a remote app name
appsobjectnoneLocal alias set; each apps.<alias> supports only appcode

The platform app catalog is queried by lovrabet app list and cached under ~/.lovrabet/cache/. Do not copy the remote app list wholesale into .lovrabet.json.

Authentication, output, and security

FieldTypeDefaultDescription
accessKeystringnoneThe primary credential of the Runtime CLI
formatcompress | json | prettycompressDefault output format; the --format flag wins
pageSizenumbercommand defaultDefault page size for commands that support pagination
riskLevelread | write | high-risk-writewriteHighest risk level allowed to run
localestringen-USApp localization setting, not yet consumed; not the CLI interface language

User-visible text in the Lovrabet CLI is fixed to English; locale does not switch help, prompts, or error messages.

riskLevel is a protected field — both config set and config delete refuse to modify it. When it genuinely needs adjusting, authorized personnel review and hand-edit the corresponding .lovrabet.json. Agents and automation scripts must never escalate it themselves.

Country/region and domains

FieldTypeDefaultDescription
regioncn | idcnCountry/region of the official service; cn = mainland China, id = Indonesia
userDomainHTTPS origincurrent region defaultLogin and user services
apiDomainHTTPS origincurrent region defaultPlatform API
runtimeDomainHTTPS origincurrent region defaultRuntime services such as the common Runtime and File
skillDomainHTTPS origincurrent region defaultSkillHub service
kbDomainHTTPS originfollows runtimeDomainKnowledge base service; an explicit value takes precedence

With the official service, configure only region. Domains are for self-hosted deployments or special routing. A domain must be a trusted HTTPS origin such as https://runtime.example.com — no paths, query strings, fragments, or embedded credentials.

Config merging and app resolution

Ordinary fields resolve in this order, highest priority first:

  1. Flags passed explicitly on the current command.
  2. The current directory's .lovrabet.json.
  3. The global ~/.lovrabet.json.
  4. CLI defaults.

App selection follows two additional rules:

  • An explicit --appcode names the App Code directly; an explicit --app is resolved against local aliases first, then the remote app cache.
  • Without an explicit choice, the top-level appcode or defaultApp serves as the candidate; defaultApp may need the remote cache to resolve.

Scalar fields in the current-directory config override their global namesakes. If the current directory defines apps, it replaces the global apps wholesale — do not assume the two objects are merged for you.

Common commands

Bind the current directory

bash
# Initialize when not yet bound
lovrabet workspace init --app crm

# Switch an existing binding
lovrabet workspace use --app finance

# Bind directly when you know the App Code
lovrabet workspace init --appcode app-crm-001

workspace init is for directories that are not yet bound; workspace use changes an existing binding. Both write only the current-directory config, never the Access Key.

Store the Access Key

bash
lovrabet auth login --access-key <ACCESS_KEY>
lovrabet auth status

auth login writes the Access Key to the global config by default, so it can be shared across working directories. The command output masks the credential.

Initialize the country/region or a self-hosted connection

bash
lovrabet config init --region cn
lovrabet config init --region id
lovrabet config init --domain-config ./lovrabet-domains.json

config init always updates the global connection config and preserves the Access Key, output format, and app bindings. The --domain-config file accepts only userDomain, apiDomain, runtimeDomain, skillDomain, and kbDomain.

Read, write, and delete configuration

bash
# Show the merged config; sensitive fields are masked
lovrabet config list

# Read a single field; dot paths are supported
lovrabet config get apps.crm.appcode

# Write to the current directory by default; .lovrabet.json must already exist there
lovrabet config set format compress
lovrabet config set apps.crm.appcode app-crm-001

# Write explicitly to the global config
lovrabet config set apiDomain https://api.example.com --global

# Delete a field or a local alias from the current directory
lovrabet config delete format
lovrabet config delete apps.crm

# Delete a global field
lovrabet config delete apiDomain --global

If the current directory has no .lovrabet.json, config set and config delete will not fall back to modifying the global file. Bind the directory first, or pass --global explicitly.

Verify the configuration

bash
lovrabet doctor
lovrabet app list

Run doctor first to check the config files, the effective country/region, domains, authentication, and the risk ceiling; then use app list to confirm which apps the current Access Key can access. After changing a domain, probe with read-only commands first — do not test the connection with a write operation.

Compatibility notes

The legacy top-level app is still read as a compatibility alias of appcode; inherit no longer has any effect. Older apps.* entries may carry extra fields, but the current public contract uses only apps.<alias>.appcode — do not write other profile fields into new configurations.

Unknown fields may be preserved, but that does not mean they are supported. The fields listed in this document are the public configuration surface.

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