base on Package management made easy <h1>
<a href="https://github.com/prefix-dev/pixi/">
<picture>
<source srcset="https://github.com/prefix-dev/pixi/assets/4995967/a3f9ff01-c9fb-4893-83c0-2a3f924df63e" type="image/webp">
<source srcset="https://github.com/prefix-dev/pixi/assets/4995967/e42739c4-4cd9-49bb-9d0a-45f8088494b5" type="image/png">
<img src="https://github.com/prefix-dev/pixi/assets/4995967/e42739c4-4cd9-49bb-9d0a-45f8088494b5" alt="banner">
</picture>
</a>
</h1>
<h1 align="center">
![License][license-badge]
[![Project Chat][chat-badge]][chat-url]
[![Pixi Badge][pixi-badge]][pixi-url]
[license-badge]: https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square
[chat-badge]: https://img.shields.io/discord/1082332781146800168.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square
[chat-url]: https://discord.gg/kKV8ZxyzY4
[pixi-badge]:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json&style=flat-square
[pixi-url]: https://pixi.sh
</h1>
# pixi: Package Management Made Easy
## Overview
`pixi` is a cross-platform, multi-language package manager and workflow tool built on the foundation of the conda ecosystem. It provides developers with an exceptional experience similar to popular package managers like `cargo` or `yarn`, but for any language.
Developed with ❤️ at [prefix.dev](https://prefix.dev).
[![Real-time pixi_demo](https://github.com/prefix-dev/pixi/assets/12893423/0fc8f8c8-ac13-4c14-891b-dc613f25475b)](https://asciinema.org/a/636482)
## Highlights
- Supports **multiple languages** including Python, C++, and R using Conda packages. You can find available packages on [prefix.dev](https://prefix.dev).
- Compatible with all major operating systems: Linux, Windows, macOS (including Apple Silicon).
- Always includes an up-to-date **lock file**.
- Provides a clean and simple Cargo-like **command-line interface**.
- Allows you to install tools **per-project** or **system-wide**.
- Entirely written in **Rust** and built on top of the **[rattler](https://github.com/mamba-org/rattler)** library.
## Getting Started
- ⚡ [Installation](#installation)
- ⚙️ [Examples](/examples)
- 📚 [Documentation](https://pixi.sh/)
- 😍 [Contributing](#contributing)
- 🔨 [Built using Pixi](#built-using-pixi)
- 🚀 [GitHub Action](https://github.com/prefix-dev/setup-pixi)
## Status
Pixi is ready for production!
We are working hard to keep file-format changes compatible with the previous
versions so that you can rely on pixi with peace of mind.
Some notable features we envision for upcoming releases are:
- **Build and publish** your project as a Conda package.
- Support for **dependencies from source**.
- More powerful "global installation" of packages towards a deterministic setup of global packages on multiple machines.
## Installation
`pixi` can be installed on macOS, Linux, and Windows. The provided scripts will automatically download the latest version of `pixi`, extract it, and move the `pixi` binary to `~/.pixi/bin`. If this directory does not exist, the script will create it.
### macOS and Linux
To install Pixi on macOS and Linux, open a terminal and run the following command:
```bash
curl -fsSL https://pixi.sh/install.sh | bash
# or with brew
brew install pixi
```
The script will also update your ~/.bash_profile to include ~/.pixi/bin in your PATH, allowing you to invoke the pixi command from anywhere.
You might need to restart your terminal or source your shell for the changes to take effect.
Starting with macOS Catalina [zsh is the default login shell and interactive shell](https://support.apple.com/en-us/102360). Therefore, you might want to use `zsh` instead of `bash` in the install command:
```zsh
curl -fsSL https://pixi.sh/install.sh | zsh
```
The script will also update your ~/.zshrc to include ~/.pixi/bin in your PATH, allowing you to invoke the pixi command from anywhere.
### Windows
To install Pixi on Windows, open a PowerShell terminal (you may need to run it as an administrator) and run the following command:
```powershell
iwr -useb https://pixi.sh/install.ps1 | iex
```
The script will inform you once the installation is successful and add the ~/.pixi/bin directory to your PATH, which will allow you to run the pixi command from any location.
Or with `winget`
```shell
winget install prefix-dev.pixi
```
### Autocompletion
To get autocompletion follow the instructions for your shell.
Afterwards, restart the shell or source the shell config file.
#### Bash (default on most Linux systems)
Add the following to the end of `~/.bashrc`:
```bash
# ~/.bashrc
eval "$(pixi completion --shell bash)"
```
#### Zsh (default on macOS)
Add the following to the end of `~/.zshrc`:
```zsh
# ~/.zshrc
eval "$(pixi completion --shell zsh)"
```
#### PowerShell (pre-installed on all Windows systems)
Add the following to the end of `Microsoft.PowerShell_profile.ps1`.
You can check the location of this file by querying the `$PROFILE` variable in PowerShell.
Typically the path is `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` or
`~/.config/powershell/Microsoft.PowerShell_profile.ps1` on -Nix.
```pwsh
(& pixi completion --shell powershell) | Out-String | Invoke-Expression
```
#### Fish
Add the following to the end of `~/.config/fish/config.fish`:
```fish
# ~/.config/fish/config.fish
pixi completion --shell fish | source
```
#### Nushell
Add the following to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell):
```nushell
mkdir ~/.cache/pixi
pixi completion --shell nushell | save -f ~/.cache/pixi/completions.nu
```
And add the following to the end of your Nushell configuration (find it by running `$nu.config-path`):
```nushell
use ~/.cache/pixi/completions.nu *
```
#### Elvish
Add the following to the end of `~/.elvish/rc.elv`:
```elv
# ~/.elvish/rc.elv
eval (pixi completion --shell elvish | slurp)
```
### Distro Packages
[![Packaging status](https://repology.org/badge/vertical-allrepos/pixi.svg)](https://repology.org/project/pixi/versions)
#### Arch Linux
You can install `pixi` from the [extra repository](https://archlinux.org/packages/extra/x86_64/pixi/) using [pacman](https://wiki.archlinux.org/title/Pacman):
```shell
pacman -S pixi
```
#### Alpine Linux
`pixi` is available for [Alpine Edge](https://pkgs.alpinelinux.org/packages?name=pixi&branch=edge). It can be installed via [apk](https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper) after enabling the [testing repository](https://wiki.alpinelinux.org/wiki/Repositories).
```shell
apk add pixi
```
## Build/install from source
`pixi` is 100% written in Rust and therefore it can be installed, built and tested with cargo.
To start using `pixi` from a source build run:
```shell
cargo install --locked --git https://github.com/prefix-dev/pixi.git pixi
```
We don't publish to `crates.io` anymore, so you need to install it from the repository.
The reason for this is that we depend on some unpublished crates which disallows us to publish to `crates.io`.
or when you want to make changes use:
```shell
cargo build
cargo test
```
If you have any issues building because of the dependency on `rattler` checkout
it's [compile steps](https://github.com/mamba-org/rattler/tree/main#give-it-a-try)
## Uninstall
To uninstall the pixi binary should be removed.
Delete `pixi` from the `$PIXI_DIR` which is default to `~/.pixi/bin/pixi`
So on Linux its:
```shell
rm ~/.pixi/bin/pixi
```
and on Windows:
```shell
$PIXI_BIN = "$Env:LocalAppData\pixi\bin\pixi"; Remove-Item -Path $PIXI_BIN
```
After this command you can still use the tools you installed with `pixi`.
To remove these as well just remove the whole `~/.pixi` directory and remove the directory from your path.
# Usage
The cli looks as follows:
```bash
➜ pixi
A package management and workflow tool
Usage: pixi [OPTIONS] <COMMAND>
Commands:
completion Generates a completion script for a shell
init Creates a new project
add Adds a dependency to the project
run Runs task in project
shell Start a shell in the pixi environment of the project
global Global is the main entry point for the part of pixi that executes on the global(system) level
auth Login to prefix.dev or anaconda.org servers to access private channels
install Install all dependencies
task Command management in project
info Information about the system and project
upload Upload a package to a prefix.dev channel
search Search a package, output will list the latest version of package
project
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
--color <COLOR> Whether the log needs to be colored [default: auto] [possible values: always, never, auto]
-h, --help Print help
-V, --version Print version
```
## Creating a pixi project
Initialize a new project and navigate to the project directory
```
pixi init myproject
cd myproject
```
Add the dependencies you want to use
```
pixi add cowpy
```
Run the installed package in its environment
```bash
pixi run cowpy "Thanks for using pixi"
```
Activate a shell in the environment
```shell
pixi shell
cowpy "Thanks for using pixi"
exit
```
## Installing a conda package globally
You can also globally install conda packages into their own environment.
This behavior is similar to [`pipx`](https://github.com/pypa/pipx) or [`condax`](https://github.com/mariusvniekerk/condax).
```bash
pixi global install cowpy
```
## Use in GitHub Actions
You can use pixi in GitHub Actions to install dependencies and run commands.
It supports automatic caching of your environments.
```yml
- uses: prefix-dev/
[email protected]
- run: pixi exec cowpy "Thanks for using pixi"
```
See the [documentation](https://pixi.sh/latest/advanced/github_actions) for more details.
<a name="contributing"></a>
## Contributing 😍
We would absolutely love for you to contribute to `pixi`!
Whether you want to start an issue, fix a bug you encountered, or suggest an
improvement, every contribution is greatly appreciated.
If you're just getting started with our project or stepping into the Rust
ecosystem for the first time, we've got your back!
We recommend beginning with issues labeled as `good first issue`.
These are carefully chosen tasks that provide a smooth entry point into
contributing.These issues are typically more straightforward and are a great way
to get familiar with the project.
Got questions or ideas, or just want to chat? Join our lively conversations on
Discord.
We're very active and would be happy to welcome you to our
community. [Join our discord server today!][chat-url]
<a name="pixibuilt"></a>
## Built using pixi
To see what's being built with `pixi` check out the [Community](/docs/Community.md) page.
", Assign "at most 3 tags" to the expected json: {"id":"8751","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"