Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

import

Recreate an environment from a scoop export JSON file.

Usage

scoop import <PATH> [--name <NEW_NAME>] [--force] [--json]
scoop import -    [--name <NEW_NAME>]                # read from stdin

Arguments

ArgumentRequiredDescription
pathYesPath to the export JSON, or - to read from stdin

Options

OptionDescription
--name <NAME>Override the env name from the file (validated like scoop create)
-f, --forceOverwrite an existing environment with the same name
--jsonOutput as JSON

Behaviour

  1. Reads and validates the export schema. Mismatched scoop_export_version produces a clear EXPORT_UNSUPPORTED_VERSION error pointing at upgrade guidance instead of trying to limp on.
  2. Applies --name override (if any) and validates the resulting name.
  3. If the target env already exists: errors out unless --force is set, in which case the existing env is removed first.
  4. Auto-installs the requested Python if it isn’t already available via uv (matches the ergonomics of scoop sync).
  5. Creates the env, then uv pip installs every pinned package (name==version) in one shot.

Examples

# Plain file -> recreates with the schema's original name
scoop import myenv.json

# Pipe from a sibling machine
ssh other 'scoop export myenv' | scoop import -

# Rename on the fly + overwrite if it already exists
scoop import myenv.json --name myenv-2 --force

# Machine-readable summary for CI
scoop import myenv.json --json

JSON Output

{
  "status": "success",
  "command": "import",
  "data": {
    "name": "myenv",
    "python": "3.12.7",
    "packages_installed": 42,
    "source": "/path/to/myenv.json"
  }
}

Exit Codes

CodeMeaning
0Imported successfully
1Invalid file, unsupported schema version, invalid name, or env existed without --force

See Also