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

export

Write a portable JSON snapshot of an environment so another machine (or another teammate) can recreate it with scuv import.

Usage

scuv export <name> [-o <PATH>]

Arguments

ArgumentRequiredDescription
nameYesName of the environment to export

Options

OptionDescription
-o, --output <PATH>Write to this file instead of stdout

When -o is omitted, the JSON document is written to stdout and status messages stay on stderr. That keeps the command pipe-friendly:

scuv export myenv > myenv.json
scuv export myenv | jq '.packages | length'

Schema

The exported file is versioned (scoop_export_version) so a future format change is detected cleanly rather than silently mis-parsed.

{
  "scoop_export_version": "1",
  "environment": {
    "name": "myproject",
    "python": "3.12",
    "created_at": "2026-05-29T12:34:56.762998+00:00"
  },
  "packages": [
    { "name": "pytest", "version": "8.0.0" },
    { "name": "black",  "version": "24.1.0" }
  ]
}

Field notes:

  • environment.python is the version recorded in the env’s metadata, which comes from version_info in the env’s pyvenv.cfg. Current uv writes the minor version there (3.12); envs made with --python-path record the interpreter’s full version (e.g. 3.14.8).
  • environment.created_at is RFC 3339 and may be absent for hand-authored or pre-metadata exports.
  • packages is what uv pip list reports for the env — versions are pinned exactly so imports are reproducible.

Note: The export schema is still v1 and intentionally does not include the new last_used timestamp. last_used is local usage telemetry — it describes how you’ve been using this env, not what an importer needs to recreate it elsewhere. Imported envs start fresh with no last_used and the field populates the first time the new env is activated locally.

Exit Codes

CodeMeaning
0Export written successfully (or printed to stdout)
1Env not found, or writing the destination file failed

See Also