Skip to main content

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:

ScopeFile LocationDescription
Project-level./.rabetbase.json in the project rootApplies only to the current project; takes precedence
Global-level~/.rabetbase.json in the user HOMEShared 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. A .rabetbase.json file will be generated automatically.


3. Configuration Fields Reference

3.1 Top-Level Fields

FieldTypeDefaultDescription
appcodestring--Required (single-app mode). Application code, obtained from the Lovrabet platform. Legacy alias: app
localestring"en-US"Language setting
cookiestring--Inline session cookie. When set, takes precedence over the ~/.lovrabet/cookie file
accessKeystring--Access Key authentication (reserved)
formatstring--Default output format. Accepted values: json, pretty, table
pageSizenumber--Default page size, used by paginated commands such as sql list
riskLevelstring"high-risk-write"Maximum allowed risk level. Accepted values: read, write, high-risk-write. Legacy alias: maxRisk
apiDirstring"./src/api"Output directory for code generated by api pull
template_base_urlstringPlatform default CDNTemplate CDN base URL
defaultAppstring--Default app name in multi-app mode
appsobject--Multi-app configuration. Keys are app names; values are AppProfile objects

3.2 AppProfile Fields (each entry in apps.* in multi-app mode)

FieldTypeDescription
appcodestringRequired. The appcode for this app
apiDirstringOverrides top-level apiDir
cookiestringOverrides top-level cookie
accessKeystringOverrides top-level accessKey
formatstringOverrides top-level format
pageSizenumberOverrides top-level pageSize
riskLevelstringOverrides top-level riskLevel
localestringOverrides top-level locale

4. Single-App Mode

A project connected to a single Lovrabet application.

Minimal Configuration

{
"appcode": "app-7786baaf"
}

Full Configuration Example

{
"appcode": "app-7786baaf",
"riskLevel": "high-risk-write",
"format": "json",
"apiDir": "./src/api"
}

Setting Configuration via Commands

# Set output directory
rabetbase config set apiDir ./src/api

# Set risk level
rabetbase config set riskLevel high-risk-write


5. Multi-App Mode

A project connected to multiple Lovrabet applications, using apps + defaultApp.

Configuration Example

{
"defaultApp": "order",
"apps": {
"order": {
"appcode": "app-8b7d35a1",
"riskLevel": "write"
},
"product": {
"appcode": "app-8b7d35a2",
"apiDir": "./src/api/product"
}
}
}

Managing Multi-App via Commands

# Add an app
rabetbase app add order --appcode app-order-001
rabetbase app add product --appcode app-product-002

# Switch the default app
rabetbase workspace use --app order

# List configured apps
rabetbase app list

# List apps available on the platform for the current login
rabetbase app list --remote

# 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, apiDir, etc.).


6. Precedence Overview

For common fields, read the resolution order like this:

CLI flag (--appcode, --format, --app ...)
|
v
Current project app profile / project-level config
|
v
Global app profile / global-level config
|
v
Built-in defaults

--appcode only uses a value passed on the command line. This prevents commands from accidentally targeting an app left over from another project.

In automation, specify the app explicitly with --app <name> or --appcode <code> instead of relying on implicit context.


7. Command Quick Reference

# View the merged configuration
rabetbase config list

# Read a single config field
rabetbase config get appcode

# Write to project-level configuration
rabetbase config set apiDir ./src/api

# Diagnose configuration issues
rabetbase doctor

# Multi-app management
rabetbase app add <name> --appcode <code>
rabetbase workspace use --app <name>
rabetbase app list
rabetbase app list --remote
rabetbase app remove <name>