envgen schemas are meant to be self-documenting, but the current schema only captures documentation at the variable level. There is no place to attach a human-friendly name or URL for a source (e.g., a dashboard or docs page), and no way to provide resolver-specific descriptions when multiple resolvers point to different places.
This PRD proposes optional documentation fields for sources and resolvers to make schemas clearer without affecting runtime behavior.
Today:
sources.*only allowscommand, so there is no way to attach a friendly name, link, or description for the source itself.variables.*.resolvers[]has no documentation fields, so resolver-specific context must be crammed into the variable description.- When a variable uses multiple resolvers (different systems or dashboards), there is no place to document which resolver points to which location.
- Optional documentation fields for sources and resolvers (no required changes to existing schemas).
- Source-level name + URL so a source can link to a dashboard, console, or homepage.
- Resolver-level name + URL + description so resolver-specific docs can be attached when multiple resolvers exist.
- Schema-only change (purely additive; no behavioral changes to
envgen pull). - Clear naming options with a final recommendation based on existing YAML field patterns.
- Update example schema update envgen.sample.yaml with an additional example with documentation at the resolver level
- Changing how sources are executed or how values are resolved.
- Making these fields required.
- Enforcing strict URL validation beyond basic string checks.
- Adding UI/CLI output changes in this PRD (documentation-only proposal).
Add optional documentation fields to each source definition:
label(string, optional): Human-friendly display name for the source.url(string, optional): Link to a dashboard, admin console, or homepage.description(string, optional): Short explanation of what the source is used for.
Add optional documentation fields to each resolver entry:
label(string, optional): Human-friendly label for this resolver’s source/location.url(string, optional): Link to the resolver-specific dashboard or web page.description(string, optional): Resolver-specific explanation or usage notes.
When docs are rendered:
- Prefer resolver-level
label/url/descriptionwhen present. - Otherwise fall back to source-level fields (if any).
- Variable-level
descriptionremains the primary description of the variable itself.
- envgen.sample.yaml with an additional example with documentation url and label at the resolver level
The existing YAML uses snake_case and descriptive names like source_key, source_instructions, and notes. Based on that, there are multiple reasonable options for the URL field name.
Option A: url (Recommended)
- Pros: Short, consistent with existing unprefixed fields like
description. - Cons: Slightly ambiguous outside of a source/resolver context.
Recommendation: Use url for both sources.* and resolvers[]. The object itself already scopes the meaning, and it aligns with the unprefixed style of description.
sources:
gcloud:
command: "gcloud secrets versions access latest --secret={key} --project={firebase_project}"
label: "Google Cloud Secrets Manager"
url: "https://console.cloud.google.com/security/secret-manager"
description: "Primary secret store for production environments."
variables:
VITE_GOOGLE_CLIENT_ID:
description: "Google OAuth Client ID for Sign-In and Picker"
environments: [local, staging, production]
resolvers:
- environments: [local]
source: manual
label: "Local dev Google Cloud Console"
url: "https://console.cloud.google.com/apis/credentials"
description: "Create a test OAuth client for local development."
- environments: [staging, production]
source: gcloud
label: "Staging/Prod Secrets"
url: "https://console.cloud.google.com/security/secret-manager"
description: "Read from GCP Secret Manager for non-local envs."- Existing schemas remain valid because all new fields are optional.
- No behavioral changes are implied for
envgen pull,envgen check, orenvgen list. - JSON Schema would be extended to allow these new optional fields in
sources.*andresolvers[].
- Should URL values be validated with
format: uri, or remain simple strings? simple string - Should we allow documentation fields on built-in
staticandmanualsources via a separate top-level map (e.g.,source_docs), or only within resolvers? - Should
namebe renamed tolabelto avoid confusion with the map key? Yes