fix: render .env.example template in agentex init#351
Merged
danielmillerp merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
The .env.example.j2 template file exists in every template directory but was missing from the root_templates dict in init.py, so it was silently dropped during project generation. Add it so generated projects include a .env.example with LITELLM_API_KEY and OPENAI_BASE_URL placeholders, guiding users to put credentials in .env instead of manifest.yaml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This PR is targeting The
See |
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
.env.example.j2template file was added to every template directory but never wired intoinit.py, so generated projects silently lacked a.env.example..env.example.j2→.env.exampleto theroot_templatesdict so every template type emits the file.LITELLM_API_KEYdirectly intomanifest.yamlbecause there's no obvious place to put it locally.Test plan
agentex initfor each template type (sync, sync-openai-agents, sync-langgraph, default, default-langgraph, temporal, temporal-openai-agents) and confirm.env.exampleappears in the project root with the expectedLITELLM_API_KEY=/ commentedOPENAI_BASE_URL=placeholders.env.examplesubstitutes{{ agent_name }}correctly in the header comment🤖 Generated with Claude Code
Greptile Summary
Wires the pre-existing
.env.example.j2template into theroot_templatesdict increate_project_structure, so everyagentex initrun now emits a.env.examplefile in the project root. All 7 template directories already contained identical.env.example.j2files, and the{{ agent_name }}placeholder resolves correctly from the existing context dict.Confidence Score: 5/5
Safe to merge — minimal, correct one-line fix with all template files already in place.
Single-line addition to a dict; template files exist in all 7 template directories, the Jinja2 variable resolves correctly, and there are no side effects or regressions.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[agentex init] --> B[User selects template type] B --> C[create_project_structure] C --> D[Render project/ files\nacp.py, workflow.py, etc.] C --> E[Render root_templates] E --> F[.dockerignore] E --> G[.env.example NEW] E --> H[manifest.yaml] E --> I[README.md] E --> J[environments.yaml] E --> K[Dockerfile / pyproject.toml] E --> L[dev.ipynb] G --> M[Written to project root\nwith agent_name substituted]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: render .env.example template in age..." | Re-trigger Greptile