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:
| Prerequisite | How to check |
|---|---|
| Rabetbase CLI installed | Run rabetbase --version — you should see a version number |
| Logged in to Lovrabet | Run rabetbase auth login |
| Project directory chosen | In 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:
请在当前目录用 rabetbase 创建一个本地项目工程。
项目名:<项目名>
App Code:<APP_CODE>
创建完成后,请检查:
1. 项目目录是否创建成功
2. `.rabetbase.json` 是否存在
3. `package.json` 的 name 是否已改成项目名
4. 如果依赖没有安装,请进入项目目录执行 `npm install`
5. 最后告诉我启动命令The Agent typically:
- Checks that
rabetbaseis available. - Runs the project creation command.
- Checks the project directory,
.rabetbase.json, andpackage.json. - Runs dependency installation if needed.
- Gives you the start command.
Option 2: create manually in the terminal
If this is your first time, run the interactive wizard directly:
rabetbase project createFollow the prompts through these steps:
- Enter a project name, for example
my-sales-app. - Choose the app to bind.
- If no apps are listed, enter an
App Codemanually. - Skip if you don't want to bind an app yet.
- 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:
rabetbase project create <项目名> --appcode <APP_CODE>You can also use the --name form:
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
| Step | Result |
|---|---|
| Copies the project template | Creates <project-name>/ under the current directory |
Updates package.json | name is set to the project name |
| Installs dependencies | Run during interactive creation |
| Formats the code | Runs code formatting |
Writes .rabetbase.json | Stores the environment, app binding, and creation time |
| Pulls the API config | Attempts 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:
rabetbase api pullStart the project
After creation, go into the project directory and start it:
cd <项目名>
rabetbase run startWhen 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.jsonexists.[ ] The
namein<project-name>/package.jsonis your project name.[ ] If you bound an App Code,
.rabetbase.jsoncontainsappsanddefaultApp.[ ] The start command
rabetbase run startruns successfully.
FAQ
What if it says I need to log in?
Run:
rabetbase auth loginThen 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:
cd <项目名>
rabetbase config set --key appcode --value <APP_CODE>
rabetbase api pullAny 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:
rabetbase project create <项目名> --appcode <APP_CODE> --non-interactiveNon-interactive creation skips dependency installation. When it finishes, go into the project directory and run:
npm install