Config Schema
OpenPets validates .pets/config.json against a typed schema at runtime.
What gets validated
- Top-level structure (
enabled,disabled,envConfig,petConfig) - Value types for env vars and pet settings
schemaVersioncompatibility
Schema fields
json
{
"$schema": "https://pets.raggle.co/config.json",
"schemaVersion": 1,
"enabled": ["github"],
"disabled": [],
"envConfig": {
"_global": {
"OPENAI_API_KEY": "..."
},
"github": {
"GITHUB_TOKEN": "..."
}
},
"petConfig": {
"_global": {
"readOnly": false
},
"github": {
"readOnly": true,
"metricsEnabled": true
},
"typeform": {
"formId": "abc123"
}
}
}Prompt-safe project defaults
Pets can declare non-secret prompt defaults in their package.json with promptConfig.defaults. When a matching value is present in pets.json under petConfig.<pet>, pets intro includes it in the repo-specific instructions.
Example project config:
json
{
"enabled": ["typeform"],
"petConfig": {
"typeform": {
"formId": "abc123"
}
}
}Only keys declared by the pet are rendered into prompts. Keep credentials in .env.pets or envConfig, not in prompt defaults.
Use pets config to discover and set prompt-safe values:
bash
pets config typeform
pets config typeform set formId abc123Migration behavior
- Missing
schemaVersionis auto-set to1 - Legacy
pluginarrays are migrated toenabled - Unsupported future schema versions return a clear error with fix guidance
SDK exports
PetsConfigSchemafor programmatic validationloadPetsConfigFile(path)for parse + validationparsePetsConfig(raw)for in-memory validationgetConfig<T>(config, petId, key, fallback?)for typed pet/global lookup