Skip to content

fix(cli): a project .env only sets the CLI's own settings - #6565

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/project-env-allowlist
Oct 29, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/project-env-allowlist

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

A project's .env only sets the CLI's own settings. The working directory's .env could set any environment variable for every command except capture; now every command reads the same short list:

  • the credentials HEYGEN_API_KEY, HYPERFRAMES_API_KEY, ELEVENLABS_API_KEY, FIGMA_TOKEN
  • the vision settings that capture already allowed: OPENROUTER_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, the Vertex project, service account, location and model, the OpenRouter and Gemini models, and HYPERFRAMES_VISION_TIMEOUT_MS

HYPERFRAMES_BROWSER_PATH is deliberately not on the list: a project could point it at any program, so it stays something only the user's own environment sets.

A variable already in the environment still wins. Any other key in the file is ignored, and one stderr line names the keys (never their values).

PROJECT_ENV_KEYS in utils/dotEnv.ts is the one list; it replaces CAPTURE_ENV_KEYS, so capture no longer has its own rule. loadProjectDotEnv is the one loader cli.ts calls. The capture-only HYPERFRAMES_NO_CAPTURE_DOTENV opt-out is unchanged.

Decision needed

The key list is a product call. I built it from the keys the docs say a .env supplies plus the vision list; anything a project .env was setting beyond it stops working and prints the stderr line.

The telemetry opt-outs HYPERFRAMES_NO_TELEMETRY and DO_NOT_TRACK stay on the list: they only turn sending off, and a project .env could already set them. HYPERFRAMES_NO_UPDATE_CHECK is left off: from a cloned project it would silence update notices, so it is a separate call.

Tests

dotEnv.test.ts loads a .env with NODE_OPTIONS, HTTPS_PROXY and GEMINI_API_KEY: only the API key is set, one line names the other two, and no value is printed. It fails when the allowlist is removed from the loader. The docs page for the CLI gets one paragraph.

  • fails without the fix: packages/cli/src/utils/dotEnv.test.ts › loadProjectDotEnv › sets the CLI's own settings and ignores every other key, naming them once fails on main's loader, as do keeps a telemetry opt-out from the project .env and cli.dotEnv.test.ts › applies CWD dotenv policy at real CLI startup: init (9 failed). With the fix: 28 passed.
  • Removing the two opt-outs from the list fails keeps a telemetry opt-out from the project .env (1 failed, 12 passed).

@mintlify

mintlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Oct 29, 2026, 12:07 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 142 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

The .env in the working directory could set any environment variable for every
command except capture. It now sets only the keys the CLI reads from a project:
the HeyGen, ElevenLabs and Figma credentials and the vision keys, models, Vertex
settings and timeout. Other keys are ignored, and one stderr line names them.
@miguel-heygen
miguel-heygen force-pushed the fix/project-env-allowlist branch from 0a9654f to 722f917 Compare October 29, 2026 11:59

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES · 1 blocker · 1 important · 0 nits · head 722f917b

  • blocker — PR body: a fix PR needs a fails without the fix: line naming the test. The Tests section describes dotEnv.test.ts ("fails when the allowlist is removed") but never names it on that line. Add e.g. fails without the fix: packages/cli/src/utils/dotEnv.test.ts › loadProjectDotEnv › sets the CLI's own settings and ignores every other key, naming them once.
  • important: the telemetry opt-out stops working from a project .env (inline ↓).
Scope

Read all 6 files at head; branch contains current main. Checked every process.env read under packages/: none of the executable, path, proxy or NODE_* settings belong in a project .env, and the 4 credentials plus the vision list match the docs. No prior reviews. CI (CI, CodeQL, Docs, Windows) was still running at review time; this verdict doesn't depend on it.

Comment thread packages/cli/src/utils/dotEnv.ts Resolved

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · 722f917b → b799c869 — 2 resolved, 0 open, 0 new

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 838f878 Oct 29, 2026
77 of 78 checks passed
@miguel-heygen
miguel-heygen deleted the fix/project-env-allowlist branch October 29, 2026 13:02

This branch was successfully deployed

1 active deployment
staging - docs — b799c869 Deployed Oct 29, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant