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:
- Create applications and data tables on the Lovrabet platform
- Use
rabetbase api pullto generate SDK configuration - 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?
| Dimension | Legacy (lovrabet) | New (rabetbase 2.0) |
|---|---|---|
| Command prefix | lovrabet | rabetbase |
| Build & deploy | lovrabet build | rabetbase run build |
| AI integration | MCP Server | Skill (community standard) |
| Command structure | Scattered functionality | Unified 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:
| Mode | Authentication Method | Use Case |
|---|---|---|
| WebAPI | Cookie (browser login) | Frontend applications |
| OpenAPI | AccessKey + SecretKey | Backend 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
| Command | Description |
|---|---|
rabetbase project create | Create a project |
rabetbase api pull | Pull API configuration |
rabetbase dataset detail | View dataset structure |
rabetbase sql validate | Validate SQL syntax |
rabetbase sql save | Save custom SQL |
rabetbase sql exec | Execute custom SQL |
rabetbase bff new | Create a Backend Function |
rabetbase bff push | Push BFF to the platform |
rabetbase menu sync | Sync menus |
rabetbase run build | Build the project |
rabetbase auth login | Login authentication |
rabetbase app list | View 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?
| Scenario | Recommendation |
|---|---|
| Single-table CRUD | SDK's filter/create/update/delete |
| Single-table conditional query | filter + search/filter parameters |
| Cross-table JOIN queries | Custom SQL |
| Complex aggregation | Custom SQL |
| Grouped sum calculations | Custom 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.modelsinstead oftx.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:
rabetbase project createto create the projectrabetbase api pullto generate the SDK- Generate all page code
rabetbase run buildto buildrabetbase menu syncto sync menus
Q20: Why is the AI-generated code incorrect?
Possible reasons:
- Skill not installed -- Run
npx skills add lovrabet/rabetbase --global - API not pulled -- Run
rabetbase api pullto update SDK configuration - Description not specific enough -- Explicitly specify dataset names, field names, and page structure
7. Performance and Security
Q21: How do I optimize list queries?
- Add pagination -- Always pass
currentPageandpageSize - Debounce search -- 300ms debounce
- Only query needed fields -- Avoid
SELECT *in SQL - Add LIMIT -- Restrict the number of rows returned by SQL queries
Q22: What should I do if my AccessKey is leaked?
- Regenerate the AccessKey on the Lovrabet platform
- Update environment variables
- 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:
- Syntax error -- Check with
rabetbase bff statusfirst - Incorrect dataset code -- Check the code in the TABLES constant
- Network issue -- Check your network connection
Q27: SQL execution shows execSuccess as false?
Common causes:
- SQL syntax error (check XML escaping)
- Incorrect table or field name
- 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.