Configuration Reference
This document covers the rabetbase-cli configuration system, including config file fields, single-app and multi-app modes, and managing configuration through CLI commands.
1. Configuration File Overview
rabetbase-cli uses JSON configuration files organized into two scopes:
| Scope | File Location | Description |
|---|---|---|
| Project-level | ./.rabetbase.json in the project root | Applies only to the current project; takes precedence |
| Global-level | ~/.rabetbase.json in the user HOME | Shared across all projects; acts as a fallback |
Lookup precedence: .rabetbase.json > .lovrabet.json > .lovrabetrc (legacy names supported)
Merge rules: Project-level overrides global-level. Scalar fields are replaced directly; apps is deep-merged.
2. Initializing Configuration
# Interactively create a project configuration
cd your-project/
rabetbase project init
Follow the prompts to enter your AppCode and environment. A .rabetbase.json file will be generated automatically.
3. Configuration Fields Reference
3.1 Top-Level Fields
| Field | Type | Default | Description |
|---|---|---|---|
appcode | string | -- | Required (single-app mode). Application code, obtained from the Lovrabet platform. Legacy alias: app |
env | string | "production" | Environment. Accepted values: production, daily. online is automatically mapped to production |
locale | string | "en-US" | Language setting |
cookie | string | -- | Inline session cookie. When set, takes precedence over the ~/.lovrabet/cookie file |
accessKey | string | -- | Access Key authentication (reserved) |
format | string | -- | Default output format. Accepted values: json, pretty, table |
pageSize | number | -- | Default page size, used by paginated commands such as sql list |
riskLevel | string | "high-risk-write" | Maximum allowed risk level. Accepted values: read, write, high-risk-write. Legacy alias: maxRisk |
apiDir | string | "./src/api" | Output directory for code generated by api pull |
template_base_url | string | Platform default CDN | Template CDN base URL |
defaultApp | string | -- | Default app name in multi-app mode |
apps | object | -- | Multi-app configuration. Keys are app names; values are AppProfile objects |
apiDomain | string | Platform default | Custom API domain (for self-hosted deployments) |
userDomain | string | Platform default | Custom user domain |
runtimeDomain | string | Platform default | Custom runtime domain |
3.2 AppProfile Fields (each entry in apps.* in multi-app mode)
| Field | Type | Description |
|---|---|---|
appcode | string | Required. The appcode for this app |
env | string | Overrides top-level env |
apiDir | string | Overrides top-level apiDir |
cookie | string | Overrides top-level cookie |
accessKey | string | Overrides top-level accessKey |
format | string | Overrides top-level format |
pageSize | number | Overrides top-level pageSize |
riskLevel | string | Overrides top-level riskLevel |
locale | string | Overrides top-level locale |
4. Single-App Mode
A project connected to a single Lovrabet application.
Minimal Configuration
{
"appcode": "app-7786baaf",
"env": "daily"
}
Full Configuration Example
{
"appcode": "app-7786baaf",
"env": "daily",
"riskLevel": "high-risk-write",
"format": "json",
"apiDir": "./src/api"
}
Setting Configuration via Commands
# Set environment
rabetbase config set env daily
# Set output directory
rabetbase config set apiDir ./src/api
# Set risk level
rabetbase config set riskLevel high-risk-write
# Write to global configuration (add --global)
rabetbase config set apiDomain https://your-api.example.com --global
5. Multi-App Mode
A project connected to multiple Lovrabet applications, using apps + defaultApp.
Configuration Example
{
"defaultApp": "order",
"apps": {
"order": {
"appcode": "app-8b7d35a1",
"env": "daily",
"riskLevel": "write"
},
"product": {
"appcode": "app-8b7d35a2",
"env": "production",
"apiDir": "./src/api/product"
}
}
}
Managing Multi-App via Commands
# Add an app
rabetbase app add order --appcode app-order-001 --env daily
rabetbase app add product --appcode app-product-002
# Switch the default app
rabetbase app use order
# List configured apps
rabetbase app list
# Remove an app
rabetbase app remove product
Specifying an App with --app
Use --app to switch the target app when running a command:
# Query datasets for the "order" app
rabetbase dataset list --app order
# Query SQL for the "product" app
rabetbase sql list --app product
# Pull APIs for the "order" app
rabetbase api pull --app order
Specifying Appcode Directly with --appcode
If you know the appcode but don't want to set up an app profile, you can pass --appcode directly:
rabetbase dataset list --appcode app-8b7d35a1
The CLI will automatically look up the matching profile in apps (for cookie, env, etc.).
6. Self-Hosted Domain Configuration
If Lovrabet is deployed under a custom domain, override the defaults with these three fields:
# Write to global configuration (applies to all projects)
rabetbase config set apiDomain https://your-api.example.com --global
rabetbase config set userDomain https://your-user.example.com --global
rabetbase config set runtimeDomain https://your-runtime.example.com --global
You can also add them directly to the project configuration:
{
"appcode": "app-xxx",
"apiDomain": "https://your-api.example.com",
"userDomain": "https://your-user.example.com",
"runtimeDomain": "https://your-runtime.example.com"
}
7. Environment Variables
All environment variables use the RABETBASE_ prefix. The legacy prefix LOVRABET_ is also supported. Since v2.2.2, business-target fields are more conservative: RABETBASE_APPCODE / LOVRABET_APPCODE do not override project config automatically. If a script stores AppCode in an environment variable, pass it explicitly with --appcode.
| Environment Variable | Config Field | Description |
|---|---|---|
RABETBASE_APPCODE | -- | Shell variable for scripts; pass it explicitly to --appcode. Commands stop if this variable conflicts with the resolved app |
RABETBASE_ENV | env | Environment fallback when the project does not define one |
RABETBASE_COOKIE | cookie | Session cookie |
RABETBASE_ACCESS_KEY | accessKey | Access Key |
RABETBASE_FORMAT | format | Output format |
RABETBASE_PAGE_SIZE | pageSize | Page size |
RABETBASE_RISK_LEVEL | riskLevel | Maximum risk level |
RABETBASE_VERBOSE | -- | Global verbose switch (1 or true) |
RABETBASE_APP | -- | Specify app name at runtime (equivalent to --app) |
CI environment example:
export RABETBASE_APPCODE=app-xxx
export RABETBASE_ENV=daily
rabetbase dataset list --appcode "$RABETBASE_APPCODE"
8. Precedence Overview
For common fields, read the resolution order like this:
CLI flag (--appcode, --env, --format, --app ...)
|
v
Current project app profile / project-level config
|
v
Helper environment variables (RABETBASE_APP, RABETBASE_ENV)
|
v
Global app profile / global-level config
|
v
Built-in defaults
--appcode is the exception: it only uses a value passed on the command line. Even if RABETBASE_APPCODE exists in the shell, the CLI will not silently use it as the business AppCode. This prevents commands from accidentally targeting an app left over from another project.
Environment variables are best used in these two cases:
# 1. Select a configured app profile for this shell command
RABETBASE_APP=order rabetbase dataset list
# 2. Keep AppCode in CI, but pass it explicitly
rabetbase dataset list --appcode "$RABETBASE_APPCODE"
9. Command Quick Reference
# View the merged configuration
rabetbase config list
# Read a single config field
rabetbase config get apiDomain
# Write to project-level configuration
rabetbase config set env daily
# Write to global configuration
rabetbase config set apiDomain https://custom-api.example.com --global
# Diagnose configuration issues
rabetbase doctor
# Multi-app management
rabetbase app add <name> --appcode <code>
rabetbase app use <name>
rabetbase app list
rabetbase app remove <name>