-
Notifications
You must be signed in to change notification settings - Fork 536
feat: Autogeneration of the CLI documentation. #3268
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
Merged
ruben-arts
merged 65 commits into
prefix-dev:main
from
ruben-arts:feature/automated_cli_docs
Mar 10, 2025
Merged
Changes from 12 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
df8f743
wip: add initial plumbing to get the command and print it from a binary
ruben-arts 142e1b8
wip: recursive generation of command files
ruben-arts a9c2874
wip: cleanup flow
ruben-arts fcaa6da
feat: working version in the documentation pages
ruben-arts 6a5e042
feat: make title a navigation in the cli
ruben-arts e1d10a3
fix: generation warnings
ruben-arts bc0a0c3
misc: add simple run instruction
ruben-arts e6c82ef
docs: improve about section
ruben-arts 6fa9bd7
docs: full recursion and more info on positionals and arguments
ruben-arts 20f02b4
misc: add the snippet logic with named parts
ruben-arts 1ba3e78
docs: add some initial injected information
ruben-arts 0837c95
docs: fix injection pixi add
ruben-arts c579849
fix: synopsis
ruben-arts 0dbc1f7
fix: broken link
ruben-arts c529649
feat: use table for subcommands
ruben-arts 8ab6101
feat: make the options linked to themselves
ruben-arts dbfec2b
Adapt task
Hofer-Julian 719b483
fix: title display
ruben-arts e7f2cd7
fix: options display
ruben-arts ef7f27d
fix: option id's
ruben-arts 646d322
fix: cli md abouts
ruben-arts 4f177c6
refactor: generation location
ruben-arts c319309
Show old documentation
ruben-arts 8dbc667
docs: clean up init command
ruben-arts 1ff43e2
docs: add usage
ruben-arts 522b5a9
Merge remote-tracking branch 'upstream/main' into feature/automated_c…
ruben-arts fb91da8
fix: cli docs looks subcommand
ruben-arts 4e103d3
misc: rename the extender md
ruben-arts 50155f8
refactor: make generated the default cli docs
ruben-arts 20f1aed
ci: check generated documentation in ci
ruben-arts a5911d6
feat: add generated documentation to the repo
ruben-arts c1cdaca
fix: autogenerated result is lint compatible
ruben-arts edb98be
Merge remote-tracking branch 'upstream/main' into feature/automated_c…
ruben-arts dd27212
fix: mkdocs warning about links in autogenerated tables
ruben-arts 1eb4b94
fix: mkdocs warning about links to cli docs
ruben-arts bd6eb90
fix: current platform default values
ruben-arts fb276b0
docs: update init and add
ruben-arts b879265
docs: update init, add and install
ruben-arts 6166cd8
docs: update the update document
ruben-arts 278796a
docs: update the upgrade document
ruben-arts 0d7326e
docs: update the lock document
ruben-arts 412d79b
docs: update the run document
ruben-arts 692ab1f
docs: update the exec document
ruben-arts 620fd8c
docs: update the remove document
ruben-arts 1c585d2
docs: update the task documents
ruben-arts 29e4f16
docs: update the tree and list documents
ruben-arts 0c20da0
docs: update the shell documents
ruben-arts 0673280
docs: update the shell-hook documents
ruben-arts adfefe9
docs: update the search documents
ruben-arts a578b2b
docs: update the self-update documents
ruben-arts 97dd2c2
docs: update the info documents
ruben-arts 20d9738
docs: update the cache documents
ruben-arts 142ed9b
docs: update the upload documents
ruben-arts 0ea9e8c
docs: update the auth documents
ruben-arts 3209c90
docs: update the config documents
ruben-arts 35bb768
docs: update the global documents
ruben-arts 1ac5cae
docs: clean
ruben-arts 91fc369
docs: update project channel docs
ruben-arts 83161b0
Merge branch 'main' into feature/automated_cli_docs
ruben-arts 2aa258b
docs: update project docs
ruben-arts 3df870f
Merge remote-tracking branch 'upstream/main' into feature/automated_c…
ruben-arts 3a78a8d
Move `generate-cli-docs` task
Hofer-Julian 479cd95
ci: remove all generated files before regenerating
ruben-arts cf8a2e2
docs: remove old cli docs
ruben-arts 1ea0f53
docs: fix link
ruben-arts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| This directory contains the same structure as the autogenerated cli documentation. | ||
|
|
||
| In all the autogenerated files, there are `snippets` injected like `description` and `example`. | ||
|
|
||
| If you put a file with the same file name and path as the autogenerated companion file, the `snippets` will be injected into the file. | ||
|
|
||
| For example, `docs/autogenerated/pixi.md` is the autogenerated file and `docs/reference/cli/pixi.md` is the injecting file. | ||
|
|
||
| Snipped documentation can be found here: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --8<-- [start:description] | ||
| ## Description | ||
|
|
||
| The `pixi` command is the main entry point for the Pixi CLI. | ||
|
|
||
| --8<-- [end:description] | ||
|
|
||
|
|
||
| --8<-- [start:example] | ||
| ## Examples | ||
|
|
||
| Set the verbosity of pixi with the multi level flag `-v` or `--verbose`: | ||
|
|
||
| ```shell | ||
| pixi -v command # info | ||
| pixi -vv command # debug | ||
| pixi -vvv command # trace | ||
|
|
||
| pixi --verbose command # info | ||
| ``` | ||
| --8<-- [end:example] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
|
|
||
| --8<-- [start:example] | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| pixi add numpy # (1)! | ||
| pixi add numpy pandas "pytorch>=1.8" # (2)! | ||
| pixi add "numpy>=1.22,<1.24" # (3)! | ||
| pixi add --manifest-path ~/myproject/pixi.toml numpy # (4)! | ||
| pixi add --host "python>=3.9.0" # (5)! | ||
| pixi add --build cmake # (6)! | ||
| pixi add --platform osx-64 clang # (7)! | ||
| pixi add --no-install numpy # (8)! | ||
| pixi add --no-lockfile-update numpy # (9)! | ||
| pixi add --feature featurex numpy # (10)! | ||
| pixi add --git https://github.com/wolfv/pixi-build-examples boost-check # (11)! | ||
| pixi add --git https://github.com/wolfv/pixi-build-examples --branch main --subdir boost-check boost-check # (12)! | ||
| pixi add --git https://github.com/wolfv/pixi-build-examples --tag v0.1.0 boost-check # (13)! | ||
| pixi add --git https://github.com/wolfv/pixi-build-examples --rev e50d4a1 boost-check # (14)! | ||
|
|
||
| # Add a pypi dependency | ||
| pixi add --pypi requests[security] # (15)! | ||
| pixi add --pypi Django==5.1rc1 # (16)! | ||
| pixi add --pypi "boltons>=24.0.0" --feature lint # (17)! | ||
| pixi add --pypi "boltons @ https://files.pythonhosted.org/packages/46/35/e50d4a115f93e2a3fbf52438435bb2efcf14c11d4fcd6bdcd77a6fc399c9/boltons-24.0.0-py3-none-any.whl" # (18)! | ||
| pixi add --pypi "exchangelib @ git+https://github.com/ecederstrand/exchangelib" # (19)! | ||
| pixi add --pypi "project @ file:///absolute/path/to/project" # (20)! | ||
| pixi add --pypi "project@file:///absolute/path/to/project" --editable # (21)! | ||
| pixi add --git https://github.com/mahmoud/boltons.git boltons --pypi # (22)! | ||
| pixi add --git https://github.com/mahmoud/boltons.git boltons --branch main --pypi # (23)! | ||
| pixi add --git https://github.com/mahmoud/boltons.git boltons --rev e50d4a1 --pypi # (24)! | ||
| pixi add --git https://github.com/mahmoud/boltons.git boltons --tag v0.1.0 --pypi # (25)! | ||
| pixi add --git https://github.com/mahmoud/boltons.git boltons --tag v0.1.0 --pypi --subdir boltons # (26)! | ||
| ``` | ||
|
|
||
| 1. This will add the `numpy` package to the project with the latest available for the solved environment. | ||
| 2. This will add multiple packages to the project solving them all together. | ||
| 3. This will add the `numpy` package with the version constraint. | ||
| 4. This will add the `numpy` package to the project of the manifest file at the given path. | ||
| 5. This will add the `python` package as a host dependency. There is currently no different behavior for host dependencies. | ||
| 6. This will add the `cmake` package as a build dependency. There is currently no different behavior for build dependencies. | ||
| 7. This will add the `clang` package only for the `osx-64` platform. | ||
| 8. This will add the `numpy` package to the manifest and lockfile, without installing it in an environment. | ||
| 9. This will add the `numpy` package to the manifest without updating the lockfile or installing it in the environment. | ||
| 10. This will add the `numpy` package in the feature `featurex`. | ||
| 11. This will add the `boost-check` source package to the dependencies from the git repository. | ||
| 12. This will add the `boost-check` source package to the dependencies from the git repository using `main` branch and the `boost-check` folder in the repository. | ||
| 13. This will add the `boost-check` source package to the dependencies from the git repository using `v0.1.0` tag. | ||
| 14. This will add the `boost-check` source package to the dependencies from the git repository using `e50d4a1` revision. | ||
| 15. This will add the `requests` package as `pypi` dependency with the `security` extra. | ||
| 16. This will add the `pre-release` version of `Django` to the project as a `pypi` dependency. | ||
| 17. This will add the `boltons` package in the feature `lint` as `pypi` dependency. | ||
| 18. This will add the `boltons` package with the given `url` as `pypi` dependency. | ||
| 19. This will add the `exchangelib` package with the given `git` url as `pypi` dependency. | ||
| 20. This will add the `project` package with the given `file` url as `pypi` dependency. | ||
| 21. This will add the `project` package with the given `file` url as an `editable` package as `pypi` dependency. | ||
| 22. This will add the `boltons` package with the given `git` url as `pypi` dependency. | ||
| 23. This will add the `boltons` package with the given `git` url and `main` branch as `pypi` dependency. | ||
| 24. This will add the `boltons` package with the given `git` url and `e50d4a1` revision as `pypi` dependency. | ||
| 25. This will add the `boltons` package with the given `git` url and `v0.1.0` tag as `pypi` dependency. | ||
| 26. This will add the `boltons` package with the given `git` url, `v0.1.0` tag and the `boltons` folder in the repository as `pypi` dependency. | ||
|
|
||
| !!! tip | ||
| If you want to use a non default pinning strategy, you can set it using [pixi's configuration](./pixi_configuration.md#pinning-strategy). | ||
| ``` | ||
| pixi config set pinning-strategy no-pin --global | ||
| ``` | ||
| The default is `semver` which will pin the dependencies to the latest major version or minor for `v0` versions. | ||
| !!! note | ||
| There is an exception to this rule when you add a package we defined as non `semver`, then we'll use the `minor` strategy. | ||
| These are the packages we defined as non `semver`: | ||
| Python, Rust, Julia, GCC, GXX, GFortran, NodeJS, Deno, R, R-Base, Perl | ||
|
|
||
| --8<-- [end:example] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --8<-- [start:description] | ||
|
|
||
| !!! info "Importing an environment.yml" | ||
| When importing an environment, the `pixi.toml` will be created with the dependencies from the environment file. | ||
| The `pixi.lock` will be created when you install the environment. | ||
| We don't support `git+` urls as dependencies for pip packages and for the `defaults` channel we use `main`, `r` and `msys2` as the default channels. | ||
|
|
||
|
|
||
| --8<-- [end:description] | ||
|
|
||
|
|
||
| --8<-- [start:example] | ||
|
|
||
| ## Examples | ||
|
|
||
| ```shell | ||
| pixi init myproject | ||
| pixi init ~/myproject | ||
| pixi init # Initializes directly in the current directory. | ||
| pixi init --channel conda-forge --channel bioconda myproject | ||
| pixi init --platform osx-64 --platform linux-64 myproject | ||
| pixi init --import environment.yml | ||
| pixi init --format pyproject | ||
| pixi init --format pixi --scm gitlab | ||
| ``` | ||
|
|
||
| --8<-- [end:example] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.