API & Datasets: Pull Configuration, Explore Data
This section covers two things: how your local api.ts gets generated, and what datasets, fields, and operations are available on the platform. Prerequisites: you are logged in, and the current App Code and environment are correct (see Configuration).
Why api pull comes first
The dataset aliases and request wrappers used in your frontend typically come from the project's API directory (defaults to ./src/api/, configurable via apiDir). When this falls out of sync with the platform, you may see issues like "alias not found" or "list request failed." It's a good habit to pull in these scenarios:
- Right after joining a project or running
project init - After adding, removing, or modifying datasets or models on the platform
- After switching
appcode/env
Command:
rabetbase api pull
Specify an output directory:
rabetbase api pull --output ./src/api
After pulling, you'll have a local model list aligned with the current App. Downstream commands like codegen and dataset --alias rely on these aliases.
List all models (datasets) under the current application
When you want a quick look in the terminal without opening files:
rabetbase api list
In multi-app mode, models are listed per App based on your configuration (output format can be changed with --format json / table).
Read-only dataset exploration
List datasets (supports server-side filtering, no need to pull everything):
rabetbase dataset list
rabetbase dataset list --name order
rabetbase dataset list --code <32-digit-code>
View full details of a specific dataset (fields, metadata, etc.):
rabetbase dataset detail --code <32-digit-code>
If you've already run api pull, you can use an alias instead of the long code:
rabetbase dataset detail --alias order
See which operations a dataset supports (filter, getOne, create, etc.):
rabetbase dataset operations --alias order
rabetbase dataset operations --alias order --operation filter
Adding --operation shows the parameter definitions for that operation, which is useful when writing BFF scripts or generating code.
Explore relationships between tables
Before writing cross-table queries, complex SQL, or having AI write scripts for you, understanding table relationships can save a lot of rework:
rabetbase dataset links
Filter by database:
rabetbase dataset links --db <database-name-or-ID>
The output includes fields, primary/foreign keys, and association types between datasets. Add --verbose for the raw response.
Generate API documentation (optional)
To export API documentation for the current datasets (default directory and options are listed in rabetbase api doc --help):
rabetbase api doc
rabetbase api doc --datasetcode ds1,ds2
This is useful for sharing with teammates or keeping records. It does not affect your day-to-day development workflow.
Summary
api pull: Keep your local API configuration in sync with the platform.api list: Quickly scan models from the terminal.dataset list/detail/operations: Explore a dataset from overview to details.dataset links: View table and dataset relationships. Worth running before writing SQL or BFF scripts.
Next: To write platform-hosted custom SQL, read Custom SQL: From Authoring to Execution.