pipenv.nvim

July 8, 2026 · View on GitHub

Asynchronous management for your Pipenv environment from within Neovim.

https://github.com/user-attachments/assets/170e9897-c501-4a33-b96a-3e266d79045d


Table Of Contents


Installation

Requirements

lazy.nvim
{
  'DrKJeff16/pipenv.nvim',
  dependencies = {
    'wsdjeg/job.nvim', -- REQUIRED!
    'xieyonn/spinner.nvim', -- RECOMMENDED
    'wsdjeg/picker.nvim', -- OPTIONAL
  },
  opts = {},
}
nvim-plug
require('plug').add({
  {
    'DrKJeff16/pipenv.nvim',
    depends = {
      { 'wsdjeg/job.nvim' }, -- REQUIRED!
      { 'xieyonn/spinner.nvim' }, -- RECOMMENDED
      { 'wsdjeg/picker.nvim' }, -- OPTIONAL
    },
    config = function()
      require('pipenv').setup()
    end,
  }
})
pckr.nvim
require('pckr').add({
  {
    'DrKJeff16/pipenv.nvim',
    requires = {
      'wsdjeg/job.nvim', -- REQUIRED!
      'xieyonn/spinner.nvim', -- RECOMMENDED
      'wsdjeg/picker.nvim', -- OPTIONAL
    },
    config = function()
      require('pipenv').setup()
    end,
  },
})
paq-nvim
local paq = require('paq')
paq({
  'DrKJeff16/pipenv.nvim',
  'wsdjeg/job.nvim', -- REQUIRED!
  'xieyonn/spinner.nvim', -- RECOMMENDED
  'wsdjeg/picker.nvim', -- OPTIONAL
})
LuaRocks

You can also install this plugin through LuaRocks from the pipenv.nvim module.

luarocks install pipenv.nvim         # Global Install
luarocks install --local pipenv.nvim # Local Install

Configuration

These are the default options:

require('pipenv').setup({
  -- Output window options (`:Pipenv!`)
  output = {
    float = true, -- Set to `false` if you don't want a floating window
    split = 'right', -- right|left|above|below (only matters if `float` is `false`)
    border = 'single', -- none|single|double|rounded|solid|shadow (only matters if `float` is `true`)
    height = 0.85, -- A number between `0` and `1` (percentage) or a fixed height (only matters if `float` is `true`)
    width = 0.85, -- A number between `0` and `1` (percentage) or a fixed width (only matters if `float` is `true`)
    zindex = 100, -- The `zindex` value of the output window (only matters if `float` is `true`)
  },
  env = { -- See the `Pipenv Environment Variables` section
    -- install = {},
    -- virtual_env = {},
    -- file_location = {},
    -- security = {},
    -- behavior = {},
  },
  spinner = {
    enabled = false,
    -- See https://github.com/xieyonn/spinner.nvim for more info about these options
    opts = {
      hl_group = 'Special',
      kind = 'cursor',
      pattern = 'dots13',
      zindex = 100,
      -- attach = {},
      -- col = 0,
      -- fmt = function(event) return '' end,
      -- initial_delay_ms = 10,
      -- ns = 0,
      -- on_update_ui = function(event) end,
      -- placeholder = false,
      -- row = 0,
      -- ttl_ms = 100,
      -- ui_scope = 'Foo',
      -- winblend = 10,
    },
  },
})

Pipenv Environment Variables

You can customize the environment variables used when executing Pipenv operations. By default no option is set as to not interfere with your environment variables, but you may modify any listed in the table below.

For more information consult the Pipenv Documentation.

Setup OptionTypeEnvironment Variable
env.behavior.auto_acceptbooleanPIPENV_YES
env.behavior.clear_cachebooleanPIPENV_CLEAR
env.behavior.fancy_shellbooleanPIPENV_SHELL_FANCY
env.behavior.ignore_pipfilebooleanPIPENV_IGNORE_PIPFILE
env.behavior.no_asdfbooleanPIPENV_DONT_USE_ASDF
env.behavior.no_load_envbooleanPIPENV_DONT_LOAD_ENV
env.behavior.no_pyenvbooleanPIPENV_DONT_USE_PYENV
env.behavior.no_spinbooleanPIPENV_NOSPIN
env.behavior.quietbooleanPIPENV_QUIET
env.behavior.requests_timeoutnumberPIPENV_REQUESTS_TIMEOUT
env.behavior.site_packagesbooleanPIPENV_SITE_PACKAGES
env.behavior.verbosebooleanPIPENV_VERBOSE
env.file_location.cache_dirstringPIPENV_CACHE_DIR
env.file_location.dotenv_locationstringPIPENV_DOTENV_LOCATION
env.file_location.pipfile_pathstringPIPENV_PIPFILE
env.install.install_dependenciesbooleanPIPENV_INSTALL_DEPENDENCIES
env.install.install_timeoutnumberPIPENV_INSTALL_TIMEOUT
env.install.max_depthnumberPIPENV_MAX_DEPTH
env.install.pypi_mirrorstringPIPENV_PYPI_MIRROR
env.install.resolve_vcsbooleanPIPENV_RESOLVE_VCS
env.install.skip_lockbooleanPIPENV_SKIP_LOCK
env.install.timeoutnumberPIPENV_TIMEOUT
env.security.pyup_api_keystringPIPENV_PYUP_API_KEY
env.virtual_env.ignore_virtual_envsbooleanPIPENV_IGNORE_VIRTUALENVS
env.virtual_env.python_pathstringPIPENV_PYTHON
env.virtual_env.python_versionstringPIPENV_DEFAULT_PYTHON_VERSION
env.virtual_env.venv_in_projectbooleanPIPENV_VENV_IN_PROJECT
env.virtual_env.venv_namestringPIPENV_CUSTOM_VENV_NAME
env.virtual_env.venv_pathstringPIPENV_VIRTUALENV

Example:

-- ARBITRARY EXAMPLE. DO NOT COPY AS-IS!
require('pipenv').setup({
  env = {
    behavior = {
      auto_accept = true,
      ignore_pipfile = true,
    },
    file_location = {
      cache_dir = vim.fn.expand('~/.local/state/pipenv/cache'),
    },
    install = {
      install_dependencies = false,
      resolve_vcs = true,
    },
    security = {
      pyup_api_key = '<API_KEY>',
    },
    virtual_env = {
      venv_name = 'my_venv',
      venv_path = vim.fn.expand('~/.cache/my-virtualenv'),
    },
  },
})

Usage

You can use the :Pipenv command to do certain operations with Pipenv from within Neovim.

To enable verbose mode in any operation simply add a ! to the command (:Pipenv!).

You can also pass these flags:

  • dev=true|false - The command is called with a --dev flag.
  • pre=true|false - The command is called with a --pre flag.
  • file=/path/to/file - The command output will be written to the target file.
  • python=PYTHON_VERSION - The python version for Pipenv to use. Must be formatted correctly (e.g. python=3.10, python=3.13, ...).

Keep in mind that any flag that doesn't get parsed by a subcommand can still be passed, only it won't make a difference!

The valid subcommands are:

  • clean
  • edit
  • graph
  • help
  • install
  • list-installed
  • list-scripts
  • lock
  • remove (calling :Pipenv! remove will force its execution instead of enabling verbose mode)
  • requirements
  • run
  • scripts
  • sync
  • uninstall
  • update
  • upgrade
  • verify

No Subcommands

Showcase
The UI spawned when running without subcommands.

You can run :Pipenv[!] without any of the subcommands listed above. This will open a UI prompting to do any of the valid Pipenv operations.

Keep in mind flags can still be passed to achieve the same effect for any operation that requires it.

Examples:

:Pipenv                              " verbose=false, dev=false, pre=false, file=nil, python=nil
:Pipenv python=3.10                  " verbose=false, dev=false, pre=false, file=nil, python=3.10
:Pipenv!                             " verbose=true, dev=false, pre=false, file=nil, python=nil
:Pipenv! dev=true file=/path/to/file " verbose=true, dev=true, pre=false, file=/path/to/file, python=nil
:Pipenv dev=true pre=false           " verbose=false, dev=true, pre=true, file=nil, python=nil

Subcommands

Below is a table specifying each subcommand, how many arguments does it take, what flags are valid for parsing and its description.

SubcommandNargsVerboseDevPreFilePythonDescription
clean*󰄬󰅖󰅖󰅖󰄬Runs pipenv [--python <VERSION>] clean
edit0󰅖󰅖󰅖󰅖󰅖Edit the Pipfile or create a blank one if none exists
graph*󰅖󰅖󰅖󰅖󰄬Returns the output of pipenv [--python <VERSION>] graph
help0󰅖󰅖󰅖󰅖󰅖Prints the usage message
install*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] install [--dev] [ARGS...] [--pre]
list-installed0󰅖󰅖󰅖󰅖󰅖Lists the installed packages in a window
list-scripts0󰅖󰅖󰅖󰅖󰅖Lists the defined scripts in the Pipfile
lock*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] lock [--dev] [--pre]
requirements*󰄬󰄬󰅖󰄬󰄬Runs pipenv [--python <VERSION>] requirements [--dev]
run+󰄬󰅖󰅖󰅖󰄬Runs pipenv [--python <VERSION>] run ...
scripts*󰅖󰅖󰅖󰅖󰄬Returns the output of pipenv [--python <VERSION>] scripts
sync*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] sync [--dev] [--pre]
uninstall*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] uninstall [--dev] [--pre] [ARGS...]
update*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] update [--dev] [--pre]
upgrade*󰄬󰄬󰄬󰅖󰄬Runs pipenv [--python <VERSION>] upgrade [--dev] [--pre]
verify*󰄬󰅖󰅖󰅖󰄬Runs pipenv [--python <VERSION>] verify

Examples:

:Pipenv run <COMMANDS>                            " verbose=false
:Pipenv! run <COMMANDS>                           " verbose=true

:Pipenv! edit                                     " The verbose flag doesn't matter

:Pipenv! sync dev=true                            " verbose=true, dev=false
:Pipenv! dev=true sync                            " Same as above

:Pipenv pre=true install ...                      " Installs prerelease packages

:Pipenv! python=3.13 install <PACKAGES>           " verbose=true, python=3.13

:Pipenv dev=true file=/path/to/file requirements  " verbose=false, dev=true, file=/path/to/file

Note that the remove subcommand only supports a bang (!) and treats it as "force" instead of "verbose":

SubcommandNargsForceDevPreFilePythonDescription
remove0󰄬󰅖󰅖󰅖󰅖Prompts to run pipenv --rm and optionally removes your Pipfile and Pipfile.lock files. If called with a bang you will not be prompted

Examples:

:Pipenv remove     " force=false, you will be prompted
:Pipenv! remove    " force=true, you will NOT be prompted

picker.nvim Integration

picker.nvim showcase

This plugin has a (rather rough) integration with wsdjeg/picker.nvim. If you have it installed you can run :Picker pipenv to use it.


API

Most of the API is publicly available on the main module pipenv.lua, which imports the utilities from core.lua.

The operations used by the :Pipenv user command are the following:

SubcommandCore Function Called
:Pipenv cleanrequire('pipenv.core').clean()
:Pipenv editrequire('pipenv.core').edit()
:Pipenv graphrequire('pipenv.core').graph()
:Pipenv helprequire('pipenv.core').help()
:Pipenv installrequire('pipenv.core').install()
:Pipenv list-installedrequire('pipenv.core').list_installed()
:Pipenv list-scriptsrequire('pipenv.core').list_scripts()
:Pipenv lockrequire('pipenv.core').lock()
:Pipenv removerequire('pipenv.core').remove()
:Pipenv requirementsrequire('pipenv.core').requirements()
:Pipenv runrequire('pipenv.core').run()
:Pipenv scriptsrequire('pipenv.core').scripts()
:Pipenv syncrequire('pipenv.core').sync()
:Pipenv uninstallrequire('pipenv.core').uninstall()
:Pipenv updaterequire('pipenv.core').update()
:Pipenv upgraderequire('pipenv.core').upgrade()
:Pipenv verifyrequire('pipenv.core').verify()

License

MIT