Skip to content
Back to skills

Use Venv

ASecurity

Select the consuming application's virtual environment for Python commands, task execution, tests, and package tools when using ok-script or its MCP server.

  • 877 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added August 30, 2026
toolspythonshell

Works with

  • mcp

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 9, 2026

npx -y skills add ok-oldking/ok-script --skill use_venv --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Use Venv?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Use Venv
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ok-oldking-use-venv/badge)](https://www.skillsdirectory.com/skills/ok-oldking-use-venv)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: use-venv
description: Select the consuming application's virtual environment for Python commands, task execution, tests, and package tools when using ok-script or its MCP server.
---

# Use the Application's Virtual Environment

Resolve the third-party application's root and use its virtual environment for Python commands, launchers, and tests. The directory containing this skill or the installed `ok` package is not the application root.

Honor an explicitly configured environment; otherwise prefer the application's `.venv`. Use an absolute interpreter path when changing directories, and preserve the application's dependency and test-runner conventions.

## PowerShell

From the application root, 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 src\tasks\MyTask.py
& $py -m pytest tests
& $py .\start_mcp.py
& $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.

If the environment is absent or dependencies are missing, follow [setup-env](../setup-env/SKILL.md). Linking the `ok` source folder does not install its dependencies into another project's environment.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.