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

clone

Duplicate an environment — same Python version, same packages by default — without going through an export/import roundtrip.

Usage

scoop clone <SRC> <DST> [--no-packages] [--force] [--json]

Arguments

ArgumentRequiredDescription
srcYesName of the source environment
dstYesName for the new environment

Options

OptionDescription
--no-packagesSkip package copy — create an empty env at the same Python version
-f, --forceOverwrite the destination if it already exists
--jsonOutput as JSON

Behaviour

  1. Validates <DST> (rejects reserved names like list, clone, …).
  2. Refuses a self-clone (src == dst).
  3. Resolves <SRC>’s recorded Python version from its metadata; surfaces a clear CorruptedEnvironment error when metadata is missing so you know recreate-from-scratch is the right next step.
  4. Creates <DST> at the same Python version.
  5. Unless --no-packages, lists the source’s installed packages via the venv’s own pip and re-installs them pinned (name==version) into the destination.

Examples

# Full copy
scoop clone myenv myenv-experiment

# Just the shell, no packages
scoop clone myenv myenv-clean --no-packages

# Replace an existing clone
scoop clone myenv myenv-experiment --force

JSON Output

{
  "status": "success",
  "command": "clone",
  "data": {
    "src": "myenv",
    "dst": "myenv-experiment",
    "python": "3.12.7",
    "path": "/Users/me/.scoop/virtualenvs/myenv-experiment",
    "packages_copied": 12,
    "packages_skipped": false
  }
}

Exit Codes

CodeMeaning
0Cloned successfully
1Invalid dst name, self-clone, src missing, dst exists without --force, or src corrupted

See Also