Skip to main content

Rabetbase FAQ

This page collects frequently asked questions about the Rabetbase development system (CLI + SDK + Skill + BaaS). If your question is not listed here, feel free to ask in the Lovrabet community.


1. Basic Concepts

Q1: What is the relationship between Rabetbase and Lovrabet?

Lovrabet is a complete AI-native business system generation platform for all business users and developers.

Rabetbase is Lovrabet's developer infrastructure layer. It provides standardized data access, permission control, and API capabilities to upper-layer applications; and provides developers with a three-piece toolkit of CLI, SDK, and Skill -- enabling the entire workflow from data operations to project deployment in the terminal, without building a backend.

  • Lovrabet Platform

    • AI-native business system generation
    • DB Agent / Vibe Coding / requirement-driven system generation
    • Workbench / permission management
    • Runtime hosting
  • Rabetbase Development System -- part of the Lovrabet Platform

    • CLI: Terminal operation tool
    • SDK: Data access interface
    • Skill: AI-assisted development
    • BaaS: Backend as a Service

Q2: Can I use Rabetbase without backend development experience?

Yes. Rabetbase's BaaS layer has already encapsulated all backend capabilities (database, API, permissions, authentication). You only need to:

  1. Create applications and data tables on the Lovrabet platform
  2. Use rabetbase api pull to generate SDK configuration
  3. Use the SDK's filter, create, update, and delete operations to work with data

The entire process requires no backend code and no server deployment.

Q3: What is the difference between Rabetbase CLI 2.0 and the legacy Lovrabet CLI?

DimensionLegacy (lovrabet)New (rabetbase 2.0)
Command prefixlovrabetrabetbase
Build & deploylovrabet buildrabetbase run build
AI integrationMCP ServerSkill (community standard)
Command structureScattered functionalityUnified service + command two-level structure

If you are still using the legacy Lovrabet CLI, please upgrade to Rabetbase 2.0. The legacy version is no longer maintained.


2. Installation and Configuration

Q4: How do I install the Rabetbase CLI?

After installation, verify:

rabetbase --version
rabetbase --help

Q5: How do I install the Skill?

The Skill is a set of AI-assisted development rules that enable tools like Claude Code and Cursor to use the Rabetbase CLI correctly:

npx skills add lovrabet/rabetbase --global

After installation, the AI in Claude Code will automatically retrieve your dataset structure, and the generated code will mostly work on the first try.

Q6: What authentication methods are available?

Rabetbase supports two authentication modes:

ModeAuthentication MethodUse Case
WebAPICookie (browser login)Frontend applications
OpenAPIAccessKey + SecretKeyBackend services, CLI

Cookie authentication is recommended for frontend use (automatically obtained after the user logs in via the browser), while AccessKey authentication is used for backend and CLI.

Do not hardcode AccessKey in source code! Use environment variables.


3. Common CLI Commands

Q7: How do I create a new project?

rabetbase project create my-app
cd my-app
rabetbase api pull --appcode your-app-code

project create generates a complete project scaffold (including build config, routing, and API client). api pull generates SDK type definitions based on your application's data.

Q8: How do I sync menus to the main application?

rabetbase menu sync

The CLI automatically scans pages under src/pages, intelligently extracts menu names, and creates menus in bulk.

Q9: How do I build and deploy?

rabetbase run build

Build output goes to the dist/ directory and can be deployed directly to a CDN.

Q10: Common CLI Command Quick Reference

CommandDescription
rabetbase project createCreate a project
rabetbase api pullPull API configuration
rabetbase dataset detailView dataset structure
rabetbase sql validateValidate SQL syntax
rabetbase sql saveSave custom SQL
rabetbase sql execExecute custom SQL
rabetbase bff newCreate a Backend Function
rabetbase bff pushPush BFF to the platform
rabetbase menu syncSync menus
rabetbase run buildBuild the project
rabetbase auth loginLogin authentication
rabetbase app listView application list

4. SDK Data Operations

Q11: How do I initialize the SDK client?

Using a singleton pattern is recommended, sharing one client instance across the application:

// src/api/client.ts
import { createClient } from "@lovrabet/sdk";

export const client = createClient({
appCode: "your-app-code",
});

Do not create the client repeatedly in every component.

Q12: How do I use filter, getOne, create, update, and delete?

import { client } from "@/api/client";

// Query list (paginated)
const { tableData, total } = await client.models.customers.filter({
currentPage: 1,
pageSize: 20,
});

// Query a single record
const customer = await client.models.customers.getOne("123");

// Create
const newId = await client.models.customers.create({
name: "John Doe",
phone: "13800138000",
});

// Update
await client.models.customers.update("123", { name: "Jane Smith" });

// Delete (WebAPI mode only)
await client.models.customers.delete("123");

Q13: What should I do if the delete operation throws an error?

The delete operation is only available in WebAPI mode (Cookie authentication). If you are using OpenAPI mode, use a "soft delete" instead:

await client.models.customers.update(id, {
status: "deleted",
deleted_at: new Date().toISOString(),
});


5. SQL and Backend Functions

Q14: When should I use custom SQL?

ScenarioRecommendation
Single-table CRUDSDK's filter/create/update/delete
Single-table conditional queryfilter + search/filter parameters
Cross-table JOIN queriesCustom SQL
Complex aggregationCustom SQL
Grouped sum calculationsCustom SQL

Q15: How do I write custom SQL?

Create a SQL file in the .rabetbase/sql/ directory:

-- @lovrabet sqlName=myQuery description=My query
SELECT
category,
COUNT(*) as count,
SUM(amount) as total
FROM dataset_orders
WHERE 1=1

AND create_time >= #{startDate}

GROUP BY category

Key syntax:

  • #{paramName} -- parameterized query (prevents SQL injection)
  • Conditional fragments should be explicitly concatenated per parameter; avoid raw string injection

Q16: How do I write multi-table operations in a transaction?

await context.client.models.transaction(async ({ models }) => {
// Create main record
const orderId = await models[TABLES.orders].create(orderData);

// Create detail records
for (const item of items) {
await models[TABLES.orderItems].create({ orderId, ...item });
}
});

Key rules:

  • Use context.client.models instead of tx.models
  • Exceptions trigger automatic rollback
  • Do not execute time-consuming operations inside a transaction

6. AI-Assisted Development

Q18: What can the Skill do for me?

The Skill enables AI tools (Claude Code, Cursor) to understand your business data structure, producing code that works on the first try:

  • Automatically retrieves dataset structures (table names, field names, field types)
  • Correctly uses CLI commands (doesn't guess field names)
  • Follows best practices (singleton pattern, error handling, pagination)
  • Automatically executes CLI commands (create projects, pull APIs, push BFF)

Q19: How do I use AI to develop a complete feature?

Just describe the requirement in Claude Code:

Use the Rabetbase CLI to help me create a customer management page with a customer list (with search and pagination), a customer detail page (with editing), and a new customer form (with phone number validation).

The AI will automatically:

  1. rabetbase project create to create the project
  2. rabetbase api pull to generate the SDK
  3. Generate all page code
  4. rabetbase run build to build
  5. rabetbase menu sync to sync menus

Q20: Why is the AI-generated code incorrect?

Possible reasons:

  1. Skill not installed -- Run npx skills add lovrabet/rabetbase --global
  2. API not pulled -- Run rabetbase api pull to update SDK configuration
  3. Description not specific enough -- Explicitly specify dataset names, field names, and page structure

7. Performance and Security

Q21: How do I optimize list queries?

  1. Add pagination -- Always pass currentPage and pageSize
  2. Debounce search -- 300ms debounce
  3. Only query needed fields -- Avoid SELECT * in SQL
  4. Add LIMIT -- Restrict the number of rows returned by SQL queries

Q22: What should I do if my AccessKey is leaked?

  1. Regenerate the AccessKey on the Lovrabet platform
  2. Update environment variables
  3. Check for hardcoded old keys

Never hardcode AccessKey in frontend code. Use Cookie authentication or Token authentication for frontend applications.

Q23: How should I handle sensitive data?

Frontend masking:

const maskPhone = (phone: string) => {
return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
};
// 138****8000

Backend masking (recommended): Use Backend Function post-processing hooks to uniformly process data before it is returned.


8. Troubleshooting

Q24: CLI command reports "command not found"?

Verify the installation path:

which rabetbase
rabetbase --version

If not found, reinstall or check your PATH configuration.

Q25: API calls return 401?

Check authentication status:

rabetbase auth login

If using AccessKey authentication, confirm the environment variable is set:

echo $LOVRABET_ACCESS_KEY

Q26: BFF push fails?

Common causes:

  1. Syntax error -- Check with rabetbase bff status first
  2. Incorrect dataset code -- Check the code in the TABLES constant
  3. Network issue -- Check your network connection

Q27: SQL execution shows execSuccess as false?

Common causes:

  1. SQL syntax error (check XML escaping)
  2. Incorrect table or field name
  3. Parameter type mismatch

Debugging method:

rabetbase sql exec --sqlcode <code> --params '{}' --format json

More questions? Check out these resources: Integration Development Guide, SDK Usage Guide, and CLI Usage Guide, all available at open.lovrabet.com.