Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add reference documentation for the exec command #1587

Merged
merged 6 commits into from
Jul 13, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,35 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to find this cache, e.g. for cleaning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some information about where to find the environments and that they should be deleted manually.


##### Arguments

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

#### Options:
* `-s, --spec <SPECS>`: Matchspecs of packages to install. If this is not provided, the package is guessed from the command.
* `-c, --channel <CHANNELS>`: The channel to install the packages from. If not specified the default channel is used.
tdejager marked this conversation as resolved.
Show resolved Hide resolved
* `--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
Loading