Skip to content

TIP

This document explains how to create a local Lovrabet project with rabetbase. When creation finishes, you get a runnable frontend project plus a generated .rabetbase.json config file. If you only need to add config to an existing project, use rabetbase project init.

Prerequisites

Confirm three things before you start:

PrerequisiteHow to check
Rabetbase CLI installedRun rabetbase --version — you should see a version number
Logged in to LovrabetRun rabetbase auth login
Project directory chosenIn your terminal, go to the parent directory where you want the project

If you already have a Lovrabet app to bind, have its App Code ready. If not, you can skip this for now and configure it after the project is created.


Option 1: create in Claude Code

In Claude Code, simply describe the project you want, and let the Agent run rabetbase and check the results.

Copy the prompt below and replace the project name and App Code with your own:

text
请在当前目录用 rabetbase 创建一个本地项目工程。

项目名:<项目名>
App Code:<APP_CODE>

创建完成后,请检查:
1. 项目目录是否创建成功
2. `.rabetbase.json` 是否存在
3. `package.json` 的 name 是否已改成项目名
4. 如果依赖没有安装,请进入项目目录执行 `npm install`
5. 最后告诉我启动命令

The Agent typically:

  1. Checks that rabetbase is available.
  2. Runs the project creation command.
  3. Checks the project directory, .rabetbase.json, and package.json.
  4. Runs dependency installation if needed.
  5. Gives you the start command.

Option 2: create manually in the terminal

If this is your first time, run the interactive wizard directly:

bash
rabetbase project create
🎬 Video coming soon: rabetbase-cli-project-create.mp4

Follow the prompts through these steps:

  1. Enter a project name, for example my-sales-app.
  2. Choose the app to bind.
  3. If no apps are listed, enter an App Code manually.
  4. Skip if you don't want to bind an app yet.
  5. Wait for the CLI to finish creating the project, installing dependencies, formatting the code, and writing the config.

WARNING

Project names may only contain letters, digits, -, and _, and must not collide with an existing folder in the current directory.

Project name and App Code already decided

If both are already settled, run:

bash
rabetbase project create <项目> --appcode <APP_CODE>

You can also use the --name form:

bash
rabetbase project create --name <项目> --appcode <APP_CODE>

Without --appcode, the CLI enters the app selection flow; if no apps are available, you can enter one manually or skip.


What the creation process generates

StepResult
Copies the project templateCreates <project-name>/ under the current directory
Updates package.jsonname is set to the project name
Installs dependenciesRun during interactive creation
Formats the codeRuns code formatting
Writes .rabetbase.jsonStores the environment, app binding, and creation time
Pulls the API configAttempts to generate src/api/ when an App Code is bound

If the API config pull fails, the project directory is kept. Go into the project directory and run again:

bash
rabetbase api pull

Start the project

After creation, go into the project directory and start it:

bash
cd <项目>
rabetbase run start

When it starts successfully, the terminal prints the local URL. Open it to view your local project pages.

Verify the result

  • [ ] A <project-name>/ folder exists in the current directory.

  • [ ] <project-name>/.rabetbase.json exists.

  • [ ] The name in <project-name>/package.json is your project name.

  • [ ] If you bound an App Code, .rabetbase.json contains apps and defaultApp.

  • [ ] The start command rabetbase run start runs successfully.


FAQ

What if it says I need to log in?

Run:

bash
rabetbase auth login

Then create the project again after logging in.

The project directory already exists

Use a different project name, or switch to another parent directory and run it again.

I skipped the App Code during creation — how do I add it later?

Configure the App Code from inside the project directory, then pull the API config:

bash
cd <项目>
rabetbase config set --key appcode --value <APP_CODE>
rabetbase api pull

Any difference when creating in CI or a non-interactive environment?

A non-interactive environment requires the project name up front, ideally with the App Code:

bash
rabetbase project create <项目> --appcode <APP_CODE> --non-interactive

Non-interactive creation skips dependency installation. When it finishes, go into the project directory and run:

bash
npm install

基于飞书知识库同步生成,内容以飞书源文档为准