OPAM-SHOW(1)

✨ NAME ✨

opam-show β€” bestie, this is the command that spills the tea β˜• about specific packages. We're talking display information about them, that's the whole vibe. πŸ’…

(Also, for the record, this is from the Opam Manual, so you know it's official official. πŸŽ€)


🌸 SYNOPSIS 🌸

opam show [OPTION]… [PACKAGES]…

πŸ’– DESCRIPTION πŸ’–

Okay so, this command shows you the whole information block for the package(s) you picked. Like, the full 411. πŸ”₯

The information block is made up of:

  • the name of the package
  • the installed version, if this package is installed in the currently selected compiler
  • the list of available (installable) versions
  • and a complete description

Lowkey if you just want a lil list of what's out there, use opam list instead β€” that gives you the list of available packages plus a short description for each one. No cap.

You can also point at paths to package definition files, or at directories that contain package definitions, and in that case opam will show you the corresponding metadata. πŸ¦‹

Note: on terminals that support it, version numbers get colored, and here's the whole legend so you're not out here confused: - Magenta and bold: versions installed in the current switch - Bold: versions installed in other switches - Red and crossed: versions not available on the current platform - Gray: versions tagged with the avoid-version or deprecated flag

πŸŽ€ ARGUMENTS πŸŽ€

  • PACKAGES β€” a list of package names, and you can tack on an optional version or constraint, like pkg, pkg.1.0 or pkg>=0.5 ; or it can be files or directory names containing a package description, with an explicit directory, e.g. ./foo.opam or . ✨

πŸ‘‘ OPTIONS πŸ‘‘

  • --all-versions β€” shows you the info for all the packages matching PACKAGES, instead of restraining itself to a single package that matches the PACKAGES constraints. Let it cook, bestie. πŸ”₯
  • --empty-fields β€” shows fields that are empty. This one is implied whenever you pass --field.
  • -f FIELDS, --field=FIELDS β€” only displays the values of these fields, nothing else. Your field menu is: name, version, package, synopsis, synopsis-or-target, description, <field>, <field>:, installed-version, pin, source-hash, opam-file, all-installed-versions, available-versions, all-versions, repository, installed-files, vc-ref, depexts. You can separate multiple fields with commas, and in that case the field titles get printed. Oh and the raw value of any opam-file field can be queried by combining this with --raw. πŸ’…
  • --file=FILE (absent=-) β€” removed in 2.1, use --just-file instead. RIP to her. πŸ’€
  • --just-file β€” loads and displays information from the given files (so the allowed PACKAGES here are file or directory paths), without any consideration for the repositories or the state of the package. This one implies --raw unless --fields is used. Only raw opam-file fields can be queried. And if you don't give a PACKAGES argument at all, it reads the opam file from stdin. πŸ“
  • --list-files β€” lists the files installed by the package. It's equivalent to --field=installed-files, and it's only available for installed packages. πŸ™ˆ
  • --no-lint β€” don't output linting warnings or errors when reading from files.
  • --normalise β€” prints the values of opam fields all normalised: no newlines, no implicit brackets. Clean. ✨
  • --raw β€” prints the raw opam file for this package.
  • --sort β€” sorts the opam fields. Main character energy: everything in its place. πŸ‘‘
  • --where β€” prints the location of the opam file used for this package. πŸ“

🌈 COMMON OPTIONS 🌈

These ones are common to all commands, so they show up everywhere. Periodt.

  • --best-effort β€” don't fail if all the requested packages can't be installed; try to install as many as possible instead. Heads up though: not all external solvers support this option (recent versions of aspcud or mccs should be fine). This is equivalent to setting the $OPAMBESTEFFORT environment variable.
  • --cli=MAJOR.MINOR (absent=2.6) β€” use the command-line interface syntax and semantics of MAJOR.MINOR. This one is intended for any persistent use of opam (scripts, blog posts, whatever), and any version of opam in the same MAJOR series will behave as it did for the specified MINOR release. FYI the flag wasn't available in opam 2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable to 2.0 instead of using this parameter. 🧚
  • --color=WHEN β€” colorize the output. WHEN has to be one of always, never or auto.
  • --confirm-level=LEVEL β€” confirmation level, and LEVEL must be one of ask, no, yes or unsafe-yes. You can pass this more than once. If --yes or --no are also given, the value of the last --confirm-level is what counts. This is equivalent to setting $OPAMCONFIRMLEVEL.
  • --criteria=CRITERIA β€” specify your user preferences for dependency solving for this run. Overrides $OPAMCRITERIA, $OPAMFIXUPCRITERIA and $OPAMUPGRADECRITERIA. For the details on the supported language and the external solvers available, see http://opam.ocaml.org/doc/External_solvers.html. And a general guide to using solver preferences lives at http://www.dicosmo.org/Articles/usercriteria.pdf. πŸ“š
  • --cudf=FILENAME β€” debug option: saves the CUDF requests sent to the solver to FILENAME-<n>.cudf where <n> is the n-th call to the solver during the opam run.
  • --debug β€” print debug messages to stderr. This is equivalent to setting $OPAMDEBUG to "true".
  • --debug-level=LEVEL β€” like --debug, but it lets you specify the debug level (--debug just sets it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
  • --git-version β€” print the git version of opam, if it's set (i.e. you're using a development version), 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.
  • --ignore-pin-depends β€” ignore the extra pins required by packages that get pinned, whether that's manually through opam pin or through opam install DIR. This is equivalent to setting IGNOREPINDEPENDS=true.
  • --json=FILENAME β€” save the results of the opam run in a computer-readable file. If the filename contains the character %, it'll be replaced by an index that doesn't overwrite an existing file. Similar to setting the $OPAMJSON variable. πŸ€–
  • --no β€” answer no to all opam yes/no questions without prompting. See also --confirm-level. This is equivalent to setting $OPAMNO to "true".
  • --no-aspcud β€” removed in 2.1. πŸ’€
  • --no-auto-upgrade β€” when configuring or updating a repository that's written for an earlier opam version (1.2), opam internally converts it to the current format. This disables that behaviour. Note that repositories should define their format version in a repo file at their root, or they'll be assumed to be in the older format. It is, in any case, preferable to upgrade the repositories manually using opam admin upgrade [--mirror URL] when possible.
  • --no-self-upgrade β€” opam will replace itself with a newer binary found at OPAMROOT/opam if present. This disables that behaviour. 🚫
  • -q, --quiet β€” disables --verbose.
  • --root=ROOT β€” use ROOT as the current root path. This is equivalent to setting $OPAMROOT to ROOT.
  • --safe, --readonly β€” makes sure nothing will be automatically updated or rewritten. Handy for calling from completion scripts, for example. It'll fail whenever such an operation is needed ; it also avoids waiting for locks, skips interactive questions and overrides the $OPAMDEBUG variable. This is equivalent to setting the environment variable $OPAMSAFE. πŸ›‘οΈ
  • --solver=CMD β€” specify the CUDF solver to use for resolving package installation problems. This is either a predefined solver β€” this version of opam supports builtin-mccs+lp(), builtin-mccs+glpk, builtin-dummy-z3-solver, builtin-0install, aspcud, mccs, aspcud-old, packup β€” or a custom command that should contain the variables %{input}%, %{output}%, %{criteria}%, and optionally %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
  • --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 β€” disable any external solver and use the built-in one (this requires that opam has been compiled with a built-in solver). This is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
  • -v, --verbose β€” be more verbose. One -v shows all package commands, and repeating it also displays commands called internally (e.g. tar, curl, patch etc.). Repeating n times is equivalent to setting $OPAMVERBOSE to "n". πŸ—£οΈ
  • --version β€” show version information.
  • -w, --working-dir β€” whenever updating packages that are bound to a local, version-controlled directory, update to the current working state of their source instead of the last committed state, or the ref they're pointing to. Since the source directory is copied as it is, if it isn't clean it may result in an opam build failure. ⚠️ This only affects packages explicitly listed on the command-line. It can also be set with $OPAMWORKINGDIR.
  • -y, --yes β€” answer yes to all opam yes/no questions without prompting. See also --confirm-level. This is equivalent to setting $OPAMYES to "true". πŸ’…

🌍 ENVIRONMENT 🌍

okay so opam is literally listening to your environment the whole time πŸ’… she reads a whole pile of variables and changes how she behaves. Iconic of her, honestly.

One thing before we go in: any boolean var here wants you to set it to "0", "no", "false" or the empty string to switch it off 🚫, and "1", "yes" or "true" to switch it on βœ…. Pick your fave, she's not picky.


  • OPAMALLPARENS β€” surround all filters with parenthesis. group-chat energy: parentheses everywhere 🫢
  • OPAMASSUMEDEPEXTS β€” see option --assume-depexts.
  • OPAMAUTOANSWER β€” internal use only. bestie this is not for you, it's for her πŸšͺ✨
  • OPAMAUTOREMOVE β€” see the remove option --auto-remove.
  • OPAMBESTEFFORT β€” see option --best-effort.
  • OPAMBESTEFFORTPREFIXCRITERIA β€” sets the string that has to be prepended to the criteria when --best-effort is in play, and it's expected to maximise the opam-query property in the solution πŸ’–
  • OPAMBUILDDOC β€” Removed in 2.1. πŸ’€ she's gone, she's in the past, we don't talk about her
  • OPAMBUILDTEST β€” Removed in 2.1. πŸ™ˆ same, bye
  • OPAMCLI β€” see option --cli.
  • OPAMCOLOR β€” when set to always or never, it sets a default value for the --color option. 🌈
  • OPAMCONFIRMLEVEL β€” see option --confirm-level. Heads up: OPAMCONFIRMLEVEL has priority over OPAMYES and OPAMNO.
  • OPAMCRITERIA β€” specifies user preferences for dependency solving ✨ The default value depends on the solver version, so run config report if you want to know the current setting. See also option --criteria.
  • OPAMCUDFFILE β€” save the cudf graph to file-actions-explicit.dot. πŸ“Š
  • OPAMCUDFTRIM β€” controls the filtering of unrelated packages during CUDF preprocessing.
  • OPAMCURL β€” use this to select a given curl program. Check OPAMFETCH for more options.
  • OPAMDEBUG β€” see options --debug and --debug-level.
  • OPAMDEBUGSECTIONS β€” if set, it limits debug messages to the space-separated list of sections. Sections can optionally carry a specific debug level (like, for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use --debug-level. πŸ›
  • OPAMDIGDEPTH β€” defines how aggressive the lookup for conflicts is during CUDF preprocessing. πŸ”
  • OPAMDOWNLOADJOBS β€” sets the max number of simultaneous downloads. πŸš€
  • OPAMDROPWORKINGDIR β€” overrides packages that were previously updated with --working-dir on update. Without this variable set, opam would keep them unchanged unless you explicitly named them on the command-line.
  • OPAMDRYRUN β€” see option --dry-run.
  • OPAMEDITOR β€” sets the editor used for opam file editing, and it overrides $EDITOR and $VISUAL. she's the main character here πŸ‘‘
  • OPAMERRLOGLEN β€” sets the number of log lines printed when a sub-process fails. Set it to 0 to print all of them. 😭
  • OPAMEXTERNALSOLVER β€” see option --solver.
  • OPAMFAKE β€” see option --fake.
  • OPAMFETCH β€” specifies how to download files ✨ Either wget, curl, or a custom command where the variables %{url}%, %{out}%, %{retry}%, %{compress}% and %{checksum}% get replaced. It overrides the download-command value from the main config file.
  • OPAMFIXUPCRITERIA β€” same as OPAMUPGRADECRITERIA, but specifically for fixup and reinstall.
  • OPAMIGNOREAVAILABLE β€” see the install option --ignore-available-on.
  • OPAMIGNORECONSTRAINTS β€” see the install option --ignore-constraints-on.
  • OPAMIGNOREPINDEPENDS β€” see option --ignore-pin-depends.
  • OPAMINPLACEBUILD β€” see option --inplace-build.
  • OPAMJOBS β€” sets the max number of parallel workers to run. 🌸
  • OPAMJSON β€” log json output to the given file (use the character % to index the files).
  • OPAMKEEPBUILDDIR β€” see the install option --keep-build-dir.
  • OPAMKEEPLOGS β€” tells opam to not remove some temporary command logs and some backups. This skips some finalisers and may also help you get more reliable backtraces. 🫢
  • OPAMLOCKED β€” the combination of the --locked and --lock-suffix options. πŸ”’
  • OPAMLOGS β€” logdir; sets the log directory, and the default is a temporary directory in /tmp.
  • OPAMMAKECMD β€” set the system make command to use.
  • OPAMMERGEOUT β€” merge process outputs, stderr on stdout. πŸͺ„
  • OPAMNO β€” answer no to any question asked, see options --no and --confirm-level. Note that OPAMNO is ignored if either OPAMCONFIRMLEVEL or OPAMYES is set.
  • OPAMNOAGGREGATE β€” with opam admin check, don't aggregate packages.
  • OPAMNOASPCUD β€” Deprecated. πŸ’€
  • OPAMNOAUTOUPGRADE β€” disables the automatic internal upgrade of repositories in an earlier format to the current one, on update or init.
  • OPAMNOCHECKSUMS β€” enables option --no-checksums when available.
  • OPAMNODEPEXTS β€” disables system dependencies handling, see option --no-depexts.
  • OPAMNOENVNOTICE β€” Internal. πŸšͺ
  • 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. πŸŽ€
  • OPAMPRECISETRACKING β€” fine grain tracking of directories.
  • OPAMPREPRO β€” set this to false to disable CUDF preprocessing. Less efficient, but it might help you debug a solver issue. πŸ›
  • OPAMREPOSITORYTARRING β€” internally store all non-vcs repositories as tar.gz files (by default, http repositories are stored as archive). This can be much faster on filesystems that don't cope well with scanning large trees. All operations are done in-memory, no I/O for scanning the repository. πŸ”₯
  • OPAMREQUIRECHECKSUMS β€” enables option --require-checksums when available (e.g. for opam install).
  • OPAMRETRIES β€” sets the number of tries before failing downloads. πŸ”
  • OPAMREUSEBUILDDIR β€” see option --reuse-build-dir.
  • OPAMROOT β€” see option --root. This is automatically set by opam env --root=DIR --set-root. 🌱
  • OPAMROOTISOK β€” don't complain when running as root. πŸ‘‘
  • OPAMSAFE β€” see option --safe.
  • OPAMSHOW β€” see option --show. (hiii bestie that's literally us right now 😭🫢)
  • OPAMSKIPUPDATE β€” see option --skip-updates.
  • OPAMSKIPVERSIONCHECKS β€” bypasses some version checks. Unsafe, for compatibility testing only. ⚠️
  • OPAMSOLVERALLOWSUBOPTIMAL β€” (default true) allows some solvers to still return a solution when they reach timeout; while the solution remains assured to be consistent, there is no guarantee in this case that it fits the expected optimisation criteria. If true, opam will continue with a warning; if false, a timeout is an error. Currently only the builtin-z3 backend handles this degraded case.
  • OPAMSOLVERTIMEOUT β€” change the time allowance of the solver. Default is 60.0, set it to 0 for unlimited. Note that all solvers may not support this option. ⏰
  • OPAMSOLVERTOLERANCE β€” changes the tolerance towards the solver choosing an unoptimized solution (i.e. it might pull outdated packages 😬). Typical values range from 0.0 (best solution known to the solver) to 1.0 (unoptimized solution). Default is 0.0. This one is useful in case the solver can't find a solution in a reasonable time (see $OPAMSOLVERTIMEOUT). Note that all solvers may not support this option.
  • OPAMSTATS β€” Removed in 2.4. πŸ’€ she's not with us anymore
  • OPAMSTATUSLINE β€” display a dynamic status line showing what's currently going on on the terminal. (the manpage literally says "one of one of always, never or auto", and honestly? the double "one of" is giving typo but she's a legend so we keep her πŸ’… β€” the actual values are always, never or auto.)
  • OPAMSTRICT β€” fail on inconsistencies (file reading, switch import, etc.). 🚨
  • OPAMSWITCH β€” see option --switch. Automatically set by opam env --switch=SWITCH --set-switch. πŸ”€
  • OPAMUNLOCKBASE β€” see the install option --unlock-base.
  • OPAMUPGRADECRITERIA β€” specifies user preferences for dependency solving when performing an upgrade. It overrides OPAMCRITERIA in upgrades if both are set. See also option --criteria. ✨
  • OPAMUSEINTERNALSOLVER β€” see option --use-internal-solver.
  • OPAMUSEOPENSSL β€” Removed in 2.2. πŸ™ˆ
  • OPAMUTF8 β€” use UTF8 characters in output (again the manpage says "one of one of always, never or auto", love that for her β€” the values are always, never or auto). By default it's auto, which is determined from the locale. 🌈
  • OPAMUTF8MSGS β€” use extended UTF8 characters (camels πŸͺ) in opam messages. Implies OPAMUTF8. This is set by default on macOS only.
  • OPAMVALIDATIONHOOK β€” if set, uses the %{hook}% command to validate an opam repository update.
  • OPAMVERBOSE β€” see option --verbose.
  • OPAMVERBOSEON β€” see option --verbose-on.
  • OPAMVERSIONLAGPOWER β€” do not use. 😭 that's it. that's the whole description. she said "do not use" and left. icon behaviour.
  • OPAMWITHDEVSETUP β€” see the install option --with-dev-setup.
  • OPAMWITHDOC β€” see the install option --with-doc.
  • OPAMWITHTEST β€” see the install option --with-test.
  • OPAMWORKINGDIR β€” see option --working-dir.
  • OPAMYES β€” see options --yes and --confirm-level. OPAMYES has priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set. βœ…
  • 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. πŸ’œ

πŸ› οΈ CLI VERSION πŸ› οΈ

okay bestie this section is actually so important so paws and read it 🫢

All scripts and programmatic invocations of opam should use --cli in order to ensure that they work seamlessly with future versions of the opam client. ✨ And it's not just for scripts β€” blog posts or other documentation can benefit too, because it prevents information from becoming stale. no cap.

Although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. πŸ•°οΈ

Since CLI version support was only added in opam 2.1, use OPAMCLI to select 2.0 support (since opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions β€” because an environment variable controlling the parsing of syntax is brittle. πŸ’€ To this end, opam displays a warning if OPAMCLI specifies a valid version other than 2.0, and also if --cli=2.0 is specified.

The command-line version is selected by using the --cli option or the OPAMCLI environment variable. --cli may be specified more than once, where the last instance takes precedence. πŸ‘‘ OPAMCLI is only inspected if --cli is not given.

🚦 EXIT STATUS 🚦

okay so plot twist β€” there's one exception to everything you're about to read, and it's the exec command. exec returns 127 if the command wasn't found or couldn't be executed at all, and otherwise it hands you back the command's own exit value. different rules, same page, iykyk. πŸ’…

  • 0 β€” Success, or true for boolean queries. the good ending bestie ✨
  • 1 β€” False. Returned when a boolean return value is expected, e.g. when running with --check, or for queries like opam lint. not an error, just a "no"
  • 2 β€” Bad command-line arguments, or command-line arguments pointing to an invalid context (e.g. file not following the expected format). bestie you typed it wrong 😭
  • 5 β€” Not found. You requested something (package, version, repository, etc.) that couldn't be found. she's not here πŸ’€
  • 10 β€” Aborted. The operation required confirmation, which wasn't given. you said no, or you didn't say yes 🫢
  • 15 β€” Could not acquire the locks required for the operation. the lock was locked, no cap
  • 20 β€” There is no solution to the user request. This can be caused by asking to install two incompatible packages, for example. physically impossible, sorry babe
  • 30 β€” Error in package definition, or other metadata files. Using --strict raises this error more often. πŸ“„πŸ’₯
  • 31 β€” Package script error. Some package operations were unsuccessful. This may be an error in the packages or an incompatibility with your system. This can be a partial error. she tried and tripped πŸ₯²
  • 40 β€” Sync error. Could not fetch some remotes from the network. This can be a partial error. the wifi said no 🌐
  • 50 β€” Configuration error. Opam or system configuration doesn't allow operation, and needs fixing. πŸ”§
  • 60 β€” Solver failure. The solver failed to return a sound answer. It can be due to a broken external solver, or an error in solver configuration. the solver got confused fr fr
  • 99 β€” Internal error. Something went wrong, likely due to a bug in opam itself. not us, it's them (it's us) 🫣
  • 130 β€” User interrupt. SIGINT was received, generally due to the user pressing Ctrl+C. bestie you panicked πŸ’…

and then, the generic ones:

  • 0 β€” on success. βœ…
  • 123 β€” on indiscriminate errors reported on standard error.
  • 124 β€” on command line parsing errors.
  • 125 β€” on unexpected internal errors (bugs). a bug spotted in the wild πŸ›

πŸ“š FURTHER DOCUMENTATION πŸ“š

More reading, more slaying β€” head over to https://opam.ocaml.org/doc. 🌈


πŸ‘‘ AUTHORS πŸ‘‘

the iconic legends who made this happen, put some respect on their names:

  • David Allsopp <david@tarides.com>
  • Vincent Bernardoff <vb@luminar.eu.org>
  • Raja Boujbel <raja.boujbel@ocamlpro.com>

…and the second lineup, equally iconic:

  • Kate Deplaix <kit-ty-kate@exn.st>
  • Roberto Di Cosmo <roberto@dicosmo.org>
  • Thomas Gazagnaire <thomas@gazagnaire.org>
  • Louis Gesbert <louis.gesbert@ocamlpro.com>
  • Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
  • Anil Madhavapeddy <anil@recoil.org>
  • Guillem Rieu <guillem.rieu@ocamlpro.com>
  • Ralf Treinen <ralf.treinen@pps.jussieu.fr>
  • Frederic Tuong <tuong@users.gforge.inria.fr>

πŸ¦‹ SEE ALSO πŸ¦‹

  • opam(1) β€” the main character, obviously πŸ’–

πŸ› BUGS πŸ›

Found something cursed? Check bug reports at https://github.com/ocaml/opam/issues. be nice, the maintainers are people too 🫢


aaaand that's the whole page bestie, you read every single line of it, main character energy πŸ‘‘πŸ’… this page came from Opam 2.6.1, and the date slot at the bottom just reads OPAM-SHOW(1) β€” so that's the manual page name doing double duty as the timestamp. iconic behavior honestly. go confuse your friends with exit code 130, love u, bye βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from