Skip to content

Load provider keys from a .env at the repo root - #28

Merged
adavila0703 merged 5 commits into
mainfrom
angel/cli-execution-2fa5cf
Nov 24, 2026
Merged

adavila0703 merged 5 commits into
mainfrom
angel/cli-execution-2fa5cf

Conversation

@adavila0703

@adavila0703 adavila0703 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

On startup, thee loads the nearest .env at or above the current directory, stopping at the directory that holds .git. This way the keys for task eval, thee chat and thee run can live in one file at the repo root. Variables already set in the shell win over the file.

  • harness/internal/config/dotenv.go: the loader and parser. It accepts KEY=VALUE, # comments, an export prefix, quoted values and a leading UTF-8 BOM. A malformed line fails with path:line: want KEY=VALUE.
  • harness/cmd/thee/root.go: runs the loader in PersistentPreRunE.
  • .env.example: lists the OpenCode, DeepInfra and OpenAI keys. It's un-ignored, since .env.* was hiding it.
  • TestM0RunE2E now runs the binary from its temp fixture so it never loads a developer's real .env.
  • Changeset: minor, with an **Upgrade:** note about malformed .env lines.

Reviewer notes: the .env is found from the process's working directory, not from -C/--directory. TestVerifyFailureIsLogged (director) failed on main before this PR. After merging main, it should be re-checked against main's TUI/test fixes.

Checks

  • go test ./harness/..., go vet ./harness/..., gofmt (config, e2e and cmd packages pass after merging main)
  • Changeset added
  • Matching doc under docs/harness-architecture/ updated (providers.md)

thee now reads the nearest .env at or above the current directory,
stopping at the directory that holds .git. Shell variables win over the
file, and a malformed line fails with its path and line number.

Adds .env.example and un-ignores it. The M0 e2e test now runs the binary
from its temp fixture so it never picks up a developer's real .env.
…/cli-execution-2fa5cf

# Conflicts:
#	.gitignore
@adavila0703
adavila0703 merged commit b922b09 into main Nov 24, 2026
5 checks passed
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