Skip to content

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 variables

Pet 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

  1. Using .env file (recommended for development):

    bash
    MY_API_KEY=your_key_here
  2. Using .pets/config.json:

    json
    {
      "env": {
        "MY_API_KEY": "your_key_here"
      }
    }
  3. Using system environment:

    bash
    export MY_API_KEY=your_key_here

Priority Order

Environment variables are loaded in this order (later overrides earlier):

  1. System environment
  2. .pets/config.json
  3. .env file

Local vs Remote Pets

  • Remote pets: Use @openpets/pet-name format
  • Local pets: Use ./path/to/pet/index.ts format

Validation

Validate your configuration:

bash
pets validate

Next Steps