feat: Add feature CLI commands and add remove_feature to pixi_api#5086
feat: Add feature CLI commands and add remove_feature to pixi_api#5086ruben-arts merged 11 commits intoprefix-dev:mainfrom
feature CLI commands and add remove_feature to pixi_api#5086Conversation
feature CLI commands and add remove_feature to pixi_api
Hofer-Julian
left a comment
There was a problem hiding this comment.
Looks good overall. I had a few comments and questions :)
| writeln!( | ||
| std::io::stdout(), |
There was a problem hiding this comment.
Why did you not use println! here?
There was a problem hiding this comment.
I'm not entirely sure, I just used environment here as reference, so it's consistent between different commands.
https://github.com/prefix-dev/pixi/blob/main/crates/pixi_cli/src/workspace/environment.rs#L77
There was a problem hiding this comment.
Maybe you can check who introduced that and ask them. I am curious now. But no blocker for merging it then :)
There was a problem hiding this comment.
It has to do with broken pipes without it.
| .inspect_err(|e| { | ||
| if e.kind() == std::io::ErrorKind::BrokenPipe { | ||
| std::process::exit(0); | ||
| } | ||
| }) |
There was a problem hiding this comment.
Why is this necessary?
There was a problem hiding this comment.
I'm not entirely sure, I just used environment here as reference, so it's consistent between different commands.
https://github.com/prefix-dev/pixi/blob/main/crates/pixi_cli/src/workspace/environment.rs#L95
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
ruben-arts
left a comment
There was a problem hiding this comment.
Great work, not big changes required. Would love to see my nitpick but I'm not keeping it from being merged because of that so I'm approving it!
| let mut details = Vec::new(); | ||
|
|
||
| if !deps.is_empty() { | ||
| details.push(format!(" dependencies: {}", deps.join(", "))); |
There was a problem hiding this comment.
Very nitpicky but I always like colors to read more quickly, we use green for conda deps and blue for pypi deps. Would you want to add that?

Description
Adds a new
remove_featuretopixi_apiWorkspaceContext, which removes a feature from a manifest (and also removes it from environments as well, if necessary).Also adds new
pixi workspace feature rm/lsCLI commands.pixi % pixi workspace feature ls Features: - default: dependencies: cargo-insta, git, python tasks: insta, test-all-extra-slow, install-as, generate-cli-docs, test, install, test-fast, test-all-fast, install-debug-as, build-debug, pypi-proxy, build-release, test-slow, run-all-examples, test-all-slow, release, bump - pytest: dependencies: dirty-equals, filelock, inline-snapshot, py-rattler, pytest, pytest-rerunfailures, pytest-timeout, pytest-xdist, pyyaml, rattler-build, rich, tomli-w, types-pyyaml tasks: test-specific-test, test-integration-ci, test-integration-extra-slow-ci, test-specific-test-debug, test-integration-slow, test-integration-extra-slow, update-test-channel, test-common-wheels, test-integration-fast, test-common-wheels-ci - dev: dependencies: cargo-edit, cargo-nextest, cffconvert, tbump tasks: switch-to-remote-rattler, switch-to-local-uv, snapshot-update, switch-to-local-rattler, insta-review, update-rattler, switch-to-remote-uv - lint: dependencies: actionlint, basedpyright, cargo-deny, cargo-shear, dprint, go-shfmt, lefthook, ruff, shellcheck, taplo, typos tasks: toml-lint, pre-commit-install, typecheck-python, cargo-fmt, shell-format, dprint-fmt, ruff-format, lint-fast, lefthook, dprint-check, pre-commit-install-minimal, cargo-clippy, cargo-deny, typos, cargo-shear, lint-slow, lint, ruff-lint, check-openssl, actionlint, toml-format - rust: dependencies: rust - build: dependencies: compilers, git, openssl, pkg-config, rust-src - docs: dependencies: cairosvg, git-cliff, mdx_truly_sane_lists, mike, mkdocs-llmstxt, mkdocs-material, mkdocs-redirects, pillow tasks: mike-serve, deploy-latest, docs, deploy-dev, bump-changelog, build-docs - schema: dependencies: jsonschema, pydantic, pyyaml tasks: test-schema, generate-schema - pypi-gen: dependencies: hatchling, python-build tasks: pypi-gen-indexes - micromamba: dependencies: micromamba tasks: test-export - trampoline: dependencies: python, zstd tasks: build-trampoline - recipes: dependencies: rattler-build tasks: build-backends - dist: dependencies: zig - native-certs-test: dependencies: mkcert, pip, rich, testcontainers tasks: test-native-certsCloses #1999
feature addcommand, which doesn't make much sense, since it would add an empty TOML table and features are getting added / edited implicitly via other commands, likepixi add / remove --feature fooAI Disclosure
Tools: Claude code
Checklist: