feat(cli): configurable env loading (--env-file + dawn.config env)#180
Open
blove wants to merge 11 commits into
Open
feat(cli): configurable env loading (--env-file + dawn.config env)#180blove wants to merge 11 commits into
blove wants to merge 11 commits into
Conversation
dawn dev/verify resolve the env file via precedence: --env-file flag > dawn.config.ts `env` > default ./.env. Shell still wins over file contents. Unifies dev + verify behind one resolver. Deploy artifact (langgraph.json env) unchanged — config.env is local-only. Researched prior art (LangGraph CLI, Vite, Next, Nx, Turborepo, Node --env-file); chose declared-path-over-discovery. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8 tasks: DawnConfig.env field, resolveEnvPath resolver (TDD), loadEnvFile→loadEnvFiles refactor (TDD), dev-session wiring, --env-file on dawn dev + verify (TDD), monorepo integration test, lint/build/test/PR. Deploy artifact untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixes the CLI surface check in scripts/check-docs.mjs, which requires every long option in the commander registry to be referenced in cli.mdx. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dawn dev/dawn verifyresolve the.envto load via precedence:Shell-exported vars still win over file contents. This unblocks monorepo apps — a nested app sets
env: "../../.env"and loads the workspace-root.env.DawnConfig.envfield (local-only; does not affect the deploy artifact).--env-file <path>flag ondawn devanddawn verify.resolveEnvPathresolver;devandverifynow agree on which file they read (killed the prior two-code-path drift).loadEnvFile(dir)→loadEnvFiles(absPaths)(back-compat wrapper retained); LangSmith auto-trace preserved; shell-wins preserved.langgraph.jsonenv detection (.env.example→.env) unchanged by design.Researched prior art (LangGraph CLI, Vite, Next, Nx, Turborepo, Node
--env-file) → chose declared-path-over-discovery (upward auto-merge is the Nx cautionary tale).Spec:
docs/superpowers/specs/2026-05-29-configurable-env-loading-design.mdPlan:
docs/superpowers/plans/2026-05-29-configurable-env-loading.mdNotable implementation notes
checkDependencies(appRoot)→checkDependencies({ appRoot, envFile? }), now async (loads dawn config); return type unchanged, caller updated.exactOptionalPropertyTypesis on, so optional fields are?: T | undefinedwith spread-guarded call sites.dev-commandtest mirrors the existing real-subprocess harness (assertsLoaded N variable(s) from custom.envin stdout), no mock invented.Test plan
pnpm --filter @dawn-ai/cli test— 174 passing (baseline 159 + 15 new)pnpm --filter @dawn-ai/cli lint && pnpm --filter @dawn-ai/core lintcleanpnpm --filter @dawn-ai/core build && pnpm --filter @dawn-ai/cli buildgreendawn devin a nested app withenv: "../.env"loads the parent file🤖 Generated with Claude Code