| name | virtual-environment |
| description | Check and create virtual environments for projects that need them. Use when starting Python/Node projects, or when dependency isolation is needed. Activates for Python, Node.js, and similar ecosystems. |
| allowed-tools | Read, Glob, Grep, Bash |
| license | MIT |
| metadata | {"author":"antigravity-team","version":"1.0"} |
Virtual Environment Management
๊ฐ์ํ๊ฒฝ์ด ํ์ํ ํ๋ก์ ํธ์์ ํ๊ฒฝ์ ์ฒดํฌํ๊ณ ์์ฑํ๋ ์คํฌ์
๋๋ค.
When This Skill Activates
๋ค์ ํ์ผ ๋ฐ๊ฒฌ ์ ๊ฐ์ํ๊ฒฝ ํ์ ์ฌ๋ถ ์ฒดํฌ:
| ํ์ผ | ํ๋ก์ ํธ ์ ํ | ๊ฐ์ํ๊ฒฝ |
|---|
requirements.txt | Python | venv/virtualenv |
pyproject.toml | Python (Poetry/PDM) | Poetry/PDM ๋ด์ฅ |
Pipfile | Python (Pipenv) | Pipenv ๋ด์ฅ |
setup.py | Python ํจํค์ง | venv |
package.json | Node.js | node_modules (์๋) |
Gemfile | Ruby | bundler |
go.mod | Go | ๋ชจ๋ ์์คํ
(์๋) |
Detection Workflow
1. ํ๋ก์ ํธ ์ ํ ๊ฐ์ง
ls -la | grep -E "requirements|pyproject|Pipfile|package\.json|Gemfile|go\.mod"
2. ๊ฐ์ํ๊ฒฝ ์กด์ฌ ํ์ธ
ls -la | grep -E "^d.*(venv|\.venv|env|\.env)$"
echo $VIRTUAL_ENV
ls -d node_modules 2>/dev/null
Python Projects
venv (ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ)
python -m venv .venv
source .venv/bin/activate
.venv\Scripts\activate
pip install -r requirements.txt
deactivate
Poetry (๊ถ์ฅ)
poetry --version
poetry install
poetry run python script.py
poetry shell
Pipenv
pipenv install
pipenv shell
pipenv run python script.py
Conda
conda create -n myenv python=3.11
conda activate myenv
conda install --file requirements.txt
pip install -r requirements.txt
Node.js Projects
npm install
yarn install
pnpm install
ls node_modules
Workflow: ํ๋ก์ ํธ ์์ ์
Python ํ๋ก์ ํธ
1. ํ๋ก์ ํธ ์ ํ ํ์ธ
- pyproject.toml โ Poetry/PDM
- Pipfile โ Pipenv
- requirements.txt โ venv
2. ๊ฐ์ํ๊ฒฝ ์กด์ฌ ํ์ธ
ls -la | grep -E "venv|\.venv"
3. ์์ผ๋ฉด ์์ฑ
python -m venv .venv
4. ํ์ฑํ + ์์กด์ฑ ์ค์น
source .venv/bin/activate
pip install -r requirements.txt
Node.js ํ๋ก์ ํธ
1. package.json ํ์ธ
cat package.json | head -20
2. node_modules ํ์ธ
ls node_modules 2>/dev/null
3. ์์ผ๋ฉด ์ค์น
npm install
Naming Conventions
| ์ด๋ฆ | ๊ถ์ฅ | ๋น๊ณ |
|---|
.venv | โ
๊ถ์ฅ | ์จ๊น ํด๋, ์ผ๋ฐ์ |
venv | โ
ํ์ฉ | ๋ช
์์ |
.env | โ ๏ธ ์ฃผ์ | ํ๊ฒฝ๋ณ์ ํ์ผ๊ณผ ํผ๋ |
env | โ ๏ธ ์ฃผ์ | ๋๋ฌด ์ผ๋ฐ์ |
.gitignore ์ค์
# Python virtual environments
.venv/
venv/
env/
.env/
# Node
node_modules/
# Python cache
__pycache__/
*.pyc
.pytest_cache/
# IDE
.idea/
.vscode/
Quick Reference
Python ํ๋ก์ ํธ ์์
[ -d ".venv" ] || python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Node.js ํ๋ก์ ํธ ์์
[ -d "node_modules" ] || npm install
Troubleshooting
| ๋ฌธ์ | ํด๊ฒฐ |
|---|
python: command not found | Python ์ค์น ๋๋ PATH ํ์ธ |
pip: command not found | ๊ฐ์ํ๊ฒฝ ํ์ฑํ ํ์ธ |
| Permission denied | sudo ์ฌ์ฉ ๊ธ์ง, venv ์ฌ์์ฑ |
| ํจํค์ง ์ถฉ๋ | ๊ฐ์ํ๊ฒฝ ์ญ์ ํ ์ฌ์์ฑ |
| node_modules ์ค๋ฅ | rm -rf node_modules && npm install |
Checklist
ํ๋ก์ ํธ ์์ ์ :