Crane User Options

Description

Consolidate and lookup user configuration, which can be set both via environment variables and R options.

Usage

get_crane_opt(..., default = NULL)

Arguments

  • ...: character(1) option key where each key level is given as a separate arg. The top-level crane is implied and does not need to be provided.
  • default: default object to return if no value is set via an R base option or environment variable

Details

the matching environment variable for an option can be found by dot separtors with underscores and uppercasing all letters. For example, the R option crane.config.file matches the environment variable CRANE_REPO_CONFIG. If an option is set both via base::options and as an environment variable, the value set via an option will take precedence.

Options

  • crane.cache.persistent: store cache in the filesystem.

  • crane.cache.dir: directory to use to store cache. See default_cache_dir for the default.

  • crane.config.file: filepath to the config file for crane. See default_config_file for the default.

  • crane.config.autocreate: automatically create the config file and its parent directories if it does not exist.

  • crane.curl.insecure: do not verify peer identity

  • crane.shim.verbose: be verbose about extra actions in the utils::download.file shim (that is activated with enable_install_packages_hook)

  • crane.debug.alwaysrefresh: always refresh cached tokens even if they are not expired.

  • crane.interactive: open the verification url in the browser of the user automatically using utils::browseURL during the device authorization flow. By default this will only happen if running in interactive mode (base::interactive())

  • crane.poll.verbose: poll verbosely for access token

  • crane.device.offline: request an offline refresh token. If enabled, this adds the offline_access OIDC scope.

  • crane.device.scope: extra scopes to add to the device authorization code request

Last modified July 8, 2025