OPAM-CONFIG(1)

NAME

opam-config - Display configuration options for packages.

SYNOPSIS

opam config [OPTION]... [DOMAIN] [ARG]...

DESCRIPTION

This command uses opam state to output information on how to use installed libraries, updating the user’s PATH, and substitute variables used in opam packages.

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

ARGUMENTS

DOMAIN
    Name of the sub-command. See the DOMAINS section for more info.

OPTIONS

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

--csh
    Use sh-compatible mode for configuring OPAM.

--csh
    Use csh-compatible mode for configuring OPAM.

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

-e VAL
    Backward-compatible option, equivalent to opam config env.

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

-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 if running zsh) to setup an OPAM-friendly environment when starting a new shell.

-R, --rec
    Recursive query.

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

--zsh
    Use zsh-compatible mode for configuring OPAM.

DOMAINS

env Return the environment variables PATH, MANPATH, OCAML_TOPLEVEL_PATH and CAML_LD_LIBRARY_PATH according to the current 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-configaration 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
    Execute the shell script given in parameter with the correct environment variables. This option can be used to cross-compile between switches using opam config exec "CMD ARG1 ... ARGn" --switch=SWITCH

var Return the value associated with the given variable. If the variable contains a colon such as pkg:var, then the left element will be understood as the package in which the variable is defined. The variable resolution is done as follows: first, OPAM will check whether $var exists; for package variables, it will look for $pkg_var. If the variable is not found, OPAM will then check whether the variable is implicit. There are two global implicit variables: ocaml-version and preinstalled and two implicit variables per package: pkg:installed which is either "true" or "false", and pkg:enable which is either "enable" or "disable". Finally, OPAM will look into its global and package config files to find whether these variables exist.

list
    Return the list of all variables defined in the listed packages. It is possible to filter the list of variables by giving package names (use globals to get the list of global variables). No parameter means displaying all the variables.

subst
    Substitute variables in the given files. The strings %{var}% are replaced by the value of the variable var (see the documentation associated to opam config var).

includes
    returns include options.

bytecomp
    returns bytecode compile options.

asmcomp
    returns assembly compile options.

bytelink
    returns bytecode linking options.

asmlink
    returns assembly compile options.

COMMON OPTIONS

These options are common to all commands.

--debug
    Print debug message on stdout. This is equivalent to setting $OPAMDEBUG to a value greater or equal to 2.

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

--help[=FMT] (default=pager)
    Show this help in format FMT (pager, plain or groff).

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

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

-r ROOT, --root=ROOT (absent=/Users/tgazagna/.opam)
    Use ROOT as the current root path. This is equivalent to setting $OPAMROOT to ROOT.

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

-v, --verbose
    Be more verbose. This is equivalent to setting either $OPAMDEBUG to a value greater or equal to 1 or $OPAMVERBOSE to a non-empty string.

--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 a non-empty string.

FURTHER DOCUMENTATION

See http://opam.ocamlpro.com.

AUTHORS

Thomas Gazagnaire <thomas.gazagnaire@ocamlpro.com>

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

Vincent Bernardoff <vb@luminar.eu.org>

Guillem Rieu <guillem.rieu@ocamlpro.com>

BUGS

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