Project Configuration
Lovrabet CLI configuration information is saved in the .lovrabetrc file in the 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 the CLI know:
- Which backend application your project corresponds to
- Which environment it's running in (development, testing, production)
- Special settings and preferences for your project
This way you don't need 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 Configuration
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 the 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 no application code is passed, the CLI will use this configuration - Ensures team members 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 edit this file manually. 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 the
.lovrabetrcfile to Git version control - Ensure team members use the same
appconfiguration - Document necessary configuration items in the project README
2. Multi-Project Management
- Different projects use different
appconfigurations - Regularly check and update configuration
3. Security Notes
- Don't store sensitive information in configuration files
- When encountering configuration issues, check
lovrabet config listfirst - Regularly clean up unused configuration items