# QIIME 2 plugin for ZSH

**URL:** https://forum.qiime2.org/t/qiime-2-plugin-for-zsh/19865
**Category:** Community Contributions
**Tags:** tutorial, plugin-development
**Created:** [June 11, 2021, 10:15am UTC](https://forum.qiime2.org/t/qiime-2-plugin-for-zsh/19865 "2021-06-11T10:15:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![misialq](https://forum.qiime2.org/user_avatar/forum.qiime2.org/misialq/32/9053_2.png) [@misialq](https://forum.qiime2.org/u/misialq)
#### Post date: [June 11, 2021, 10:15am UTC](https://forum.qiime2.org/t/qiime-2-plugin-for-zsh/19865/1 "2021-06-11T10:15:11Z")

</div>

After having installed, uninstalled and reinstalled a number of Q2 environments I figured there was room for making that repetitive process slightly easier. As _zsh_ is these days one of the most popular shells, I wrapped a couple of shell scripts into the [zsh QIIME 2 plugin](https://github.com/misialq/zsh-qiime2). This post briefly describes the installation and main functionality of that plugin. It is a mix of functions that could (hopefully) be useful for at least some QIIME 2 users and/or plugin developers.

It's an early version still so if you try it out and stumble upon an issue, please do reach out (here or directly on [GitHub](https://github.com/misialq/zsh-qiime2/issues)). Also, feature requests (and any other feedback for that matter) are more than welcome 💬 🙂.

# Functionality

The plugin provides three main functionalities:

1. **Command prompt modification** (currently only for the Powerlevel10k theme)

2. **Aliases**

3. **Functions**

- **set\_up\_full\_env** - sets up a full QIIME 2 conda environment, using the latest QIIME 2 release (equivalent to what is described in the [documentation](https://docs.qiime2.org/) under [Native installation](https://docs.qiime2.org/2021.4/install/native/#install-qiime-2-within-a-conda-environment) section) - no need to check what the latest QIIME 2 release is, no yaml fetching.

- **set\_up\_dev\_env** - sets up a minimal QIIME 2 environment (qiime2, q2cli, q2-types), using the latest **dev** release - maybe more useful for plugin developers; it also installs a couple of useful dev packages by calling the _extend\_env_ function (see below)

- **extend\_env** - adds a couple of useful dev packages to an existing environment (q2lint, flake8, coverage, wget, pytest-xdist)

# Installation

**[Prerequisites]** In order to use the plugin you will need to have already installed:

- _zsh_ shell with the [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh) framework
- command prompt modification (see below) only works on the [Powerlevel10k](https://github.com/romkatv/powerlevel10k) shell theme - more coming in the future perhaps (by popular demand 😆)
- conda and QIIME 2

If you followed the typical Oh My ZSH installation route (as per their documentation), just follow these steps:

- clone the zsh-qiime2 repository under the `plugins` subdirectory of oh-my-zsh:

```auto
git clone https://github.com/misialq/zsh-qiime2.git $ZSH_CUSTOM/plugins/zsh-qiime2

```

- add `zsh-qiime2` to the list of plugins in your `.zshrc` file:

```auto
plugins=(... zsh-qiime2)

```

- (only for Powerlevel10k users) to enable prompt modification, add `qiime2` to the list of segments in the `.p10k.zsh` file, e.g.:

```auto
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[Line #1]=========================
qiime2
status # exit code of the last command
...

```

- source the `.zshrc` file:

```auto
source ~/.zshrc

```

or simply restart your terminal.

That's it! Happy QIIME'ing!
