### Install Local Package for Testing Source: https://opam.ocaml.org/doc/2.0/Packaging.html Run this command from your project root to install the package locally and test its setup. ```bash opam install . ``` -------------------------------- ### Install Packages with Opam Source: https://opam.ocaml.org/doc/2.0/Usage.html Use `opam install` to download, build, and install packages and their dependencies. Version constraints can be specified. ```shell opam install lwt ``` ```shell opam install ocp-indent ocp-index.1.0.2 ``` ```shell opam install "ocamlfind>=1.4.0" ``` -------------------------------- ### Opam Install with Custom Criteria Source: https://opam.ocaml.org/doc/2.0/External_solvers.html Use the --criteria option to specify preferences for a single opam install command. This example prioritizes minimizing removals and changes. ```bash opam install --criteria="-removed,-changed" ... ``` -------------------------------- ### install Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSysInteract Installs a list of system packages, considering the Opam configuration and switch state. ```APIDOC ## Function: install ### Description Installs a list of system packages. This function takes an optional environment, switch state, and Opam configuration. ### Signature `val install : ?env:OpamStateTypes.gt_variables -> OpamStateTypes.rw OpamStateTypes.switch_state option -> OpamFile.Config.t -> OpamSysPkg.to_install -> unit` ``` -------------------------------- ### Install opam on FreeBSD Source: https://opam.ocaml.org/doc/2.0/Install.html Use pkg to install opam on FreeBSD systems. ```bash pkg install ocaml-opam ``` -------------------------------- ### Install Switch Configuration Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchAction (Re-)install the configuration for a given root and switch. ```APIDOC ## install_switch_config ### Description (Re-)install the configuration for a given root and switch. ### Parameters - `OpamTypes.dirname`: The directory of the switch root. - `OpamTypes.switch`: The name of the switch. - `OpamFile.Switch_config.t`: The switch configuration to install. ### Returns `unit` ``` -------------------------------- ### install Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSysInteract/index.html Installs a set of system packages, optionally specifying environment variables, switch state, and configuration. ```APIDOC ## install ### Description Installs a set of system packages, optionally specifying environment variables, switch state, and configuration. ### Signature `val install : ?env:OpamStateTypes.gt_variables -> OpamStateTypes.rw OpamStateTypes.switch_state option -> OpamFile.Config.t -> OpamSysPkg.to_install -> unit` ``` -------------------------------- ### Manually install opam binary Source: https://opam.ocaml.org/doc/2.0/Install.html If script-based installation fails or is not preferred, download the binary manually, place it in your PATH, and make it executable. ```bash sudo install /usr/local/bin/opam ``` -------------------------------- ### Install and remove packages Source: https://opam.ocaml.org/doc/2.0/Usage.html Download, build, install, or uninstall packages and their dependencies. ```bash opam install PACKAGE # Download, build and install the latest version of PACKAGE # and all its dependencies ``` ```bash opam remove PACKAGE # Uninstall the given package ``` -------------------------------- ### Install Cygwin Packages Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSysInteract/Cygwin/index.html Installs a list of system packages for Cygwin. ```APIDOC ## install ### Description Installs a list of system packages for Cygwin. ### Signature `val install : OpamSysPkg.t list -> unit` ``` -------------------------------- ### Install opam using Bash script Source: https://opam.ocaml.org/doc/2.0/Install.html Use this script for a quick installation of the latest opam binary. It checks your architecture, downloads the appropriate pre-compiled binary, backs up existing data, and runs `opam init`. ```bash bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)" ``` -------------------------------- ### Install opam on OpenBSD Source: https://opam.ocaml.org/doc/2.0/Install.html Use pkg_add to install opam on OpenBSD systems. ```bash pkg_add opam ``` -------------------------------- ### Install compiler base packages Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamSwitchCommand Installs the base packages for a compiler according to its invariant. The `ask` parameter prompts the user for confirmation. ```APIDOC ## install_compiler Installs the base packages for a compiler. ### Parameters - `switch_state`: The current switch state. - `additional_installs`: Optional list of additional packages to install. - `deps_only`: Whether to only install dependencies. - `ask`: Whether to prompt the user for confirmation. ``` -------------------------------- ### Install opam on Fedora Source: https://opam.ocaml.org/doc/2.0/Install.html Use dnf to install opam on Fedora systems. ```bash dnf install opam ``` -------------------------------- ### File Installation Lists Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamFile/Dot_install/index.html Functions to retrieve lists of files to be installed in various directories. ```APIDOC ## File Installation Lists ### Functions #### `val bin : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of files to install in $bin/. #### `val sbin : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of files to install in $sbin/. #### `val lib : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of files to install in $lib/. #### `val toplevel : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of toplevel files. #### `val stublibs : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` C bindings. #### `val share : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of architecture-independent files. #### `val share_root : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of files under the more general share prefix. #### `val etc : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of etc files. #### `val doc : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` List of doc files. #### `val man : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` Man pages. #### `val libexec : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` Executable files under lib/. #### `val lib_root : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` Not relative to the package's lib dir. #### `val libexec_root : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.basename option) list` Not relative to the package's lib dir, and with +x set. #### `val misc : t -> (OpamTypes.basename OpamTypes.optional * OpamTypes.filename) list` List of other files to install. ``` -------------------------------- ### Install opam on Guix & Guix System Source: https://opam.ocaml.org/doc/2.0/Install.html Use guix to install opam on Guix and Guix System. ```bash guix install opam ``` -------------------------------- ### Install opam on Debian and Ubuntu Source: https://opam.ocaml.org/doc/2.0/Install.html Use apt to install opam on Debian and Ubuntu-based systems. ```bash apt install opam ``` -------------------------------- ### install Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamClient/index.html Installs a list of packages. This function can manage package roots, autoupdates, and handle dependencies. ```APIDOC ## install ### Description Install the given list of packages. `add_to_roots`, if given, specifies that given packages should be added or removed from the roots. `autoupdate` defaults to the list of atoms, and can be used to restrict the atoms which are updated if pinned. ### Parameters - `OpamStateTypes.rw OpamStateTypes.switch_state` - Required - The switch state to operate on. - `formula` (OpamTypes.formula) - Optional - The formula to use for installation. - `autoupdate` (OpamTypes.atom list) - Optional - List of atoms to autoupdate. - `add_to_roots` (bool) - Optional - Whether to add packages to roots. - `deps_only` (bool) - Optional - Whether to only install dependencies. - `ignore_conflicts` (bool) - Optional - Whether to ignore conflicts. - `assume_built` (bool) - Optional - Whether to assume packages are already built. - `download_only` (bool) - Optional - Whether to only download packages. - `depext_only` (bool) - Optional - Whether to only handle external dependencies. - `OpamTypes.atom list` - Required - The list of packages to install. ### Returns - `OpamStateTypes.rw OpamStateTypes.switch_state` - The updated switch state. ``` -------------------------------- ### Install opam on Mageia Source: https://opam.ocaml.org/doc/2.0/Install.html Use urpmi to install opam on Mageia systems. ```bash urpmi opam ``` -------------------------------- ### System Packages to Install Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamSysPkg Defines the `to_install` type to categorize system packages that need to be installed, separating them by whether they are required by new or existing Opam packages. ```APIDOC ## System Packages to Install ### Type `to_install` Represents system packages that need to be installed. - `ti_new : Set.t` Packages to install required by new Opam packages. - `ti_required : Set.t` Packages to install required by already installed Opam packages. ### Functions - `to_install_empty : to_install` An empty `to_install` value. - `string_of_to_install : to_install -> string` Converts a `to_install` value to a string representation. ``` -------------------------------- ### install Source: https://opam.ocaml.org/doc/2.0/api/opam-solver/OpamCudf/index.html Installs a package into the universe. This function does not enforce invariants, meaning the resulting universe might contain multiple versions of the same package. ```APIDOC ## install ### Description Install a package in the universe. We don't care about any invariant here (eg. the resulting universe can have multiple versions of the same package installed). ### Parameters - `universe` (Cudf.universe) - `package` (Cudf.package) ### Returns - `Cudf.universe` ``` -------------------------------- ### Opam Install File Format Source: https://opam.ocaml.org/doc/2.0/Manual.html Defines installation paths for package files. Supports various destination directories and optional path/filename mapping. A leading '?' in the origin filename makes the file optional. ```opam-install lib: [ "foo.ml" {"lib/foo.ml"} ] bin: [ "my-executable" ] share: [ "data.txt" {"share/data.txt"} ] etc: [ "?myconfig.conf" {"etc/myconfig.conf"} ] ``` -------------------------------- ### Install maximum number of packages with Opam Source: https://opam.ocaml.org/doc/2.0/Tricks.html This sequence of commands attempts to install as many packages as possible into a local switch. It updates the package index, creates a new switch, and then installs all available packages using a best-effort approach. This process can be time-consuming. ```shell opam update opam switch create . ocaml-base-compiler.$(VERSION) export OPAMSOLVERTIMEOUT=3600 export OPAMSOLVERTOLERANCE=1.0 opam list --available -s | xargs opam install --best-effort --yes ``` -------------------------------- ### Install opam on Arch Linux Source: https://opam.ocaml.org/doc/2.0/Install.html Use pacman to install opam on Arch Linux systems. ```bash pacman -S opam ``` -------------------------------- ### Install package in all opam switches Source: https://opam.ocaml.org/doc/2.0/Tricks.html A shell loop to install a package across all configured opam switches. Consider adding `--yes` for automation. ```bash for switch in $(opam switch list -s); do opam install --switch $switch PACKAGE done ``` -------------------------------- ### Install opam on macOS using Homebrew and MacPorts Source: https://opam.ocaml.org/doc/2.0/Install.html Install opam on macOS using either the Homebrew or MacPorts package managers. ```bash # Homebrew brew install opam ``` ```bash # MacPort port install opam ``` -------------------------------- ### Switch Installed Opams Cache File Path Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamPath/Switch/index.html Gets the path to the cache file for the mirrored installed package metadata. ```APIDOC ## installed_opams_cache ### Description Cache file for the mirrored installed package metadata _$meta/packages/cache_ ### Signature `val installed_opams_cache : t -> OpamTypes.switch -> OpamTypes.filename` ``` -------------------------------- ### Installed Package Opam File Path Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamPath/Switch/index.html Gets the path to the mirrored Opam file for a given installed package within a switch. ```APIDOC ## installed_opam ### Description The mirror of the opam file for the given installed package _$meta/packages/$name.$version/opam_ ### Signature `val installed_opam : t -> OpamTypes.switch -> OpamTypes.package -> OpamFile.OPAM.t OpamFile.t` ``` -------------------------------- ### OpamFile Dot_install Module Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamFile Handles `.install` files. ```APIDOC ### Configuration files ### `module Dot_install : sig ... end` .install files. ``` -------------------------------- ### Create a Local Opam Switch for Project Dependencies Source: https://opam.ocaml.org/doc/2.0/man/opam-switch.html Prepares a local switch for building a project by scanning the current directory for package definitions, selecting a compatible compiler, and installing dependencies. ```bash opam switch create ./ --deps-only ``` -------------------------------- ### Install opam using PowerShell on Windows Source: https://opam.ocaml.org/doc/2.0/Install.html This PowerShell script is used to install opam on Windows. It automates the download and setup process for the Windows environment. ```powershell Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) }" ``` -------------------------------- ### Package Changes File Path Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamPath/Switch/index.html Gets the path to the file registering changes made during the installation of a specific package. ```APIDOC ## changes ### Description File registering the changes made by the installation of the given package _$meta/install/$name.changes_ ### Signature `val changes : t -> OpamTypes.switch -> OpamTypes.name -> OpamDirTrack.t OpamFile.t` ``` -------------------------------- ### Create a new opam switch Source: https://opam.ocaml.org/doc/2.0/Manual.html Creates a new switch, optionally specifying a compiler to install base packages or starting with an empty switch. ```bash opam switch create (|--empty) ``` -------------------------------- ### OpamState.get_package Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchState Gets the current version of a package by its name. It checks in the order: pinned version, installed version, maximum available version, or maximum existing version. Raises `Not_found` if no package with the given name exists. ```APIDOC ## OpamState.get_package ### Description Gets the current version of package `name`: pinned version, installed version, max available version or max existing version, tried in this order. ### Raises `Not_found` only if there is no package by this name. ### Function Signature `val get_package : 'a OpamStateTypes.switch_state -> OpamTypes.name -> OpamTypes.package` ``` -------------------------------- ### install_depexts Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamSolution Installs external dependencies for packages. It can optionally force installation, require confirmation, and takes the current switch state and sets of packages to install and already installed packages. ```APIDOC ## install_depexts ### Description Installs external dependencies for packages. It can optionally force installation, require confirmation, and takes the current switch state and sets of packages to install and already installed packages. ### Signature `val install_depexts : ?force_depext:bool -> ?confirm:bool -> OpamStateTypes.rw OpamStateTypes.switch_state -> pkg_to_install:OpamTypes.package_set -> pkg_installed:OpamTypes.package_set -> OpamStateTypes.rw OpamStateTypes.switch_state` ``` -------------------------------- ### install Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamPath/Builddir/index.html Retrieves the package.install file from the build directory. The file is located at _$builddir/$name.install_. ```APIDOC ## install ### Description Retrieves the package.install file from the build directory. The file is located at _$builddir/$name.install_. ### Signature `val install : OpamTypes.dirname -> OpamTypes.package -> OpamFile.Dot_install.t OpamFile.t` ``` -------------------------------- ### init Source: https://opam.ocaml.org/doc/2.0/api/opam-repository/OpamGit/VCS/index.html Initializes a new version control repository at the specified directory with the given URL. ```APIDOC ## init ### Description Init a repository. ### Signature `val init : OpamTypes.dirname -> OpamTypes.url -> unit OpamProcess.job` ``` -------------------------------- ### Install System Dependencies with opam depext Source: https://opam.ocaml.org/doc/2.0/FAQ.html Use this command to install system-level dependencies required by OCaml packages. It handles installing the 'opam-depext' plugin if necessary and prompts for system package manager installation. ```bash opam depext ``` -------------------------------- ### Initialize Configuration and Return Value Source: https://opam.ocaml.org/doc/2.0/api/opam-core/OpamCoreConfig Similar to `init`, but returns a provided value after initialization, useful for stacking optional arguments. ```APIDOC val initk : 'a -> 'a options_fun ``` -------------------------------- ### install_depexts Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamSolution/index.html Installs external dependencies (system packages) required by OPAM packages. It can optionally force installation, prompt for confirmation, and takes the current switch state, the set of packages to install, and the set of already installed packages as input. ```APIDOC ## install_depexts ### Description Installs external dependencies (system packages) required by OPAM packages. It can optionally force installation, prompt for confirmation, and takes the current switch state, the set of packages to install, and the set of already installed packages as input. ### Signature val install_depexts : ?force_depext:bool -> ?confirm:bool -> OpamStateTypes.rw OpamStateTypes.switch_state -> pkg_to_install:OpamTypes.package_set -> pkg_installed:OpamTypes.package_set -> OpamStateTypes.rw OpamStateTypes.switch_state ``` -------------------------------- ### System Packages to Install Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamSysPkg/index.html Defines the `to_install` type to categorize system packages that need to be installed, distinguishing between new and already installed package requirements. ```APIDOC ## Type `to_install` Represents system packages that need to be installed. ``` type to_install = { ti_new : Set.t; (* Package to install required by new opam packages *) ti_required : Set.t; (* Package to install required by already install opam packages *) } ``` ### Functions - `to_install_empty : to_install` An empty `to_install` value. - `string_of_to_install : to_install -> string` Converts a `to_install` value to a string representation. ``` -------------------------------- ### install_compiler Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamSwitchCommand/index.html Installs a compiler's base packages according to its invariant. The `ask` parameter controls whether the user is prompted. ```APIDOC ## install_compiler ### Description Used to initially install a compiler's base packages, according to its invariant. `ask` triggers prompting the user as for normal installs; defaults to `false`. ### Parameters - `switch_state`: `OpamStateTypes.rw OpamStateTypes.switch_state` - The current switch state. - `additional_installs`: `OpamTypes.atom list` (optional) - Additional packages to install. - `deps_only`: `bool` (optional) - Whether to only install dependencies. - `ask`: `bool` (optional) - Whether to prompt the user. ### Returns - `OpamStateTypes.rw OpamStateTypes.switch_state` - The updated switch state. ``` -------------------------------- ### Install Specific Packages with Version Constraints Source: https://opam.ocaml.org/doc/2.0/FAQ.html Explicitly request installation or upgrade of specific packages, optionally with version constraints. This can help resolve conflicts or ensure specific versions are installed. ```bash opam upgrade PACKAGES ``` ```bash opam install 'PACKAGE>=VERSION' PACKAGE... ``` -------------------------------- ### update_user_setup Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamEnv/index.html Updates the user configuration in $HOME for good opam integration. ```APIDOC ## update_user_setup ### Description Update the user configuration in $HOME for good opam integration. ### Signature `val update_user_setup : OpamTypes.dirname -> ?dot_profile:OpamTypes.filename -> OpamTypes.shell -> unit` ``` -------------------------------- ### Install Metadata Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchAction Add the package metadata to the switch-local cache of installed packages. ```APIDOC ## install_metadata ### Description Add the package metadata to the switch-local cache of installed packages. ### Parameters - `OpamStateTypes.rw OpamStateTypes.switch_state`: The switch state. - `OpamTypes.package`: The package to add metadata for. ### Returns `unit` ``` -------------------------------- ### init Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamClient/index.html Initializes the Opam client to a consistent state. This function sets up the client and can return the initial state along with a set of packages if a switch is created. ```APIDOC ## init ### Description Initializes the client to a consistent state. Returns the initial state and, in case a switch is to be created, its initial set of packages. ### Parameters - `init_config` (OpamFile.InitConfig.t) - Required - Configuration for initialization. - `interactive` (bool) - Required - Whether to run in interactive mode. - `repo` (OpamTypes.repository) - Optional - The repository to use. - `bypass_checks` (bool) - Optional - Whether to bypass checks. - `dot_profile` (OpamTypes.filename) - Optional - Path to the .profile file. - `update_config` (bool) - Optional - Whether to update the configuration. - `env_hook` (bool) - Optional - Whether to use an environment hook. - `completion` (bool) - Optional - Whether to enable completion. - `check_sandbox` (bool) - Optional - Whether to check the sandbox. - `cygwin_setup` - Optional - Cygwin setup configuration. Possible values: `internal of OpamSysPkg.t list`, `default_location`, `location of OpamTypes.dirname`, `no`. - `git_location` - Optional - Git location configuration. Can be `OpamTypes.dirname` or `unit`. - `OpamTypes.shell` - Required - The shell to use. - `OpamStateTypes.rw OpamStateTypes.global_state` - Required - The global state to operate on. - `OpamStateTypes.unlocked OpamStateTypes.repos_state` - Required - The repositories state. - `OpamTypes.atom list` - Required - A list of atoms. ### Returns - `OpamStateTypes.rw OpamStateTypes.global_state` - The initial global state. - `OpamStateTypes.unlocked OpamStateTypes.repos_state` - The unlocked repositories state. - `OpamTypes.atom list` - The initial set of packages if a switch is created. ``` -------------------------------- ### List and search packages Source: https://opam.ocaml.org/doc/2.0/Usage.html Use these commands to list all available packages or search for packages by name or description. ```bash opam list -a # List all available packages ``` ```bash opam search QUERY # List packages with QUERY in their name or description ``` -------------------------------- ### OpamHg.VCS.init Source: https://opam.ocaml.org/doc/2.0/api/opam-repository/OpamHg/VCS/index.html Initializes a new version control repository at the specified directory with the given URL. ```APIDOC ## OpamHg.VCS.init ### Description Init a repository. ### Signature `val init : OpamTypes.dirname -> OpamTypes.url -> unit OpamProcess.job` ``` -------------------------------- ### list_all Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamRepositoryCommand/index.html Lists all configured Opam repositories and their associated switches. ```APIDOC ## list_all ### Description Lists all configured repositories, and, if not `short`, the switches they are selected in. ### Parameters - `short`: bool - If true, provides a shorter output format, listing only repository names. ### Signature `val list_all : 'a OpamStateTypes.repos_state -> short:bool -> unit` ``` -------------------------------- ### stateless_install Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSysInteract/index.html Performs a stateless installation, returning a boolean indicating success. Optionally uses provided environment variables. ```APIDOC ## stateless_install ### Description Performs a stateless installation, returning a boolean indicating success. Optionally uses provided environment variables. ### Signature `val stateless_install : ?env:OpamStateTypes.gt_variables -> unit -> bool` ``` -------------------------------- ### Create Opam Switch with Repositories Source: https://opam.ocaml.org/doc/2.0/Usage.html This command creates a new opam switch and binds it to specific repositories. Use the `--repos` option to specify a comma-separated list of repository names and their addresses, including 'default' if desired. ```bash opam switch create --repos =
,default ``` -------------------------------- ### OpamFormatConfig.initk Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamFormatConfig/index.html Initializes the options like `init`, but returns a given value, facilitating argument stacking. ```APIDOC val initk : 'a -> 'a options_fun (* Sets the options like `init`, but returns the given value (for arguments stacking) *) ``` -------------------------------- ### import Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamSwitchCommand/index.html Imports packages to install from a file. If `deps_only` is true, root packages are not installed. ```APIDOC ## import ### Description Import a file which contains the packages to install. If `deps_only` is true do not install root packages. ### Parameters - `switch_state`: `OpamStateTypes.rw OpamStateTypes.switch_state` - The current switch state. - `deps_only`: `bool` (optional) - If true, do not install root packages. - `file`: `OpamFile.SwitchExport.t OpamFile.t option` (optional) - The file to import. ### Returns - `OpamStateTypes.rw OpamStateTypes.switch_state` - The updated switch state. ``` -------------------------------- ### main Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamCliMain/index.html The default entry point for the Opam CLI, including handling of debug finalizers. ```APIDOC ## main ### Description Default entry point with handling of debug finalisers. ### Signature `val main : unit -> unit` ``` -------------------------------- ### OpamState.find_installed_package_by_name Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchState Retrieves the installed package corresponding to the given name. Raises `Not_found` if no such package is installed. ```APIDOC ## OpamState.find_installed_package_by_name ### Description Return the installed package with the right name. ### Raises `Not_found` when appropriate. ### Function Signature `val find_installed_package_by_name : 'a OpamStateTypes.switch_state -> OpamTypes.name -> OpamTypes.package` ``` -------------------------------- ### Remove Installed Cache Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchState/Installed_cache/index.html Removes the installed package opam file cache from a given filename. ```APIDOC ## remove ### Description Removes the installed package opam file cache from a given filename. ### Signature `val remove : OpamFilename.t -> unit` ### Parameters - **filename** (`OpamFilename.t`): The path to the cache file to remove. ``` -------------------------------- ### Save Installed Cache Source: https://opam.ocaml.org/doc/2.0/api/opam-state/OpamSwitchState/Installed_cache/index.html Saves the installed package opam file cache to a given filename. ```APIDOC ## save ### Description Saves the installed package opam file cache to a given filename. ### Signature `val save : OpamFilename.t -> t -> unit` ### Parameters - **filename** (`OpamFilename.t`): The path where the cache will be saved. - **cache** (`t`): The cache data to save. ``` -------------------------------- ### list_all Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamRepositoryCommand Lists all configured repositories, and optionally the switches they are selected in. ```APIDOC ## list_all ### Description Lists all configured repositories, and, if not `short`, the switches they are selected in. ### Parameters - `short` (bool) - If true, only list repository names. ### Signature `val list_all : 'a OpamStateTypes.repos_state -> short:bool -> unit` ``` -------------------------------- ### Install opam on Alpine Linux Source: https://opam.ocaml.org/doc/2.0/Install.html Use apk to install opam on Alpine Linux systems. ```bash apk add opam ``` -------------------------------- ### main Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamCliMain Default entry point with handling of debug finalisers. ```APIDOC ## val main : unit -> unit ### Description Default entry point with handling of debug finalisers. ``` -------------------------------- ### OpamClient.init Source: https://opam.ocaml.org/doc/2.0/api/opam-client/OpamClient Initializes the OPAM client to a consistent state. This function sets up the client and can create a new switch with its initial packages. ```APIDOC ## OpamClient.init ### Description Initialize the client to a consistent state. Returns the initial state and, in case a switch is to be created, its initial set of packages. ### Parameters - `init_config`: Configuration for initialization. - `interactive`: Boolean indicating interactive mode. - `repo` (optional): The repository to use. - `bypass_checks` (optional): Boolean to bypass checks. - `dot_profile` (optional): Filename for the dot profile. - `update_config` (optional): Boolean to update configuration. - `env_hook` (optional): Boolean for environment hook. - `completion` (optional): Boolean for completion. - `check_sandbox` (optional): Boolean to check sandbox. - `cygwin_setup` (optional): Cygwin setup configuration. - `git_location` (optional): Git location configuration. - `shell`: The shell to use. ### Returns - `OpamStateTypes.rw OpamStateTypes.global_state * OpamStateTypes.unlocked OpamStateTypes.repos_state * OpamTypes.atom list`: The initial state, unlocked repositories state, and a list of initial atoms. ``` -------------------------------- ### Switch Install Directory Path Source: https://opam.ocaml.org/doc/2.0/api/opam-format/OpamPath/Switch/index.html Retrieves the directory containing metadata for all installed files within a switch. ```APIDOC ## install_dir ### Description Installed files: _$meta/install/_ ### Signature `val install_dir : t -> OpamTypes.switch -> OpamTypes.dirname` ``` -------------------------------- ### Initialize opam environment Source: https://opam.ocaml.org/doc/2.0/Usage.html Run this command to initialize the opam environment in your user's home directory. ```bash opam init # Initialize ~/.opam ```