Skip to content

Commit

Permalink
docs: add reference documentation for the exec command (#1587)
Browse files Browse the repository at this point in the history
Adds missing reference documentation for the `exec` command.

---------

Co-authored-by: Tim de Jager <tdejager89@gmail.com>
Co-authored-by: Ruben Arts <ruben@prefix.dev>
  • Loading branch information
3 people authored Jul 13, 2024
1 parent 6841127 commit 6fdd9f1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,40 @@ pixi run --clean-env "echo \$PATH"
pixi run start
```

## `exec`

Runs a command in a temporary environment disconnected from any project.
This can be useful to quickly test out a certain package or version.

Temporary environments are cached. If the same command is run again, the same environment will be reused.

??? note "Cleaning temporary environments"
Currently, temporary environments can only be cleaned up manually.
Environments for `pixi exec` are stored under `cached-envs-v0/` in the cache directory.
Run `pixi info` to find the cache directory.

##### Arguments

1. `<COMMAND>`: The command to run.

#### Options:
* `--spec <SPECS> (-s)`: Matchspecs of packages to install. If this is not provided, the package is guessed from the command.
* `--channel <CHANNELS> (-c)`: The channel to install the packages from. If not specified the default channel is used.
* `--force-reinstall` If specified a new environment is always created even if one already exists.

```shell
pixi exec python

# Add a constraint to the python version
pixi exec -s python=3.9 python

# Run ipython and include the py-rattler package in the environment
pixi exec -s ipython -s py-rattler ipython

# Force reinstall to recreate the environment and get the latest package versions
pixi exec --force-reinstall -s ipython -s py-rattler ipython
```

## `remove`

Removes dependencies from the [manifest file](project_configuration.md).
Expand Down

0 comments on commit 6fdd9f1

Please sign in to comment.