Usage¶
Interactive Switcher¶
The easiest way to use Pipes is to use the interactive switcher.
$ pipes
Note
Before you can use Pipes to activate a given project, the selected environment must have a project directory associated with it. To understand how Pipes links Project Directories with corresponding virtualenvs read the section on how to Set Project Directory.
Keyboard Shortcuts¶
The Interactive environment switcher accepts the following commands:
UP
+DOWN
: Scrolls through the listPAGE UP
+PAGE DOWN
: Scrolls through the list in larger incrementsENTER
: Selects and activates the environemntESC
: Exit PipesLEFT
+RIGHT
: Cycles through the available information on each virtual environmentQUERY
: Use any alphanumeric characters to filter the listBACKSPACE
: Delete last character from filter termDEL
: Clear filter
From the Command Line¶
You can activate an environment directly from the command line
by calling pipes
followed by a query term which is used
to select the desired environment:
$ pipes project1
This would cd into directory /path/to/project1
and activate the corresponding Pipenv Shell.
If a query term (eg. proj
) matches more than one project,
the Interactive Switcher will launch with the list filtered by
the entered query term.
List Environments¶
Use Pipes to see all detected Pipenv Environments.
$ pipes --list
Output:
project1-LwEMcb8W
project2-R1v7_ynT
The --list
flag can also be used with the --verbose
option,
which shows additional information about the environments
such as the environment path, project directory (if available) and
the python version of the virtual environment.
$ pipes --list --verbose
Vebose Output:
PIPENV_HOME: /Users/user/.local/share/virtualenvs
project1-LwEMcb8W *
Environment: $PIPENV_HOME/project1-LwEMcb8W
Binary: Python 3.5.5
Project Dir: ~/dev/project
project2-R1v7_ynT *
Environment: $PIPENV_HOME/project2-R1v7_ynT
Binary: Python 3.4.8
Project Dir: ~/dev/project2
The presence of an asterisk (*
) on the environment list
indicates if the virtual environment already has a project directory associated.
The lack of a *
indicates the Environment has not yet been
associated with a project directory. If you try switching into an
environment without the *
, Pipes will tell you need to
link the environment with a project directory first.
Delete Environment¶
Use Pipes to delete a Pipenv Environment.
$ pipes project1 --delete
Output:
Environment 'project1-LwEMcb8W' deleted
Set Project Directory¶
To link a project directory with its environment use the --link
flag:
$ pipes --link /path/to/project1
Pipes will find the associated Pipenv Environmnet by
running pipenv --venv
from from the target directory.
If the target directory finds a valid environment, Pipes will
create a new .project
with the project path and save it inside
the virtual environment. This file is used by Pipes to detect the project
directory.
Note
If you are using the latest release of Pipenv (v2018.05.18 or later),
it should automatically create a .project
file
to store your project path and the use of --link
is unnecessary.
Credit: Charlie Denton for sending this Pull Request.
Unlink a Project¶
To unlink project1
directory from its Pipenv Environment run:
$ pipes project1 --unlink
This will delete the .project
file created
by the Set Project Directory command.
Usage Help¶
You can see the list of available commands directly from the command line:
$ pipes --help