# Use Venv

> Use Venv is an Agent Skill for development published in the BnanZ0/ok-nte repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Prefer the repository .venv Python interpreter for Python commands, tests, scripts, package tooling, and AI coding workflows when .venv exists.

- Skill name: `use-venv`
- Category: [Development](https://www.openparable.com/skill/development/1)
- Source: https://github.com/BnanZ0/ok-nte/blob/HEAD/.agents/skills/use_venv/SKILL.md
- Repository: BnanZ0/ok-nte (981 GitHub stars when collected)

## SKILL.md

# Use Repository Virtual Environment

When running Python commands in this repository, use the local virtual environment if it exists.

## PowerShell

Before Python commands, resolve the interpreter:

```powershell
$py = if (Test-Path .\.venv\Scripts\python.exe) { ".\.venv\Scripts\python.exe" } else { "python" }
```

Then run commands through that interpreter:

```powershell
& $py -m py_compile ok\util\logger.py
& $py -m pytest tests
& $py .\.agents\skills\compile_i18n\add_translation.py --help
& $py -m pip install -r requirements.txt
```

Do not call global `python`, `pip`, or `pytest` directly when `.venv` exists. Use `& $py`, `& $py -m pip`, and `& $py -m pytest` instead.

---

Source: https://www.openparable.com/skill/development/use-venv (OpenParable). Cite the canonical URL above.
