Configuration Guide
This guide covers how to configure OpenPets and your individual pets.
Environment Configuration
Global Configuration
OpenPets stores global configuration in ~/.openpets/config.json.
Project Configuration
Each project can have its own configuration:
your-project/
├── .pets/
│ └── config.json # Project-specific pet configuration
└── .env # Environment variablesPet Configuration
Each pet has its own configuration in package.json:
json
{
"$schema": "https://pets.raggle.co/config.json",
"name": "@openpets/my-pet",
"envVariables": {
"required": [
{
"name": "MY_API_KEY",
"description": "API key for the service",
"provider": "My Service",
"priority": 1
}
],
"optional": []
}
}Environment Variables
Setting Environment Variables
Using
.envfile (recommended for development):bashMY_API_KEY=your_key_hereUsing
.pets/config.json:json{ "env": { "MY_API_KEY": "your_key_here" } }Using system environment:
bashexport MY_API_KEY=your_key_here
Priority Order
Environment variables are loaded in this order (later overrides earlier):
- System environment
.pets/config.json.envfile
Local vs Remote Pets
- Remote pets: Use
@openpets/pet-nameformat - Local pets: Use
./path/to/pet/index.tsformat
Validation
Validate your configuration:
bash
pets validate