# `cm_setup()`
**Category:** Connection and acquisition
**Status:** stable

## Purpose
Configure Copernicus access without embedding credentials.

## When to use
Use it when its declared input and output match the workflow. Prefer a narrower selection before any operation that may materialise values.

## When not to use
Do not use it to calculate `spatind` indicators or to bypass coordinate, CRS, unit, and provenance checks.

## Real signature
```r
cm_setup(env = "oceancube-copernicus", install = TRUE, module = "copernicusmarine",      verbose = TRUE)
```

## Arguments
- `env`: see the installed Rd manual for validation and defaults.
- `install`: see the installed Rd manual for validation and defaults.
- `module`: see the installed Rd manual for validation and defaults.
- `verbose`: see the installed Rd manual for validation and defaults.

## Input and output
Input: **configuration**. Output: **configuration**.

## Backend support
Memory: **FALSE**. NetCDF: **FALSE**. Backend operations retain read-only semantics; materialisation is explicit.

## Dimensional effect
Preserves the relevant cube contract or returns metadata/geometry without silently dropping axes.

## Metadata
Units, coordinates, provenance, masks, and QA metadata are retained or reported where meaningful.

## Minimal executable check
```r
library(oceancube)
stopifnot(is.function(oceancube::cm_setup))
names(formals(oceancube::cm_setup))
```

## Example in a workflow
Typical position: `none` → `cm_setup()` → `cm_connect`. See the workflow scripts for a checked end-to-end example.

## Frequent errors and limitations
Invalid dimensions, selectors, units, CRS, source-file identity, optional dependencies, or unsupported grids are rejected explicitly. Read the function Rd page for exact diagnostics.

## Related functions
Previous: `none`. Next: `cm_connect`.
