1616 * [ 4. Start developing inside the container] ( #4-start-developing-inside-the-container )
1717 * [ 5. Update dependencies when needed] ( #5-update-dependencies-when-needed )
1818 * [ Build and run your application] ( #build-and-run-your-application )
19+ * [ Optional: Use ` dev ` for checks and experiments] ( #optional-use-dev-for-checks-and-experiments )
1920 * [ Optional: Run Codex or Gemini (see more examples below)] ( #optional-run-codex-or-gemini-see-more-examples-below )
2021 * [ Optional: Run JupyterLab] ( #optional-run-jupyterlab )
2122* [ 💻 AI-Powered CLI Workflow (Gemini & Codex)] ( #-ai-powered-cli-workflow-gemini--codex )
@@ -67,19 +68,22 @@ Use it as-is or tailor it to match your team's development workflow.
6768
6869## Tested with
6970
70- * ** Docker** : ` 27.3.1 ` – ` 29.1 .1 `
71- * ** buildx** : ` 0.20.0 ` – ` 0.30.0 `
72- * ** Compose** : ` 2.32.1 ` – ` 2.40.3 `
71+ * ** Docker** : ` 27.3.1 ` – ` 29.2 .1 `
72+ * ** buildx** : ` 0.20.0 ` – ` 0.31.1 `
73+ * ** Compose** : ` 2.32.1 ` – ` 5.0.2 `
7374
7475## Prerequisites
7576
76- * Docker + Docker Compose v2 (and ` docker buildx ` )
77+ * Docker Engine with ` docker compose ` v2.0+ (minimum). Tested versions are
78+ listed above.
79+ * ` docker buildx ` is required only for cross-platform builds (when
80+ ` DOCKER_PLATFORM ` differs from your host). For native builds, it’s optional.
7781* A supported ` DOCKER_PLATFORM ` for your machine (for example, Apple Silicon
7882 users often set ` DOCKER_PLATFORM=linux/arm64 ` )
79- * Note: the ` codex-web-login ` service uses ` network_mode: host ` ( works on
80- Linux; Docker Desktop users may need an alternative login flow) . If needed,
81- authenticate on the host (outside Docker) and use ` OPENAI_API_KEY ` /
82- ` GEMINI_API_KEY ` inside the containers.
83+ * Note: the ` codex-web-login ` service uses ` network_mode: host ` . This works on
84+ Linux, and on macOS with recent Docker Desktop or OrbStack . If it doesn’t
85+ work in your setup, authenticate on the host (outside Docker) and use
86+ ` OPENAI_API_KEY ` / ` GEMINI_API_KEY ` inside the containers.
8387
8488## Quickstart
8589
@@ -91,13 +95,38 @@ docker compose run --rm vim-ide
9195
9296To exit Vim: ` :q ` (or ` :qa ` to quit all).
9397
98+ If you just want a shell in the dev environment:
99+
100+ ``` bash
101+ docker compose build dev
102+ docker compose run --rm dev
103+ ```
104+
94105## 🚀 Getting Started
95106
96107### 1. Configure environment and Python settings and API tokens
97108
98- Set OS packages, ` DOCKER_PLATFORM ` (if not linux/amd64), a ` PYTHON_VERSION `
99- available via ` pyenv ` , Poetry version, etc., and your API keys for
100- ` OPENAI_API_KEY ` and ` GEMINI_API_KEY ` .
109+ Set the ` .env ` values used by ` compose.yaml ` and the Docker build. Common ones:
110+
111+ * ` TZ ` — Container timezone (e.g. ` Europe/Berlin ` , ` Asia/Vladivostok ` ).
112+ * ` DOCKER_PLATFORM ` — Target architecture (e.g. ` linux/amd64 ` , ` linux/arm64 ` ).
113+ * ` DOCKER_HOST_UID ` / ` DOCKER_HOST_GID ` — Host user/group IDs for file ownership.
114+ * ` DOCKER_USER ` / ` DOCKER_USER_HOME ` — Container user + home directory.
115+ * ` MIRROR_LIST_COUNTRY ` — Arch mirror country code for pacman.
116+ * ` BUILD_PACKAGES ` — System packages needed to build Python and runtime deps.
117+ * ` VIM_PACKAGES ` — Extra tools installed in the dev/vim images.
118+ * ` PYTHON_VERSION ` — Python version installed via pyenv.
119+ * ` POETRY_VERSION ` — Poetry version installed in the image.
120+ * ` POETRY_OPTIONS_APP ` — Poetry install flags for the app image.
121+ * ` POETRY_OPTIONS_DEV ` — Poetry install flags for the dev image.
122+ * ` PIP_DEFAULT_TIMEOUT ` — Pip network timeout (seconds).
123+ * ` JUPYTER_TOKEN ` — Token for JupyterLab login.
124+ * ` OPENAI_API_KEY ` — API key for Codex.
125+ * ` GEMINI_API_KEY ` — API key for Gemini.
126+
127+ Set ` DOCKER_HOST_UID ` / ` DOCKER_HOST_GID ` to match your host user so files
128+ created in the container are editable on the host. On Unix-like systems, use
129+ ` id -u ` and ` id -g ` to get the correct values.
101130
102131``` bash
103132cp .env.dist .env
@@ -150,15 +179,46 @@ docker compose build app
150179docker compose run --rm app
151180```
152181
153- > ℹ️ ` vim-ide ` , ` poetry ` , ` codex ` , ` gemini ` , and ` jupyterlab ` bind-mount your
154- > working directory into the container for live editing. ` app ` is a “packaged”
155- > image (it copies your sources), so code changes require rebuilding ` app ` .
182+ > ℹ️ ` vim-ide ` , ` poetry ` , ` codex ` , ` gemini ` , ` jupyterlab ` , and ` dev ` bind-mount
183+ > your working directory into the container for live editing. ` app ` is a
184+ > “packaged” image (it copies your sources), so code changes require rebuilding
185+ > ` app ` .
186+
187+ ### Optional: Use ` dev ` for checks and experiments
188+
189+ ` dev ` is a general-purpose image for running tools, scripts, and ad-hoc checks
190+ inside the same environment as your Vim IDE.
191+
192+ ` dev ` and ` vim-ide ` are built from the same base stage, so they share the same
193+ tooling and system packages.
194+
195+ ``` bash
196+ docker compose build dev
197+ docker compose run --rm dev
198+ ```
199+
200+ Examples:
201+
202+ ``` bash
203+ docker compose run --rm dev ruff check
204+ docker compose run --rm dev ruff format --check
205+ ```
206+
207+ If you’re running as the non-root user and want to try extra system packages
208+ before baking them into the image, use ` sudo ` :
209+
210+ ``` bash
211+ docker compose run --rm dev sudo pacman -S --noconfirm < package>
212+ ```
156213
157214### Optional: Run Codex or Gemini (see more examples below)
158215
159216> 🔄 Note: ` codex ` and ` gemini ` CLIs are installed during the image build via
160217> Arch packages (` openai-codex ` , ` gemini-cli ` ) configured in ` VIM_PACKAGES `
161218> inside ` .env ` .
219+ >
220+ > ` vim-ide ` does not carry API keys or auth volumes, so run Codex/Gemini in a
221+ > separate terminal via their own services.
162222
163223``` bash
164224docker compose build codex
@@ -182,9 +242,10 @@ docker compose run --rm --service-ports jupyterlab
182242
183243This project template is designed to be easily integrated with powerful CLI
184244tools like Gemini and Codex, enhancing your development workflow with
185- intelligent assistance. Rather than replacing your editor, these tools
186- complement Vim by running alongside it in a terminal—either inside or outside
187- Vim—so you can inspect, generate, and reason about code without breaking flow.
245+ intelligent assistance. Rather than replacing your editor, these tools
246+ complement Vim by running alongside it in a separate terminal (via
247+ ` docker compose run ` ) so you can inspect, generate, and reason about code
248+ without breaking flow.
188249
189250NOTE: To use AI CLI tools such as Gemini or Codex, you must configure API keys
190251according to each provider’s official documentation.
@@ -195,14 +256,15 @@ API keys for Codex and Gemini require separate billing. In some cases, you can
195256use an OpenAI subscription (for example, ChatGPT Pro) or take advantage of the
196257available limits of a personal Google account.
197258
198- This type of access requires authentication via a browser. For OpenAI, run the
199- command:
259+ This type of access requires authentication via a browser. Run these from a
260+ separate terminal via the ` codex ` / ` gemini ` services (not ` vim-ide ` ). For
261+ OpenAI, run the command:
200262
201263``` bash
202264docker compose run --rm codex-web-login
203265```
204266
205- For Gemini, there is no separate command — just run Gemini like
267+ For Gemini, there is no separate login command — just run:
206268
207269``` bash
208270docker compose run --rm gemini
@@ -218,28 +280,23 @@ without any additional authentication steps.
218280
219281### Where to run commands
220282
221- You can run the CLIs either :
283+ Run the CLIs in their own containers (recommended) :
222284
223- ** Inside the container** (recommended): ` docker compose run --rm vim-ide ` , then
224- open a Vim terminal (` :terminal ` ) and run ` codex ` / ` gemini ` .
285+ ``` bash
286+ docker compose run --rm codex
287+ docker compose run --rm gemini
288+ ```
225289
226- ** Outside Vim but still in Docker** : ` docker compose run --rm codex ` or `docker
227- compose run --rm gemini` . See the ` codex` and ` gemini` services in
228- ` compose.yaml ` .
290+ ` vim-ide ` is for editing only; it does not mount the auth volumes or API keys.
229291
230292### Gemini CLI examples
231293
232294The Gemini CLI provides a conversational interface to interact with your
233295codebase, allowing you to ask questions, refactor code, fix bugs, and add new
234296features.
235297
236- Run interactively in Vim:
237-
238- ``` bash
239- gemini
240- ```
241-
242- or using docker compose:
298+ Run all Gemini commands via Docker Compose so auth volumes and API keys are
299+ available:
243300
244301``` bash
245302docker compose run --rm gemini
@@ -248,19 +305,19 @@ docker compose run --rm gemini
248305Read a file:
249306
250307``` bash
251- gemini read src/sample/main.py
308+ docker compose run --rm gemini read src/sample/main.py
252309```
253310
254311List directory contents:
255312
256313``` bash
257- gemini list src/sample
314+ docker compose run --rm gemini list src/sample
258315```
259316
260317Explain a code snippet (hypothetical):
261318
262319``` bash
263- gemini explain " def my_function():" --file src/sample/main.py
320+ docker compose run --rm gemini explain " def my_function():" --file src/sample/main.py
264321```
265322
266323### Codex CLI examples
@@ -269,13 +326,8 @@ The Codex CLI (or similar code generation/analysis tools) can be used for
269326automating code generation, understanding project structure, and suggesting
270327improvements.
271328
272- Run interactively in Vim:
273-
274- ``` bash
275- codex
276- ```
277-
278- or using docker compose:
329+ Run all Codex commands via Docker Compose so auth volumes and API keys are
330+ available:
279331
280332``` bash
281333docker compose run --rm codex
@@ -284,19 +336,19 @@ docker compose run --rm codex
284336Generate a new Python class (hypothetical):
285337
286338``` bash
287- codex generate class User --fields name:str,email:str --language python --file src/models.py
339+ docker compose run --rm codex generate class User --fields name:str,email:str --language python --file src/models.py
288340```
289341
290342Analyze dependencies (hypothetical):
291343
292344``` bash
293- codex analyze dependencies --project-root .
345+ docker compose run --rm codex analyze dependencies --project-root .
294346```
295347
296348Suggest tests for a file (hypothetical):
297349
298350``` bash
299- codex suggest tests --file src/sample/main.py
351+ docker compose run --rm codex suggest tests --file src/sample/main.py
300352```
301353
302354## 🔒 Security notes
0 commit comments