Configure automatic nvm version switching when changing directories, using shell hooks for bash, zsh, and fish. Covers auto-use on cd, PATH restoration, and nvm deactivate. Use when the user wants automatic Node version switching per project, nvm use to run on directory change, or needs to deactivate nvm and restore system PATH.
Scanned 5/27/2026
Install via CLI
openskills install partme-ai/full-stack-skills---
name: nvm-shell-integration
description: "Configure automatic nvm version switching when changing directories, using shell hooks for bash, zsh, and fish. Covers auto-use on cd, PATH restoration, and nvm deactivate. Use when the user wants automatic Node version switching per project, nvm use to run on directory change, or needs to deactivate nvm and restore system PATH."
license: Complete terms in LICENSE.txt
---
# nvm Shell Integration
Add automatic `nvm use` on directory changes so the correct Node version activates per project.
## Workflow
1. **Add auto-switching for bash** (append to `~/.bashrc`):
```bash
cdnvm() {
command cd "$@" || return $?
nvm_path="$(nvm_find_up .nvmrc | command tr -d '\n')"
if [ -n "$nvm_path" ]; then
local nvm_node_version=$(nvm version "$(cat "$nvm_path/.nvmrc")")
if [ "$nvm_node_version" = "N/A" ]; then
nvm install
elif [ "$nvm_node_version" != "$(nvm version)" ]; then
nvm use
fi
fi
}
alias cd='cdnvm'
```
2. **Deactivate nvm and restore PATH** when needed:
```bash
nvm deactivate # Removes nvm from PATH, restores system node
nvm use system # Switch to system-installed Node
```
3. **Verify auto-switching works:**
```bash
echo "20" > /tmp/test-project/.nvmrc
cd /tmp/test-project # Should auto-switch to Node 20
node -v # Should show v20.x.x
```
**Note:** Base shell loading belongs to nvm-setup. This skill adds deeper integration on top.
### Example file map
- `examples/shell-integration.md` - Overview of integration options
- `examples/auto-use-bash.md` - Bash auto-switching hook
- `examples/auto-use-zsh.md` - Zsh auto-switching hook
- `examples/auto-use-fish.md` - Fish auto-switching hook
- `examples/restore-path.md` - PATH restoration and nvm deactivate
## Keywords
shell integration, auto use, PATH restore, nvm deactivate, auto switch, cdnvm
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.
Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and optionally connect a translation platform. Use when the user asks to add or configure i18n, internationalization, localization, multi-language support, or translations — including when they explicitly mention LinguiJS, Lingui, next-intl, "wrap strings", "find hardcoded text", "make my app translatable", or "set up translations". Triggers on g...
PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.