pinset
中文
Tool management

pinset import

Migrate existing project version declarations into Pinset after reviewing a plan of the changes.

View source on GitHub ↗

When to use

Use with .tool-versions, .nvmrc or similar files. Existing Pinset choices are retained; only missing tools are added. Deliberately change choices with use.

Examples

For a project whose root .nvmrc declares Node 24:

pinset import --plan
pinset import
pinset install

The plan lists source declarations, exact versions, retained choices, conflicts and skipped tools. The second command writes configuration and lock after confirmation; the third installs tools.

Behavior

Checks .tool-versions, package.json (engines, volta, packageManager), .nvmrc, .node-version, go.mod, rust-toolchain.toml and .python-version at the project root. Existing projects use their discovered root; new ones use the specified directory. Original files remain.

Ranges and aliases resolve to marked exact versions through Provider metadata. Compatible declarations jointly constrain resolution; incompatible ones are skipped. go.mod prefers toolchain while checking the go minimum. Rust includes profile, components and targets, retaining pinned nightly dates, but cannot infer local paths or an unspecified default channel. npm, pip and standalone Dart have no separate Provider. pnpm needs a project Node selection. Declared generic tools require an explicit version or tag.

Existing choices and valid lock records remain. Missing locks are generated from existing selectors. Resolution can access the network; generic previews download temporary files to compute digests. --plan writes no project or Pinset state. Enter y, yes or “是” to apply; Enter cancels. Source, configuration or lock changes invalidate a reviewed plan.

For field mappings, npm limitations, PATH comparison and rollback, see Migrate a Volta project. volta.extends is ignored rather than followed.

Parameters, exit codes and common errors

ParameterMeaning
--planPreview only.
-y, --yesDisplay and confirm without prompting.
--jsonWithout --yes, return a plan only. When applying, plan goes to stderr and result to stdout.

Success or cancellation exits 0. No sources exits 1 with PINSET_IMPORT_NO_SOURCES and checked filenames. Invalid files use PINSET_IMPORT_SOURCE_INVALID; stale plans use PINSET_IMPORT_PLAN_STALE and need regeneration. Skipped entries need review but do not themselves fail the operation.

/en/docs/commands/importDocumented version · Pinset 3.1.0