Skip to content
Open
Changes from all 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
38 changes: 38 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,44 @@ Let's go through the basic usage of Pixi.
- [`pixi tree`](./reference/cli/pixi/tree.md) - show a tree of dependencies in the current environment
- [`pixi clean`](./reference/cli/pixi/clean.md) - remove the environment from your machine


## How Pixi works

When you use Pixi, it manages three aspects in your project directory:

- `pixi.toml`( or `pyproject.toml`) - the manifest file, listing the dependencies you want in your project
- `pixi.lock` - the lockfile, containing the resolved versions of dependencies (including transitive ones), you should commit this file to version control
- `.pixi/` - the installed environment on your machine

The following commands interact with these files in sequence:

- [`pixi add`](./reference/cli/pixi/add.md) - adds a dependency to `pixi.toml`
- [`pixi lock`](./reference/cli/pixi/lock.md) - resolves the dependencies in `pixi.toml` and writes the exact versions to `pixi.lock`
- [`pixi install`](./reference/cli/pixi/install.md) - installs the packages listed in `pixi.lock` into the `.pixi/` directory
- [`pixi run`](./reference/cli/pixi/run.md) - activates the `.pixi/` environment and runs given command

The diagram below shows how Pixi's commands and files relate to each other.
There are two types of elements: **commands** .


Starting from the left, `pixi add` writes your dependency into `pixi.toml`.
Then `pixi lock` reads that file and calculates the exact version of every package,
saving the result in `pixi.lock`. Finally, `pixi install` reads `pixi.lock`
and installs everything into the `.pixi/envs/` folder on your machine.

The dashed arrow shows the shortcut: instead of running these steps manually,
`pixi run` triggers the whole chain automatically , so you only ever need one command.

```mermaid
flowchart LR
add[pixi add] --> toml[pixi.toml]
toml --> lock[pixi lock]
lock --> lockfile[pixi.lock]
lockfile --> install[pixi install]
install --> env[.pixi/envs/]
run[pixi run] -. auto-triggers .-> install
```
Comment on lines +49 to +57
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this is a clean enough diagram to really explain how things interact with each other.

It comes very close to the information trying to convey in this pr: #5881

Assuming you're both at the PyCon sprints. Maybe you two could discuss?


## Managing global installations

Pixi can manage global installations of tools in global environments.
Expand Down