% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/session_snapshot.R
\name{export_snapshot}
\alias{export_snapshot}
\title{Export Session Snapshot}
\usage{
export_snapshot()
}
\value{
Invisibly returns a named list with components: \code{status} ("done" or
"clean"), \code{packages} (character vector), \code{file} (output path),
and \code{version_locked} (logical).
}
\description{
Generates a reproducible installation script for all currently attached 
external R packages, allowing the user to recreate the exact environment 
in a different session or on another machine.
}
\details{
The function provides two modes of environment capture:
\enumerate{
  \item \strong{Flexible Installation}: Generates a script that checks for 
      missing packages and installs the latest available versions.
  \item \strong{Strict Version Locking}: Uses `devtools::install_version()` 
      to lock the environment to the exact versions currently installed 
      on the system, ensuring maximum reproducibility.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  export_snapshot()
}
}
