You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Persist Codex/Gemini auth and fix dev cache permissions
- Restore Poetry/Pip cache ownership for non-root dev user
- Pre-create Codex/Gemini auth dirs to avoid permission issues
- Add Docker volumes/services for Codex/Gemini auth persistence and web login
- Update README with clearer setup and auth instructions
*[If you do not have API keys](#if-you-do-not-have-api-keys)
12
21
*[Interactive CLI Usage in Vim Terminal](#interactive-cli-usage-in-vim-terminal)
13
22
*[Gemini CLI examples](#gemini-cli-examples)
14
23
*[Codex CLI examples](#codex-cli-examples)
@@ -18,7 +27,7 @@
18
27
19
28
<!-- vim-markdown-toc -->
20
29
21
-
## 🧰 About the Template
30
+
## About the Template
22
31
23
32
**vim-python-docker-template** is a lightweight, flexible starting point for
24
33
containerized Python development. It’s especially well-suited for data science
@@ -44,30 +53,34 @@ The configuration is intentionally minimal and easy to adapt. You’re free to:
44
53
45
54
Use it as-is or tailor it to match your team's development workflow.
46
55
47
-
## ✅ Features
56
+
## Features
48
57
49
-
-📦 **Reproducible environments** for Python development
50
-
-🛠 **IDE-like Vim setup**, ready to go out of the box
51
-
-🐍 Supports custom **Python and Poetry** versions
52
-
-🧩 Simple to extend with Jupyter, SQL drivers, and more
53
-
-🔁 Works identically on any machine with Docker
58
+
-**Reproducible environments** for Python development
59
+
-**IDE-like Vim setup**, ready to go out of the box
60
+
- Supports custom **Python and Poetry** versions
61
+
- Simple to extend with Jupyter, SQL drivers, and more
62
+
- Works identically on any machine with Docker
54
63
55
-
## 🧪 Tested with
64
+
## Tested with
56
65
57
66
-**Docker**: `27.3.1` – `29.1.1`
58
67
-**buildx**: `0.20.0` – `0.30.0`
59
68
-**Compose**: `2.32.1` – `2.40.3`
60
69
61
70
## 🚀 Getting Started
62
71
63
-
1. Configure environment and Python settings and API tokens
72
+
### 1. Configure environment and Python settings and API tokens
73
+
74
+
Set OS packages, `DOCKER_PLATFORM` (if not linux/amd64), a released
75
+
`PYTHON_VERSION`, Poetry version, etc., and your API keys for `OPENAI_API_KEY`
76
+
and `GEMINI_API_KEY`.
64
77
65
78
```bash
66
79
cp .env.dist .env
67
-
vim .env# Set OS packages, DOCKER_PLATFORM (if not linux/amd64), a released PYTHON_VERSION, Poetry version, etc., and your API keys for OPENAI_API_KEY and GEMINI_API_KEY.
80
+
vim .env
68
81
```
69
82
70
-
2. Set up Python project dependencies
83
+
### 2. Set up Python project dependencies
71
84
72
85
```bash
73
86
vim pyproject.toml # Edit dependencies, metadata, etc.
@@ -76,7 +89,7 @@ docker compose run --rm poetry lock # Generate or update poetry.lock
- Optional: Run Codex or Gemini (see more examples below)
117
-
- Note: `codex` and `gemini` CLIs are installed during the image build via Arch packages (`openai-codex`, `gemini-cli`) configured in `VIM_PACKAGES` inside `.env`.
129
+
### Optional: Run Codex or Gemini (see more examples below)
130
+
131
+
> 🔄 Note: `codex` and `gemini` CLIs are installed during the image build via
132
+
> Arch packages (`openai-codex`, `gemini-cli`) configured in `VIM_PACKAGES`
133
+
> inside `.env`.
118
134
119
135
```bash
120
136
docker compose build codex
@@ -126,7 +142,7 @@ docker compose build gemini
126
142
docker compose run --rm gemini
127
143
```
128
144
129
-
- Optional: Run JupyterLab
145
+
###Optional: Run JupyterLab
130
146
131
147
```bash
132
148
docker compose build jupyterlab
@@ -145,6 +161,33 @@ Vim—so you can inspect, generate, and reason about code without breaking flow.
145
161
NOTE: To use AI CLI tools such as Gemini or Codex, you must configure API keys
146
162
according to each provider’s official documentation.
147
163
164
+
### If you do not have API keys
165
+
166
+
API keys for Codex and Gemini require separate billing. In some cases, you can
167
+
use an OpenAI subscription (for example, ChatGPT Pro) or take advantage of the
168
+
available limits of a personal Google account.
169
+
170
+
This type of access requires authentication via a browser. For OpenAI, run the
171
+
command:
172
+
173
+
```bash
174
+
docker compose run --rm codex-web-login
175
+
```
176
+
177
+
For Gemini, there is no separate command — just run Gemini like
178
+
179
+
```bash
180
+
docker compose run --rm gemini
181
+
```
182
+
183
+
and choose “Login with Google.”
184
+
185
+
After completion, the authorization file will be saved to
186
+
`${DOCKER_USER_HOME}/.codex` or `${DOCKER_USER_HOME}/.gemini`. In this template,
187
+
those directories are persisted between runs via the `codex-auth` and
188
+
`gemini-auth` Docker volumes, which allows the agent CLI tool to be restarted
189
+
without any additional authentication steps.
190
+
148
191
### Interactive CLI Usage in Vim Terminal
149
192
150
193
For a more integrated workflow, you can use the Gemini and Codex CLIs directly
@@ -240,14 +283,14 @@ productivity and designed to work out of the box — but is fully customizable.
240
283
241
284
✨ Core Capabilities
242
285
243
-
- ✅ Syntax highlighting & intelligent folding
244
-
- ✅ Autocompletion and LSP features via `coc.nvim`
245
-
- ✅ Linting, formatting, and diagnostics
246
-
- ✅ Git integration and diff signs
247
-
- ✅ Markdown editing with ToC, folding, and preview support
248
-
- ✅ Snippets, code actions, and refactoring shortcuts
249
-
- ✅ Enhanced status line, file tree, and fuzzy finding
250
-
- ✅ Python-focused indentation, folding, and style enforcement
286
+
* Syntax highlighting & intelligent folding
287
+
* Autocompletion and LSP features via `coc.nvim`
288
+
* Linting, formatting, and diagnostics
289
+
* Git integration and diff signs
290
+
* Markdown editing with ToC, folding, and preview support
291
+
* Snippets, code actions, and refactoring shortcuts
292
+
* Enhanced status line, file tree, and fuzzy finding
293
+
* Python-focused indentation, folding, and style enforcement
0 commit comments