Runtime version detection and version file generator for Node.js, Python, Ruby, and more
npm install @depr/initpackage.json | .nvmrc |
pyproject.toml, requirements.txt, setup.py | .python-version |
Gemfile, *.gemspec | .ruby-version |
Cargo.toml | rust-toolchain.toml |
pom.xml, build.gradle | .sdkmanrc |
.csproj, .fsproj, *.sln, global.json | global.json |
pubspec.yaml | .dart-version |
composer.json | composer.json (require.php) |
bash
npx @depr/init
`
Or install globally:
`bash
npm install -g @depr/init
`
Usage
$3
`bash
npx @depr/init
`
This will:
1. Scan for supported ecosystem manifests in the current directory
2. Detect runtime versions via command execution (e.g., node --version, python --version)
3. Generate appropriate version files for each detected ecosystem
4. Optionally update manifest files with version constraints
$3
`bash
npx @depr/init [options]
Options:
--exact Use exact version (e.g., 22.12.0)
--minor Use minor version (e.g., 22.12)
--major Use major version (e.g., 22) [default]
-y, --yes Non-interactive mode (skip prompts, overwrite existing)
--dry-run Preview changes without writing files
-h, --help Display help
`
$3
Scan a polyglot project:
`bash
npx @depr/init
Detects all ecosystems in the directory and generates version files
`
Use exact versions:
`bash
npx @depr/init --exact
Creates .nvmrc with: 22.12.0
Creates .python-version with: 3.12.1
`
Non-interactive mode (CI/CD):
`bash
npx @depr/init --yes
Skips all prompts, overwrites existing files
`
Preview changes without writing:
`bash
npx @depr/init --dry-run
Shows what would be created/updated
`
Version Granularity
- Major (default): 22 - Best for general compatibility
- Minor: 22.12 - Good balance of specificity and flexibility
- Exact: 22.12.0 - Maximum specificity, pin exact version
How It Works
1. Ecosystem Detection: Scans for manifest files (package.json, pyproject.toml, etc.)
2. Runtime Detection: Runs version commands (node --version, python --version, etc.)
3. File Generation: Creates version files (.nvmrc, .python-version`, etc.)