Loading...
Loading...
Lovrabet development workflow CLI — Manage datasets, SQL queries, BFF scripts and code generation via the rabetbase command. Trigger words: dataset, data table, custom SQL, sql.execute, bff.execute, get_dataset_detail, validate_sql_content, save_or_update_custom_sql, @lovrabet/sdk, lovrabet development, rabetbase, filter, codegen.
npx skill4agent add lovrabet/rabetbase rabetbasePrerequisites: Before using any API command, you need to complete authentication and configuration (see below). Mandatory before execution: Before executing any command, you must first read the reference documentation for the corresponding command before invoking it. Naming convention: Uniformly use theformat. Output format: AI Agent must userabetbase <service> <command> [flags]to get structured output.--format json
rabetbase authappcodeapps.rabetbase.json--appcode <code>--app <name>.lovrabet.json.rabetbase.jsonrabetbase project initrabetbase app add--app <name>rabetbase app use <name>rabetbase dataset detail --code xxx --format jsonrabetbase dataset links --format jsonsql validatesql savesql exec--dry-runbff save --yesdataset detailsql validatesql save --dry-runsql listbff listsql savebff saveblockeddataset detailfilter + $inrabetbase sql listlist_sql_queriesimport { createClient } from "@lovrabet/sdk";
const client = createClient({
appCode: "your-app-code",
accessKey: process.env.RABETBASE_ACCESS_KEY,
models: [{ tableName: "users", datasetCode: "abc123", alias: "users" }],
});const result = await client.models.users.filter({
where: { status: { $eq: "active" } },
select: ["id", "name"],
orderBy: [{ createTime: "desc" }],
currentPage: 1,
pageSize: 20,
});selectorderBycurrentPagepageSize$eq$ne$gte$lte$gt$lt$in$contain$startWith$endWithconst data = await client.sql.execute<MyRow>({ sqlCode: "xxx", params: { key: "val" } });
if (data.execSuccess && data.execResult) {
console.log(data.execResult);
}const result = await client.bff.execute<DashboardData>({
scriptName: "getUserDashboard",
params: { userId: "123" },
});| Frontend SDK | BFF (context.client) | |
|---|---|---|
| SQL return value | | Directly return array |
| Single query | | |
| Call BFF | | — |
| Intent | Recommended Command | Remarks |
|---|---|---|
| Find datasets | | Server-side fuzzy matching; you can also use |
| View table structure and fields | | Includes field definitions and operation list |
| View Dataset operation definitions | | Get parameter definitions for filter/getOne/create, etc. |
| View data model relationships | | Cross-table JOIN relationship diagram |
| View existing SQL | | Pagination, filter by name |
| View SQL details | | Includes complete SQL content and parameter definitions |
| Validate SQL content | | Type detection, dangerous statement check, parameter extraction |
| Save/update SQL | | Built-in validation, cannot be skipped |
| Execute SQL query | | Supports |
| View existing BFF | | Filter by type and name |
| View BFF details | | Includes complete script content |
| Save/update BFF | | high-risk-write, requires |
| Generate SDK code | | Generate TypeScript by operation |
| Generate SQL call code | | Two targets: sdk/bff |
| List configured apps | | Multi-app mode |
| Switch default app | | Persistently modify defaultApp |
| Add app | | The first one is automatically set as default |
| Remove app | | Automatically switch default after removal |
| Temporarily switch app for execution | Add | Does not modify configuration file |
Mandatory before execution: After locating the command from the table below, be sure to read the reference documentation for the corresponding command first before invoking it.
| Command Group | Description |
|---|---|
| app commands | |
| dataset commands | |
| sql commands | |
| bff commands | |
| codegen commands | |
| Level | Meaning | Usage |
|---|---|---|
| Read-only query, can be executed at any time | Execute directly |
| Modify data, e.g. | Preview with |
| Affect runtime behavior, e.g. | Must confirm with |
sql savesql validateriskLevel.rabetbase.jsonRABETBASE_RISK_LEVEL.lovrabet.json| Format | Purpose | Example |
|---|---|---|
| AI Agent / program parsing | |
| Human reading (default) | Colored text output |
| List data display | Table output |
| Error Type | Meaning | Solution |
|---|---|---|
| Not logged in | Execute |
| appcode not configured | Run |
| Missing required parameters | Check reference documentation to confirm required flags |
| Input validation failed (including SQL type blocking) | Check SQL content or parameter format |
| Backend API error | Check appcode, network, permissions |
| User cancelled high-risk operation | Use |
| Platform conflict detection | Inform user to operate manually on the platform, write local draft |
sql savebff saveblocked: true.draft.sql.draft.js@modifieddisplayNamedataset detail@ant-design/icons| Topic | Guide |
|---|---|
| SDK full parameters and return values | |
| SQL MyBatis syntax and dynamic SQL | |
| Frontend page development constraints | |
| Troubleshooting manual | |
| BFF script writing specifications | |
| Data interface access specifications | |
| SQL creation workflow details | |
| BFF creation workflow details | |
| Conflict detection and handling | |
| Development quality and best practices | |