Project Configuration
Lovrabet CLI configuration is stored in the .lovrabetrc file in your project root directory. This file is like your project's "ID card", recording various important configuration information.
Why Do You Need Configuration?
The configuration file lets CLI know:
- What backend application your project corresponds to
- Which environment to run in (development, testing, production)
- Special settings and preferences for the project
This way you don't have to manually enter this information every time.
How to Manage Configuration
Lovrabet CLI provides simple commands to manage configuration:
Set Configuration Item
lovrabet config set <config-name> <config-value>
# Example: Set application code
lovrabet config set app my-awesome-app
View Configuration Item
lovrabet config get <config-name>
# Example: View application code
lovrabet config get app
View All Configurations
lovrabet config list
This will display all configuration items and their corresponding values for the current project.
Common Configuration Items
app - Application Code
This is the most important configuration, telling CLI which backend application your project corresponds to.
# Set application code
lovrabet config set app my-shop-app
# View current setting
lovrabet config get app
When to use:
- When executing
lovrabet api pull, if you don't pass in an application code, CLI will use this configuration - Ensures team members all use the same backend application
Other Configuration Items
| Config Name | Description | Example Value |
|---|---|---|
createdAt | Project creation time | 2024-09-18T10:30:00.000Z |
version | CLI version | 1.0.31 |
lastSync | Last API sync time | 2024-09-18T14:30:00.000Z |
Configuration File Example
A complete .lovrabetrc file might look like this:
{
"app": "my-shop-app",
"createdAt": "2024-09-18T10:30:00.000Z",
"version": "1.0.31",
"lastSync": "2024-09-18T14:30:00.000Z"
}
Note: Don't manually edit this file, it's recommended to use the
lovrabet configcommand to modify configuration. This avoids format errors and configuration conflicts.
Configuration Best Practices
1. Team Collaboration
- Add
.lovrabetrcfile to Git version control - Ensure team members use the same
appconfiguration - Document necessary configuration items in project README
2. Multi-project Management
- Use different
appconfigurations for different projects - Regularly check and update configurations
3. Security Notes
- Don't store sensitive information in configuration files
- When encountering configuration issues, first check
lovrabet config list - Regularly clean up unused configuration items