Skip to content

Commit eac56e8

Browse files
committed
feat(templates): scaffold a .gitignore that excludes .env and .venv
agentex init writes an .env.example and tells users to create .env with their API key, and the Dockerfile path is protected by .dockerignore, but no template ships a .gitignore. A user who git-inits the scaffolded folder commits .env (and .venv) on the first add. Add a .gitignore to every template (secrets, Python artifacts, tool caches; .env.example stays committable) and a test asserting each scaffold renders it. Claude-Session: https://claude.ai/code/session_01HCVKnA7LeJZ44nxZz1uzF3
1 parent 0db6037 commit eac56e8

21 files changed

Lines changed: 392 additions & 0 deletions

File tree

‎src/agentex/lib/cli/commands/init.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def create_project_structure(
9999
# Create root files
100100
root_templates = {
101101
".dockerignore.j2": ".dockerignore",
102+
".gitignore.j2": ".gitignore",
102103
".env.example.j2": ".env.example",
103104
"manifest.yaml.j2": "manifest.yaml",
104105
"README.md.j2": "README.md",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Secrets and local config
2+
.env
3+
.env.*
4+
!.env.example
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
.venv/
10+
venv/
11+
*.egg-info/
12+
build/
13+
dist/
14+
15+
# Tooling
16+
.ipynb_checkpoints/
17+
.pytest_cache/
18+
.ruff_cache/
19+
.mypy_cache/
20+
.DS_Store

0 commit comments

Comments
 (0)