{"id":28615729,"url":"https://github.com/ocamlpro/opam-manager","last_synced_at":"2025-10-06T10:55:23.337Z","repository":{"id":33910192,"uuid":"37627342","full_name":"OCamlPro/opam-manager","owner":"OCamlPro","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-12T12:42:34.000Z","size":35,"stargazers_count":10,"open_issues_count":5,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-03-11T18:18:49.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCamlPro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-17T23:54:03.000Z","updated_at":"2016-10-15T19:03:11.000Z","dependencies_parsed_at":"2022-09-04T11:00:28.450Z","dependency_job_id":null,"html_url":"https://github.com/OCamlPro/opam-manager","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/OCamlPro/opam-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCamlPro","download_url":"https://codeload.github.com/OCamlPro/opam-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382359,"owners_count":22848845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T02:09:47.265Z","updated_at":"2025-10-06T10:55:18.303Z","avatar_url":"https://github.com/OCamlPro.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"## opam-manager (early-alpha release)\n\nOpam-manager helps in managing binaries in OPAM installation and it eases switching between multiple compiler version or multiple OPAMROOTs. It should completely avoids the usage of `eval $(opam config env)`.\n\nOpam-manager maintains in the directory `~/.ocp/manager/bin` a wrapper for each binaries found in known OPAMROOTs. This wrapper is a small binary that:\n* determines the current OPAMROOT and OPAMSWITCH,\n* setups the correct environment variables (such as `CAML_LD_LIBRARY_PATH`, ...), and\n* execute the corresponding binary in the selected switch.\n\nWhen no corresponding binary is found in the current switch Opam-manager may execute a default binary (typically the corresponding binary in a fixed OPAM switch).\n\n## Installation\n\n```\nSRC=\"https://github.com/ocaml/opam.git#master\"\nPACKAGES=\"opam-client opam-core opam-format opam-repository opam-solver opam-state\"\nfor pkg in  ${PACKAGES}; do opam pin add --no-action $pkg \"${SRC}\"; done\nopam pin add opam-manager https://github.com/OCamlPro/opam-manager.git\nopam manager\n```\n\n*Warning*: this works only with `opam-2.0~dev`.\n\nThen edit your shell configuration and update your PATH. For instance,\nadd the following line to your `.bashrc`\n\n```\nexport PATH=${HOME}/.ocp/manager/bin:${PATH}\n```\n\nFurther call to `opam install` will automatically create wrappers for the newly installed binaries.\n\nRunning `opam manager` again will perform maintenance tasks, such as removing dangling wrapper.\n\n## Manage default binary\n\nWhen a binary is not available in the current switch, you may define a default binary either a binary from a specific switch or an 'external' binary. There is currently no CLI for managing default binary. You have to manually create (absolute) symbolic link in `~/.ocp/manager/defaults`. For instance:\n\n```\nln -s ${HOME}/.opam/4.02.2/bin/ocp-indent ${HOME}/.ocp/manager/defaults/ocp-indent\n```\n\nThen `ocp-indent` will be available in any OPAMSWITCH.\n\n## Manage multiple OPAMROOTs\n\nOpam-manager is able to manage multiple OPAMROOT. Managed OPAMROOT must be named and registred by editing `~/.ocp/manager/config`. For instance:\n\n```\ndefault-root: \"home\"\nknown-roots: [\n  [\"home\" \"/home/henry/.opam\"]\n  [\"typerex\" \"/home/henry/OCamlPro/Typerex/.opam\"]\n  [\"flambda\" \"/home/henry/OCamlPro/Flambda/.opam\"]\n]\n```\n\n## Current switch\n\nThe current switch is determined with the following procedure:\n\n* when the binary is named `opam`, and `--root` or `--switch` are found in its arguments, use them as default;\n* if OPAMROOT and OPAMSWITCH are defined, use them;\n* if only OPAMROOT is defines, use the 'default' switch of it;\n* if only OPAMSWITCH is defined, look for it in the default 'root';\n* if neither OPAMROOT or OPAMSWITCH are defined:\n  * recursively look after an `.opam-switch` file in the current directory or its ancestors;\n  * otherwise, use the default 'switch' of the default 'root'.\n\nThe `--switch` passed to `opam`, the OPAMSWITCH variable, or an `.opam-switch` file may contains a string `\u003croot\u003e:\u003cswitch\u003e`, where:\n* `\u003croot\u003e` correspond to a root name in `~/.ocp/manager/config`, and \n* `\u003cswitch\u003e` a valid switch in this root.\n\nThe `--root` passed to `opam`,or the OPAMROOT variable may contains a PATH or a known root name.\n\nFor instance: `OPAMSWITCH=typerex:4.02.2+ocp1 ocaml` will run the OCaml toplevel found in the switch `4.02.2+ocp1` in the root named `typerex`. This is equivalent to `OPAMROOT=typerex OPAMSWITCH=4.02.2+ocp1 ocaml`.\n\n## Work-in-progress\n\nOpam-manager is in early-alpha stage. The `wrapper` is almost features complete but the CLI is far from complete.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fopam-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focamlpro%2Fopam-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fopam-manager/lists"}