Environment variables
The Midcore CLI and optional backend services read configuration from environment variables. Use them for API endpoints, auth, and feature flags so you don’t put secrets in config files.
Common variables
Typical names (exact names may depend on your deployment and version):
| Variable | Purpose | Example |
|---|---|---|
| API base URL | Backend API for agent/gates when not local | https://api.midcore.example.com |
| Auth token / API key | Credentials for API or provider | Set in CI secrets, not in code |
| Log level | Verbosity of CLI or service logs | DEBUG, INFO, WARN, ERROR |
| Config path | Override path to .maestro or config dir | Optional; default is project root |
Next.js web (Docker / self-hosted)
The web app rewrites browser API calls to your backends. Set these in the web container or process:
| Variable | Purpose | Example |
|---|---|---|
| NEXT_PUBLIC_API_URL | Public browser-facing API origin (also fallback if internal URL unset) | https://api.example.com |
| API_INTERNAL_URL | Server-side rewrite target for /api/backend/* and /api/autonomy/* | http://api:8000 |
| AUTH_INTERNAL_URL | Server-side rewrite target for /auth/* (Nest auth service in production compose) | http://auth:3001 |
Docker Compose dev profile
docker compose --profile with-api, the API service is reachable as http://api:8000. OAuth flows need a running auth service; set AUTH_INTERNAL_URL on the web service to match (e.g. http://auth:3001) or run the Nest auth app on the host and point the web container at host.docker.internal:3001 where supported.Production Compose image registry
Images are pulled as ghcr.io/$GHCR_IMAGE_SLUG/api (and /web, /auth). Set GHCR_IMAGE_SLUG to the same GitHub owner/repo lowercase string used by CI (e.g. myorg/maestro-midcore). See Self-hosted deployment.
Secrets
How to set them
CLI / terminal — Export in your shell or in a .env file (and add .env to .gitignore):
# Unix/macOS
export MIDCORE_API_URL=https://api.example.com
# Or use a .env file and load it with your shell or a tool like dotenvCI/CD — Add variables as pipeline secrets and expose them to the job that runs midcore.
IDE / Desktop — Use the app’s settings UI or documented config file; the app may read from env or a user-level config.
Full list
For the complete, up-to-date list of variable names and behavior, run midcore --help and midcore <command> --help, or see the release notes and admin docs for your deployment.