DocsCLIConfiguration

Configuration

The Remodel CLI uses a .remodel JSON file at the project root to persist settings across commands. This file is created by remodel init and read by all other commands.


The .remodel File

.remodel
{
  "language": "typescript",
  "platform": "react",
  "modelsDirectory": "./src/models"
}

Fields

FieldTypeValuesDescription
languagestring"typescript" or "javascript"Default language for generated files
platformstring"react" or "react-native"Default platform for components
modelsDirectorystringrelative pathPath to the models directory (relative to project root)

How It Works

When a .remodel config exists, the CLI uses it to fill in defaults:

  • remodel generate model --name user — uses language and modelsDirectory from config, so you don’t need --ts and --dir
  • remodel component --name UserProfile — uses language and platform from config
  • Interactive mode — skips the language/platform selection steps if config provides them

You can always override config values with explicit flags:

# Config says typescript, but generate JavaScript for this one model
remodel generate model --name legacy --js --dir ./old-models

Creating the Config

The config file is created automatically by remodel init:

remodel init --ts --platform react --dir ./src/models

You can also create or edit the .remodel file manually. It’s a plain JSON file.


Package Manager Detection

The init command automatically detects your package manager when installing @blue-functor/remodel. It checks for lock files in this order:

Lock filePackage manager
bun.lockb or bun.lockbun
pnpm-lock.yamlpnpm
yarn.lockyarn
package-lock.jsonnpm

If no lock file is found, it falls back to npm.

💡

Add .remodel to your .gitignore if you don’t want to share project settings across team members. Keep it in version control if you want consistent defaults for everyone.