Skip to content

soapy1/pixi-register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixi-register

Manage globally named environments.

 $ pixi register add --help
Add an environment to the global registry

Usage: pixi-register add [OPTIONS] --name <NAME>

Options:
  -n, --name <NAME>                    Name of the environment to register
  -m, --manifest-path <MANIFEST_PATH>  The path to `pixi.toml`, `pyproject.toml`, or the project directory [default: .]
  -h, --help                           Print help
  -V, --version                        Print version

Dev setup

This project is setup using pixi! In order to run this locally you will need to:

  1. build/run the project with pixi + cargo

1: Run the project

Run the project directly with pixi

Or, if you want to run the binary you can add the target build directory to path, and build using pixi. This way, you can also run the project as a pixi extension.

$ export PATH=$PATH:$PWD/target/debug
$ pixi run build
$ pixi register --help

Try it out

Register an environment. For example, how about this one. From the root of this project. By default it will use the cwd.

$ pixi register add --name pixi-register

$ $ cat ~/.pixi/register/environments.json
[
  {
    "name": "pixi-register",
    "path": "<full/path/to>/pixi-register"
  }
]

List all registered environments:

$ pixi register list
Registered environments:
* pixi-register: /home/sophia/projects/pixi-register

Activate environments by name

Add the following shell function to your shell rc file in order to activate named environments (tested on zsh only!)

activate() {
    local name="$1"
    local env="${2:-default}"
    local manifest_path="$(pixi register get ${name})"
    pixi shell --manifest-path "${manifest_path}" --environment "${env}"
}

Now, you can activate environments that have been registered with the pixi register add command:

$ activate pixi-register

About

Register named pixi environments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages