<commit_before>Commands Reference
==================

.. code-block:: bash

    envie [DIR] [KEYWORDS]

    envie SCRIPT

    envie {create ... | remove |
           list [DIR] | find [DIR] |
           python [SCRIPT] | run CMD |
           index | config | help | --help | --version}



``envie`` / ``chenv`` - Interactively activate the closest virtual environment
------------------------------------------------------------------------------

::

    Interactively activate the closest Python virtual environment relative to DIR (or .)
    A list of the closest environments is filtered by KEYWORDS. Separate KEYWORDS with --
    if they start with a dash, or a dir with the same name exists.

    Usage:
        chenv [-1] [-f|-l] [-v] [-q] [DIR] [--] [KEYWORDS]
        envie ...

    Options:
        -1            activate only if a single closest env found, abort otherwise
        -f, --find    use only 'find' for search
        -l, --locate  use only 'locate' for search
        -v            be verbose: show info messages (path to activated env)
        -q            be quiet: suppress error messages

    For details on other Envie uses, see 'envie help'.


.. code-block:: bash

    chenv [-1] [-f|-l] [-v] [-q] [DIR] [--] [KEYWORDS]

-1            activate only if a single closest env found, abort otherwise
-f, --find    use only 'find' for search
-l, --locate  use only 'locate' for search
-v            be verbose: show info messages (path to activated env)
-q            be quiet: suppress error messages


.. note:: TODO description, examples



``envie create`` / ``mkenv`` - Create a new virtual environment
---------------------------------------------------------------

::

    Create Python (2/3) virtual environment in DEST_DIR based on PYTHON.

    Usage:
        mkenv [-2|-3|-e PYTHON] [-r PIP_REQ] [-p PIP_PKG] [-a] [-t] [DEST_DIR] [-- ARGS_TO_VIRTUALENV]
        mkenv2 [-r PIP_REQ] [-p PIP_PKG] [-a] [-t] [DEST_DIR] ...
        mkenv3 [-r PIP_REQ] [-p PIP_REQ] [-a] [-t] [DEST_DIR] ...
        envie create ...

    Options:
        -2, -3      use Python 2, or Python 3
        -e PYTHON   use Python accessible with PYTHON name,
                    like 'python3.5', or '/usr/local/bin/mypython'.
        -r PIP_REQ  install pip requirements in the created virtualenv,
                    e.g. '-r dev-requirements.txt'
        -p PIP_PKG  install pip package in the created virtualenv,
                    e.g. '-p "Django>=1.9"', '-p /var/pip/pkg', '-p "-e git+https://gith..."'
        -a          autodetect and install pip requirements
                    (search for the closest 'requirements.txt' and install it)
        -t          create throw-away env in /tmp
        -v[v]       be verbose: show virtualenv&pip info/debug messages<commit_msg>docs: three envie calling forms<commit_after>Commands Reference
==================

The ``envie`` script (or a :ref:`shell function <source-vs-exec>`) has three
calling forms:

.. code-block:: bash

    envie [OPTIONS] [DIR] [KEYWORDS]

    envie SCRIPT

    envie {create [ENV] | remove |
           list [DIR] [KEYWORDS] | find [DIR] [KEYWORDS] |
           python [SCRIPT] | run CMD |
           index | config | help | --help | --version}

The first form interactively activates the closest environment (relative to
``DIR``, or the current working directory, filtered by ``KEYWORDS``). If a
single closest environment is detected, it is auto-activated. This calling form
is basically an alias for ``chenv -v [DIR] [KEYWORDS]`` (see :ref:`chenv <chenv>` below).

The second form is a shorthand for executing python scripts in the closest
virtual environment, without the need for a manual env activation. It's
identical in behaviour to ``envie python SCRIPT``, but more convenient for a
hash bang use:

    .. code-block:: python

        #!/usr/bin/env envie
        # Python script here will be executed in the closest virtual env

The third form is the canonical form as it explicitly exposes all commands (for
virtual env creation, removal, discovery, etc.) Most of these commands have a
shorter alias you'll probably prefer in everyday use (like ``mkenv``, ``lsenv``,
``findenv``, ``chenv``, ``rmenv``, etc).



.. _chenv:

``envie`` / ``chenv`` - Interactively activate the closest virtual environment
------------------------------------------------------------------------------

::

    Interactively activate the closest Python virtual environment relative to DIR (or .)
    A list of the closest environments is filtered by KEYWORDS. Separate KEYWORDS with --
    if they start with a dash, or a dir with the same name exists.

    Usage:
        chenv [-1] [-f|-l] [-v] [-q] [DIR] [--] [KEYWORDS]
        envie ...

    Options:
        -1            activate only if a single closest env found, abort otherwise
        -f, --find    use only 'find' for search
        -l, --locate  use only 'locate' for search
        -v            be verbose: show info messages (path to activated env)
        -q            be quiet: suppress error messages

    For details on other Envie uses, see 'envie help'.


.. note:: TODO description, examples



``envie create`` / ``mkenv`` - Create a new virtual environment
---------------------------------------------------------------

::

    Create Python (2/3) virtual environment in DEST_DIR based on PYTHON.

    Usage:
        mkenv [-2|-3|-e PYTHON] [-r PIP_REQ] [-p PIP_PKG] [-a] [-t] [DEST_DIR] [-- ARGS_TO_VIRTUALENV]
        mkenv2 [-r PIP_REQ] [-p PIP_PKG] [-a] [-t] [DEST_DIR] ...
        mkenv3 [-r PIP_REQ] [-p PIP_REQ] [-a] [-t] [DEST_DIR] ...
        envie create ...

    Options:
        -2, -3      use Python 2, or Python 3
        -e PYTHON   use Python accessible with PYTHON name,
                    like 'python3.5', or '/usr/local/bin/mypython'.
        -r PIP_REQ  install pip requirements in the created virtualenv,
                    e.g. '-r dev-requirements.txt'
        -p PIP_PKG  install pip package in the created virtualenv,
                    e.g. '-p "Django>=1.9"', '-p /var/pip/pkg', '-p "-e git+https://gith..."'
        -a          autodetect and install pip requirements
                    (search for the closest 'requirements.txt' and install it)
        -t          create throw-away env in /tmp
        -v[v]       be verbose: show virtualenv&pip info/debug messages
{'fraction_non_alphanumeric': 0.1590944819996856, 'fraction_numerical': 0.005345071529633706, 'mean_word_length': 1.9076782449725778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2437153', 'n_tokens_mistral': 1922, 'n_tokens_neox': 1801, 'n_words': 730}