Skip to main content

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):

VariablePurposeExample
API base URLBackend API for agent/gates when not localhttps://api.midcore.example.com
Auth token / API keyCredentials for API or providerSet in CI secrets, not in code
Log levelVerbosity of CLI or service logsDEBUG, INFO, WARN, ERROR
Config pathOverride path to .maestro or config dirOptional; 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:

VariablePurposeExample
NEXT_PUBLIC_API_URLPublic browser-facing API origin (also fallback if internal URL unset)https://api.example.com
API_INTERNAL_URLServer-side rewrite target for /api/backend/* and /api/autonomy/*http://api:8000
AUTH_INTERNAL_URLServer-side rewrite target for /auth/* (Nest auth service in production compose)http://auth:3001

Docker Compose dev profile

With 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

Never commit API keys, tokens, or passwords to the repo. Use your OS or CI secret store (e.g. GitHub Secrets, env files in .gitignore) and reference them by variable name.

How to set them

CLI / terminal — Export in your shell or in a .env file (and add .env to .gitignore):

bash
# 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 dotenv

CI/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.

Settings · CLI reference · Troubleshooting · Glossary