Skip to content

[Feature Request] Configurable schema filename #976

Open

Description

@jdillon

Description

Allow the schema filename to be something other than .env.schema — via an env var, a package.json field, or a config key.

Motivation

Coding agents are commonly sandboxed with a deny rule on .env* so they can't read secret-bearing dotenv files. That rule catches .env.schema too, even though it's committed and holds no values — so the agent can't read or edit the one file it's most useful for it to maintain.

Proposed Solution

No preference on mechanism.

Alternatives

Naming the real file .env-schema and symlinking .env.schema to it. Works, but the symlink has to be explained to everyone who sees it.

--path .env-schema also appears to work, but only applies to that one call site — anything else running varlock load sees no schema.

Activity

  1. pullfrog commented on Aug 1, 2026

    @pullfrog
    Contributor
  2. philmillman commented on Aug 1, 2026

    @philmillman
    Member

    They typically respect .gitignore, so usually a !.env.schema is enough but we will discuss, I've certainly been bitten by this many times.

    Thanks for the issue!

  3. philmillman commented on Aug 3, 2026

    @philmillman
    Member

    @theoephraim I think we'll need to think through how this works with the hierarchy of files that gets loaded, whether this replaces just the .env.schema (likely) or replaces a whole pattern?

  4. theoephraim commented on Sep 7, 2026

    @theoephraim
    Member

    between --path and setting the varlock.loadPath in a package.json, I feel like this is mostly handled?

    If the .env is really the issue, we could potentially either allow swapping the default .env prefix for another, or even a suffix? Or could build in another separate suffix that we always automatically look for - something like *.envs (env-spec) or *.envv (env varlock)? Would likely just be confusing for many people though. It would also increase the number of files we are auto-detecting in many places, but should be fairly negligible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions