opam-config(1)

NAME

opam-config - Display configuration options for packages.

SYNOPSIS

opam config [OPTION]... [COMMAND] [ARG]...

DESCRIPTION

This command uses OPAM state to output information on how to use installed libraries, update the PATH, and substitute variables used in OPAM packages.

Apart from opam config env, most of these commands are used by OPAM internally, and are of limited interest for the casual user.

COMMANDS

env Return the environment variables PATH, MANPATH, OCAML_TOPLEVEL_PATH and CAML_LD_LIBRARY_PATH according to the currently selected compiler. The output of this command is meant to be evaluated by a shell, for example by doing eval `opam config env`.

setup
    Configure global and user parameters for OPAM. Use opam config setup to display more options. Use --list to display the current configuration options. You can use this command to automatically update: (i) user-configuration files such as ~/.profile and ~/.ocamlinit; and (ii) global-configuration files controlling which shell scripts are loaded on startup, such as auto-completion. These configuration options can be updated using: opam config setup --global to setup the global configuration files stored in ~/.opam/opam-init/ and opam config setup --user to setup the user ones. To modify both the global and user configuration, use opam config setup --all.

exec [--] COMMAND [ARG]...
    Execute COMMAND with the correct environment variables. This command can be used to cross-compile between switches using opam config exec --switch=SWITCH -- COMMAND ARG1 ... ARGn. Opam expansion takes place in command and args.

var VAR
    Return the value associated with variable VAR. Package variables can be accessed with the syntax pkg:var.

list [PACKAGE]...
    Without argument, prints a documented list of all available variables. With PACKAGE, lists all the variables available for these packages. Use - to include global configuration variables for this switch.

set VAR VALUE
    Set the given global opam variable for the current switch. Warning: changing a configured path will not move any files! This command does not perform any variable expansion.

unset VAR
    Unset the given global opam variable for the current switch. Warning: unsetting built-in configuration variables can cause problems!

expand STRING
    Expand variable interpolations in the given string

subst FILE...
    Substitute variables in the given files. The strings %{var}% are replaced by the value of variable var (see var).

report
    Prints a summary of your setup, useful for bug-reports.

cudf-universe [FILE]
    Outputs the current available package universe in CUDF format.

pef-universe [FILE]
    Outputs the current available package universe in PEF format.

OPTIONS

-a, --all
    Enable all the global and user configuration options.

--dot-profile=FILENAME
    Name of the configuration file to update instead of ~/.profile or ~/.zshrc based on shell detection.

-g, --global
    Enable all the global configuration options.

--inplace-path
    When updating the PATH variable, replace any pre-existing OPAM path in-place rather than putting the new path in front. This means programs installed in OPAM that were shadowed will remain so after opam config env

--json=FILENAME
    Save the results of the OPAM run in a computer-readable file. If the filename contains the character `%', it will be replaced by an index that doesn't overwrite an existing file. Similar to setting the PAMJSON variable.

-l, --list
    List the current configuration.

--no-complete
    Do not load the auto-completion scripts in the environment.

--no-switch-eval
    Do not install `opam-switch-eval` to switch & eval using a single command.

--ocamlinit
    Modify ~/.ocamlinit to make `#use "topfind"` works in the toplevel.

--profile
    Modify ~/.profile (or ~/.zshrc, etc., depending on your shell) to setup an OPAM-friendly environment when starting a new shell.

--sexp
    Display environment variables as an s-expression

--shell=SHELL (absent=bash)
    Sets the configuration mode for OPAM environment appropriate for SHELL. One of one of `bash', `sh', `csh', `zsh' or `fish'.

-u, --user
    Enable all the user configuration options.

COMMON OPTIONS

These options are common to all commands.

--color=WHEN
    Colorize the output. WHEN must be one of `always', `never' or `auto'.

--criteria=CRITERIA
    Specify user preferences for dependency solving for this run. Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details on the supported language, and the external solvers available, see http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A general guide to using solver preferences can be found at http://www.dicosmo.org/Articles/usercriteria.pdf.

--cudf=FILENAME
    Debug option: Save the CUDF requests sent to the solver to FILENAME-<n>.cudf.

--debug
    Print debug message to stderr. This is equivalent to setting $OPAMDEBUG to "true".

--debug-level=LEVEL
    Like `--debug', but allows specifying the debug level (`--debug' sets it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.

--git-version
    Print the git version if it exists and exit.

--help[=FMT] (default=auto)
    Show this help in format FMT. The value FMT must be one of `auto', `pager', `groff' or `plain'. With `auto', the format is `pager` or `plain' whenever the TERM env var is `dumb' or undefined.

--no-base-packages
    Do not install base packages (useful for testing purposes). This is equivalent to setting $OPAMNOBASEPACKAGES to a non-empty string.

--no-self-upgrade
    OPAM will replace itself with a newer binary found at OPAMROOT/opam if present. This disables this behaviour.

-q, --quiet
    Be quiet when installing a new compiler.

--root=ROOT
    Use ROOT as the current root path. This is equivalent to setting $OPAMROOT to ROOT.

--safe
    Make sure nothing will be automatically updated or rewritten. Useful for calling from completion scripts, for example. Will fail whenever such an operation is needed ; also avoids waiting for locks, skips interactive questions and overrides the $OPAMDEBUG variable.

--solver=CMD
    Specify the name of the external dependency solver. The default value is "aspcud". Either 'aspcud', 'packup' or a custom command that should contain the variables %{input}%, %{output}% and %{criteria}%

--strict
    Fail whenever an error is found in a package definition or a configuration file. The default is to continue silently if possible.

--switch=SWITCH
    Use SWITCH as the current compiler switch. This is equivalent to setting $OPAMSWITCH to SWITCH.

--use-internal-solver, --no-aspcud
    Force use of internal heuristics, even if an external solver is available.

-v, --verbose
    Be more verbose, show package sub-commands and their output. Repeat to see more. Repeating n times is equivalent to setting $OPAMVERBOSE to "n".

--version
    Show version information.

-y, --yes
    Disable interactive mode and answer yes to all questions that would otherwise be asked to the user. This is equivalent to setting $OPAMYES to "true".

ENVIRONMENT VARIABLES

OPAM makes use of the environment variables listed here. Boolean variables should be set to "0", "no", "false" or the empty string to disable, "1", "yes" or "true" to enable.

OPAMCOLOR, when set to always or never, sets a default value for the --color option.

OPAMCRITERIA specifies user preferences for dependency solving. The default value depends on the solver version, use `config report` to know the current setting. See also option --criteria

OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH for more options.

OPAMDEBUG see options `--debug' and `--debug-level'.

OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.

OPAMERRLOGLEN sets the number of log lines printed when a sub-process fails. 0 to print all.

OPAMEXTERNALSOLVER see option `--solver'.

OPAMFETCH specifies how to download files: either `wget', `curl' or a custom command where variables %{url}%, %{out}%, %{retry}%, %{compress}% and %{checksum}% will be replaced. Overrides the 'download-command' value from the main config file.

OPAMJOBS sets the maximum number of parallel workers to run.

OPAMJSON log json output to the given file (use character `%' to index the files)

OPAMLOCKRETRIES sets the number of tries after which OPAM gives up acquiring its lock and fails. <= 0 means infinite wait.

OPAMNO answer no to any question asked.

OPAMNOASPCUD see option `--no-aspcud'.

OPAMNOSELFUPGRADE see option `--no-self-upgrade'.

OPAMPINKINDAUTO sets whether version control systems should be detected when pinning to a local path. Enabled by default since 1.3.0.

OPAMREQUIRECHECKSUMS see option `--require-checksums'.

OPAMRETRY sets the number of tries before failing downloads.

OPAMROOT see option `--root'. This is automatically set by `opam config env --root=DIR' when DIR is non-default or OPAMROOT is already defined.

OPAMSAFE see option `--safe'

OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for compatibility testing only.

OPAMSOLVERTIMEOUT change the time allowance of the internal solver.

OPAMSTATUSLINE display a dynamic status line showing what's currently going on on the terminal. (one of one of `always', `never' or `auto')

OPAMSWITCH see option `--switch'. Automatically set by `opam config env --switch=SWITCH'.

OPAMUPGRADECRITERIA specifies user preferences for dependency solving when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both are set. See also option --criteria

OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.

OPAMUTF8 use UTF8 characters in output (one of one of `always', `never' or `auto'). By default `auto', which is determined from the locale).

OPAMUTF8MSGS use extended UTF8 characters (camels) in OPAM messages. Implies OPAMUTF8. This is set by default on OSX only.

OPAMVAR_var overrides the contents of the variable var when substituting `%{var}%` strings in `opam` files.

OPAMVAR_package_var overrides the contents of the variable package:var when substituting `%{package:var}%` strings in `opam` files.

OPAMVERBOSE see option `--verbose'.

OPAMYES see option `--yes'.

FURTHER DOCUMENTATION

See https://opam.ocaml.org.

AUTHORS

Thomas Gazagnaire <thomas@gazagnaire.org>

Anil Madhavapeddy <anil@recoil.org>

Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>

Frederic Tuong <tuong@users.gforge.inria.fr>

Louis Gesbert <louis.gesbert@ocamlpro.com>

Vincent Bernardoff <vb@luminar.eu.org>

Guillem Rieu <guillem.rieu@ocamlpro.com>

Roberto Di Cosmo <roberto@dicosmo.org>

BUGS

Check bug reports at https://github.com/ocaml/opam/issues.