Skip to content

Commit 00f8031

Browse files
committed
Enhance README with AI CLI docs and streamline Docker Compose
- Documented Gemini and Codex CLI usage, including interactive mode within Vim. - Added instructions for configuring API tokens in `.env.dist`. - Refactored `compose.yaml` to use a default environment anchor for cleaner configuration and included AI API keys in the `vim-ide` service.
1 parent 95c41c0 commit 00f8031

3 files changed

Lines changed: 109 additions & 13 deletions

File tree

.env.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DOCKER_USER_HOME=/home/developer
99

1010
MIRROR_LIST_COUNTRY=RU
1111
BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
12-
VIM_PACKAGES="python vim ctags ripgrep bat npm nodejs-lts-jod"
12+
VIM_PACKAGES="python vim ctags ripgrep bat npm nodejs-lts-jod openai-codex gemini-cli"
1313

1414
PYTHON_VERSION=3.14
1515
PYTHONUNBUFFERED=1
@@ -20,3 +20,5 @@ POETRY_OPTIONS_DEV="--no-root --with dev --compile"
2020
POETRY_NO_INTERACTION=1
2121

2222
JUPYTER_TOKEN=_change_me_please_!1_
23+
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxx"
24+
GEMINI_API_KEY="YOUR_GEMINI_API_KEY"

README.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
* [✅ Features](#-features)
99
* [🧪 Tested with](#-tested-with)
1010
* [🚀 Getting Started](#-getting-started)
11+
* [💻 AI-Powered CLI Workflow (Gemini & Codex)](#-ai-powered-cli-workflow-gemini--codex)
12+
* [Interactive CLI Usage in Vim Terminal](#interactive-cli-usage-in-vim-terminal)
13+
* [Gemini CLI examples](#gemini-cli-examples)
14+
* [Codex CLI examples](#codex-cli-examples)
1115
* [🧠 Vim IDE Features](#-vim-ide-features)
12-
* [🔌Included Plugins](#included-plugins)
13-
* [🗂 Additional Notes](#-additional-notes)
16+
* [🔌Included Plugins](#included-plugins)
17+
* [🗂 Additional Notes](#-additional-notes)
1418

1519
<!-- vim-markdown-toc -->
1620

@@ -56,11 +60,11 @@ Use it as-is or tailor it to match your team's development workflow.
5660

5761
## 🚀 Getting Started
5862

59-
1. Configure environment and Python settings
63+
1. Configure environment and Python settings and API tokens
6064

6165
```bash
6266
cp .env.dist .env
63-
vim .env # Set OS packages, Python version, Poetry version, etc.
67+
vim .env # Set OS packages, Python version, Poetry version, etc., and your API keys for OPENAI_API_KEY and GEMINI_API_KEY.
6468
```
6569

6670
2. Set up Python project dependencies
@@ -117,6 +121,87 @@ docker compose run --rm --service-ports jupyterlab
117121
# Open: http://127.0.0.1:8888/lab?token=<your .env token>
118122
```
119123

124+
## 💻 AI-Powered CLI Workflow (Gemini & Codex)
125+
126+
This project template is designed to be easily integrated with powerful CLI
127+
tools like Gemini and Codex, enhancing your development workflow with
128+
intelligent assistance. Rather than replacing your editor, these tools
129+
complement Vim by running alongside it in a terminal—either inside or outside
130+
Vim—so you can inspect, generate, and reason about code without breaking flow.
131+
132+
NOTE: To use AI CLI tools such as Gemini or Codex, you must configure API keys
133+
according to each provider’s official documentation.
134+
135+
### Interactive CLI Usage in Vim Terminal
136+
137+
For a more integrated workflow, you can use the Gemini and Codex CLIs directly
138+
within a Vim terminal. This allows for quick iteration, context-aware
139+
assistance, and seamless integration with your editing environment.
140+
141+
To open a terminal within Vim, you can use `:terminal` or `:vertical term` or
142+
`:tab terminal`. Once inside the terminal, you can invoke the CLI tools as
143+
usual.
144+
145+
### Gemini CLI examples
146+
147+
The Gemini CLI provides a conversational interface to interact with your
148+
codebase, allowing you to ask questions, refactor code, fix bugs, and add new
149+
features.
150+
151+
Run interactively:
152+
153+
```bash
154+
gemini
155+
```
156+
157+
Read a file:
158+
159+
```bash
160+
gemini read src/sample/main.py
161+
```
162+
163+
List directory contents:
164+
165+
```bash
166+
gemini list src/sample
167+
```
168+
169+
Explain a code snippet (hypothetical):
170+
171+
```bash
172+
gemini explain "def my_function():" --file src/sample/main.py
173+
```
174+
175+
### Codex CLI examples
176+
177+
The Codex CLI (or similar code generation/analysis tools) can be used for
178+
automating code generation, understanding project structure, and suggesting
179+
improvements.
180+
181+
Run interactively:
182+
183+
```bash
184+
codex
185+
```
186+
187+
Generate a new Python class (hypothetical):
188+
189+
```bash
190+
codex generate class User --fields name:str,email:str --language python --file src/models.py
191+
```
192+
193+
Analyze dependencies (hypothetical):
194+
195+
```bash
196+
codex analyze dependencies --project-root .
197+
```
198+
199+
Suggest tests for a file (hypothetical):
200+
201+
```bash
202+
codex suggest tests --file src/sample/main.py
203+
```
204+
120205
## 🧠 Vim IDE Features
121206

122207
This template comes with a thoughtfully configured Vim environment that

compose.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
x-default-env: &default-env
2+
POETRY_NO_INTERACTION: "1"
3+
PIP_DEFAULT_TIMEOUT: "100"
4+
PYTHONUNBUFFERED: "1"
5+
16
services:
27
python-base:
38
platform: linux/amd64
@@ -16,17 +21,16 @@ services:
1621
- POETRY_VERSION=${POETRY_VERSION}
1722
- POETRY_OPTIONS_APP=${POETRY_OPTIONS_APP}
1823
- POETRY_OPTIONS_DEV=${POETRY_OPTIONS_DEV}
19-
environment: &default-env
20-
- POETRY_NO_INTERACTION=1
21-
- PIP_DEFAULT_TIMEOUT=100
22-
- PYTHONUNBUFFERED=1
24+
environment:
25+
<<: *default-env
2326
poetry:
2427
platform: linux/amd64
2528
entrypoint: poetry
2629
build:
2730
target: poetry
2831
args: *default-args
29-
environment: *default-env
32+
environment:
33+
<<: *default-env
3034
volumes:
3135
- type: bind
3236
source: .
@@ -43,7 +47,10 @@ services:
4347
build:
4448
target: vim-ide
4549
args: *default-args
46-
environment: *default-env
50+
environment:
51+
<<: *default-env
52+
OPENAI_API_KEY: ${OPENAI_API_KEY}
53+
GEMINI_API_KEY: ${GEMINI_API_KEY}
4754
volumes:
4855
- type: bind
4956
source: .
@@ -61,7 +68,8 @@ services:
6168
build:
6269
target: dev-build
6370
args: *default-args
64-
environment: *default-env
71+
environment:
72+
<<: *default-env
6573
volumes:
6674
- type: bind
6775
source: .
@@ -72,7 +80,8 @@ services:
7280
build:
7381
target: app-build
7482
args: *default-args
75-
environment: *default-env
83+
environment:
84+
<<: *default-env
7685
volumes:
7786
pip-cache:
7887
driver: local

0 commit comments

Comments
 (0)