{"id":13814432,"url":"https://github.com/ekalinin/envirius","last_synced_at":"2025-08-24T14:14:35.086Z","repository":{"id":14112668,"uuid":"16817419","full_name":"ekalinin/envirius","owner":"ekalinin","description":"Universal Virtual Environments Manager","archived":false,"fork":false,"pushed_at":"2018-01-07T20:27:58.000Z","size":314,"stargazers_count":329,"open_issues_count":3,"forks_count":51,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T11:06:19.438Z","etag":null,"topics":["shell","virtualenv"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekalinin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T21:13:06.000Z","updated_at":"2025-02-28T18:13:22.000Z","dependencies_parsed_at":"2022-08-28T22:30:31.020Z","dependency_job_id":null,"html_url":"https://github.com/ekalinin/envirius","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekalinin%2Fenvirius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekalinin%2Fenvirius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekalinin%2Fenvirius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekalinin%2Fenvirius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekalinin","download_url":"https://codeload.github.com/ekalinin/envirius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"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":["shell","virtualenv"],"created_at":"2024-08-04T04:01:57.625Z","updated_at":"2025-04-07T13:06:59.008Z","avatar_url":"https://github.com/ekalinin.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"envirius\n========\n\n``envirius`` — universal virtual environments manager.\n\nTable of Contents\n-----------------\n\n  * [Envirius](#envirius)\n    * [Idea](#idea)\n    * [Features](#features)\n  * [Installation](#installation)\n  * [Uninstallation](#uninstallation)\n  * [Available plugins](#available-plugins)\n  * [Usage](#usage)\n    * [Check available plugins](#check-available-plugins)\n    * [Check available versions for each plugin](#check-available-versions-for-each-plugin)\n    * [Create an environment](#create-an-environment)\n    * [Activate/deactivate environment](#activatedeactivate-environment)\n      * [Activating in a new shell](#activating-in-a-new-shell)\n      * [Activating in the same shell](#activating-in-the-same-shell)\n    * [Get list of environments](#get-list-of-environments)\n    * [Get current activated environment](#get-current-activated-environment)\n    * [Do something in environment without enabling it](#do-something-in-environment-without-enabling-it)\n    * [Export environment into tar archive](#export-environment-into-tar-archive)\n    * [Import environment from tar archive ](#import-environment-from-tar-archive)\n    * [Get help](#get-help)\n    * [Get help for a command](#get-help-for-a-command)\n  * [How to add a plugin?](#how-to-add-a-plugin)\n    * [Mandatory elements](#mandatory-elements)\n      * [plug_list_versions](#plug_list_versions)\n      * [plug_url_for_download](#plug_url_for_download)\n      * [plug_build](#plug_build)\n    * [Optional elements](#optional-elements)\n      * [Variables](#variables)\n      * [Functions](#functions)\n    * [Examples](#examples)\n  * [Example of the usage](#example-of-the-usage)\n  * [Dependencies](#dependencies)\n  * [Supported OS](#supported-os)\n  * [Tests](#tests)\n  * [Version History](#version-history)\n  * [License](#license)\n  * [README in another language](#readme-in-another-language)\n\nIdea\n----\n\nUsually this kind of tools narrowly specialized for a particular\nprogramming language. For example:\n\n  * [virtualenv](https://github.com/pypa/virtualenv/) for python\n  * [rvm](https://github.com/wayneeseguin/rvm/) for ruby\n  * [kerl](https://github.com/spawngrid/kerl/) for erlang\n  * [nvm](https://github.com/creationix/nvm)/[nodeenv](https://github.com/ekalinin/nodeenv/) for node.js\n  * and so on\n\nBut there are many cases when in the same environment you must have more\nthan one programming language. For example, to create an environment with\n``python2.6`` and ``node.js 0.10.24``. This idea underlies ``envirius``.\n\nSupport for new programming languages are implemented as plug-ins (see below).\n\nFeatures\n--------\n\n* clean design\n* easy extensible\n* test coverage\n\nInstallation\n============\n\nAt first:\n\n```bash\n$ git clone https://github.com/ekalinin/envirius.git\n$ cd envirius\n$ make install\n```\n\nThen youd need to add into your ``.bashrc`` the following:\n\n```bash\n[ -f \"$HOME/.envirius/nv\" ] \u0026\u0026 . ~/.envirius/nv\n```\n\nUninstallation\n==============\n\nJust do the following:\n\n```bash\n$ cd envirius\n$ make uninstall\n```\n\nCache and previously created environments will not be deleted.\n\nAvailable plugins\n=================\n\nYou can create environments for the following programming languages:\n\n* [erlang](http://erlang.org/)\n* [rust](http://rust-lang.org/)\n* [elixir](http://elixir-lang.org/)\n* [julia](http://julialang.org/)\n* [node.js](http://nodejs.org/)\n* [iojs](https://iojs.org/)\n* [python](https://www.python.org/)\n* [go](http://golang.org/)\n* [haskell](http://haskell.org/)\n* [scala](http://scala-lang.org/)\n\nNew languages can be added as plugins (see below).\n\nUsage\n=====\n\nCheck available plugins\n-----------------------\n\n```bash\n➥ nv ls-plugins\nelixir\nelixir-prebuilt\nerlang\ngo-prebuilt\nhaskell\nhaskell-prebuilt\niojs\niojs-prebuilt\njulia\nnode\nnode-prebuilt\npython\nrust\nrust-prebuilt\nscala\n```\n\nHere you can see two types of plugins:\n* which downloads \u0026 builds from source (``elixir``, ``erlang``, …)\n* which just downloads prebuilt packages (``elixir-prebuilt``, ``node-prebuilt``, …)\n\nIt's obviously that work with the second option will be much faster because\ncompiling may takes huge amount of time.\n\nUnfortunately, not all languages is available in prebuilt binaries.\n\nCheck available versions for each plugin\n----------------------------------------\n\n```bash\n➥ nv ls-versions --rust --erlang\n* rust:\n0.1         0.2         0.3         0.4         0.5\n0.6         0.7         0.8         0.9\n* erlang:\nR10B-0    R10B-10   R10B-1a   R10B-2    R10B-3    R10B-4\nR10B-5    R10B-6    R10B-7    R10B-8    R10B-9    R11B-0\nR11B-1    R11B-2    R11B-3    R11B-4    R11B-5    R12B-0\nR12B-1    R12B-2    R12B-3    R12B-4    R12B-5    R13A\nR13B      R13B01    R13B02-1  R13B02    R13B03    R13B04\nR14A      R14B      R14B01    R14B02    R14B03    R14B04\nR15B      R15B01    R15B02    R15B02    R15B03-1  R15B03\nR16A      R16B      R16B01    R16B02    R16B03-1  R16B03\n17.0-rc1\n```\n\nCreate an environment\n---------------------\n\n```bash\n➥ nv mk mixed-rust-erlang --rust=0.9 --erlang=17.0-rc1\nCreating environment: mixed-rust-erlang ...\n * installing rust==0.9 ...\n * done (in 5 secs.)\n * installing erlang==17.0-rc1 ...\n * done (in 11 secs.)\n```\n\nIf you want to activate new environment just right after it creation, then do\nthe following:\n\n```bash\n➥ nv mk mixed-rust-erlang --rust=0.9 --erlang=17.0-rc1 --on\nCreating environment: mixed-rust-erlang ...\n....\nEnvironment mixed-rust-erlang activated.\n(mixed-rust-erlang) ➥ \n```\n\nActivate/deactivate environment\n-------------------------------\n\n### Activating in a new shell\n\nBy default activating environment executes in a new shell:\n\n```bash\n➥ echo $$\n112\n➥ nv on mixed-rust-erlang\nEnvironment mixed-rust-erlang activated.\n(mixed-rust-erlang) ➥  echo $$\n3437\n```\n\nSo for exit just do ``exit``:\n\n```bash\n(mixed-rust-erlang) ➥  echo $$\n3437\n(mixed-rust-erlang) ➥  exit\n➥ echo $$\n112\n```\n\nSince version [0.7.2](https://github.com/ekalinin/envirius/releases/tag/0.7.2)\nyou can use ``nv off`` in all cases to exit from environment.\n\n### Activating in the same shell\n\nIf you want to activate environment in the same shell do the following:\n\n```bash\n➥ echo $$\n5099\n➥ nv on --same-shell mixed-rust-erlang\nEnvironment mixed-rust-erlang activated.\n(mixed-rust-erlang) ➥  echo $$\n5099\n```\n\nTo deactivate this shell don't use ``exit``, use ``nv off``:\n\n```bash\n(mixed-rust-erlang) ➥  echo $$\n5099\n(mixed-rust-erlang) ➥ nv off\nEnvironment mixed-rust-erlang was deactivated.\n➥  echo $$\n5099\n```\n\nGet list of environments\n------------------------\n\n```bash\n➥ nv ls\nAvailable environment(s):\nmixed-rust-erlang\nrust-0.9\nerl-17-rc1\n```\n\nGet current activated environment\n---------------------------------\n\n```bash\n(mixed-rust-erlang) ➥ nv current\nmixed-rust-erlang\n```\n\nIt will return empty, if environment is not activated:\n\n```bash\n➥ nv current\n➥ \n```\n\nDo something in environment without enabling it\n-----------------------------------------------\n\n```bash\n➥ nv do node-0.10.26 'npm -g ls'\n```\n\nExport environment into tar archive\n------------------------------------\n\n```bash\n➥ nv export node-0.10.26\nEnvironment php-5.5.11 archived into /home/user/current/directory/node-0.10.26.tar\n```\n\nImport environment from tar archive\n------------------------------------\n\n```bash\n➥ nv import /home/user/current/directory/node-0.10.26.tar node-0.10.26-new\nArchive /home/user/current/directory/node-0.10.26.tar imported into node-0.10.26-new\n```\n\nGet help\n--------\n\n```bash\n➥ nv --help\n```\n\nGet help for a command\n----------------------\n\nFor example, for ``do`` command:\n\n```bash\n➥ nv do --help\n```\n\nHow to add a plugin?\n====================\n\nAll plugins are in the directory\n[nv-plugins](https://github.com/ekalinin/envirius/tree/master/src/nv-plugins).\nIf you need to add support for a new language you should add it as plugin\ninside this directory.\n\nMandatory elements\n-------------------\n\nIf you create a plugin which builds all stuff from source then In a simplest\ncase you need to implement 2 functions in the plugin's body:\n\n### plug_list_versions\n\nThis function should return list of available versions of the plugin.\nFor example:\n\n```bash\nplug_list_versions() {\n    local versions=$(curl -s \"http://nodejs.org/dist\" | \\\n                grep -v \"node-\" | \\\n                egrep -o '[0-9]+\\.[0-9]+\\.[0-9]+' | \\\n                sort -u -k 1,1n -k 2,2n -k 3,3n -t .)\n    echo $versions\n}\n```\n\n### plug_url_for_download\n\nThis function should return full url for downloading tarball.\nFor example:\n\n```bash\nplug_url_for_download() {\n    local version=$1\n    echo \"http://nodejs.org/dist/v${version}/node-v${version}.tar.gz\"\n}\n```\n\n### plug_build\n\nThis function is only need for ``*-prebuilt``-like plugins. It overrides default\nbuilding proccess. All we need in case of ``*-prebuilt``-like plugin is only\ncopy binaries. For example:\n\n```bash\nplug_build() {\n    local src_path=$1\n    local build_path=$2\n    cp -r \"$src_path\"/*/* \"$build_path\"\n}\n```\n\nTypical language installation listed in\n[plug_install_default](https://github.com/ekalinin/envirius/blob/master/src/nv-commands/mk#L155)\nfunction in ``mk`` command.\n\nIf installation is not typical then you should implement ``plug_install``\nfunction with yourself. For example: \n[julia](https://github.com/ekalinin/envirius/blob/master/src/nv-plugins/julia).\n\nOptional elements\n-----------------\n\n### Variables\n\n* ``plug_list_versions_columns_count`` — number of the columns in the\n  output of the ``nv ls-version`` for each plugin\n* ``plug_list_versions_columns_size`` — each column width in chars in\n  the output of the ``nv ls-version`` for each plugin\n* ``plug_state`` — if == ``disabled`` then plugin is not active and will not\n  be account in the commands:\n  * mk\n  * ls-versions\n  * ls-plugins\n\n### Functions\n\nIn execute order:\n\n* ``plug_check_deps`` — check dependencies before plugin building. If it returns\n  not empty string then environment creation stops. Example is in\n  [haskell](https://github.com/ekalinin/envirius/blob/master/src/nv-plugins/haskell#L20)\n  plugin\n* ``plug_install``  — overrides the whole installation process\n* ``plug_download`` — overrides default downloading sources (archive)\n* ``plug_unpack`` — overrides default ``tar xzf \u003carchive-with-source\u003e``\n* ``plug_configure`` — overrides default ``configure --prefix=\u003cpath-to-env\u003e``\n* ``plug_build`` — overrides default ``make \u0026\u0026 make install``\n* ``plug_build_env`` — overrides copying binaries into new environment\n* ``plug_post_install_actions`` — executes after installation. For example\n  ``pip`` installation in the\n  [python](https://github.com/ekalinin/envirius/blob/master/src/nv-plugins/python)\n  plugin\n\nExamples\n--------\n\n* Simple: [erlang](https://github.com/ekalinin/envirius/blob/master/src/nv-plugins/erlang)\n* Own impementation: [julia](https://github.com/ekalinin/envirius/blob/master/src/nv-plugins/julia)\n\nExample of the usage\n====================\n\nHere is an example of building [hugo](https://github.com/spf13/hugo) static\nsite generator under envirius with ``go`` plugin:\n\n```bash\n$ whereis go\ngo:\n$ nv mk go-hugo-test --go=1.2.1\nCreating environment: go-hugo-test ...\n * installing go==1.2.1 ...\n * done (in 8 secs.)\n$ nv ls \nAvailable environment(s):\ngo-hugo-test (go==1.2.1)\n$ nv on go-hugo-test\n(go-hugo-test) $ go get github.com/spf13/hugo\n(go-hugo-test) $ cd $GOPATH/src/github.com/spf13/hugo\n(go-hugo-test) $ go build -o hugo main.go\n(go-hugo-test) $ hugo version\nHugo Static Site Generator v0.11-dev\n```\n\nDependencies\n============\n\n* bash / zsh (very basic support)\n* curl / wget\n* tar\n* git\n* gcc\n* bats\n\nSupported OS\n============\n\n* ubuntu\n\nTests\n=====\n\nMost of the code is covered by tests. For testing\n[bats](https://github.com/sstephenson/bats) was used.\nTo run tests:\n\n```bash\n➥ make tests\n```\n\nWith hot cache on ``Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz`` with 4 GB of RAM\non Ubuntu 13.10 (32-bits) tests takes:\n\n```bash\n➥ time make tests\n...\n\n100 tests, 0 failure\n\nreal    8m26.572s\nuser    1m17.428s\nsys     2m25.352s\n```\n\nVersion History\n===============\n\nSee [CHANGELOG.md](https://github.com/ekalinin/envirius/blob/master/CHANGELOG.md).\n\nLicense\n=======\n\nSee [LICENSE](https://github.com/ekalinin/envirius/blob/master/LICENSE).\n\nREADME in another language\n==========================\n\n[RU](https://github.com/ekalinin/envirius/blob/master/README.ru.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekalinin%2Fenvirius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekalinin%2Fenvirius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekalinin%2Fenvirius/lists"}