Skip to content

feat(config): add --describe flag to pixi config list - #7160

Open
ZachFlint wants to merge 11 commits into
prefix-dev:mainfrom
ZachFlint:config-describe
Open

ZachFlint wants to merge 11 commits into
prefix-dev:mainfrom
ZachFlint:config-describe

Conversation

@ZachFlint

Copy link
Copy Markdown
Contributor

Continues #6189, which was closed when I accidentally deleted my fork.

Description

Adds an annotated TOML-style listing of every available configuration option with its type, default, and a short explanation. Keys that are currently set print uncommented with their value; the rest are emitted as commented stubs showing the default.

--describe [KEY] describes one key. --describe --json emits a structured array suitable for tooling.

Closes #1457.

How Has This Been Tested?

  • Added unit tests in pixi_config cross-checking describe_keys() against get_keys() for completeness.
  • Added an integration test in tests/integration_python/test_main_cli.py covering: unfiltered describe, key-filtered describe, set-value
    rendering, per-bucket keys like s3-options.my-bucket.region, JSON output shape, and unknown-key error.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.

@lucascolley lucascolley added enhancement New features cli configuration Configuration of workspace or global behavior labels Oct 5, 2026
@ZachFlint

Copy link
Copy Markdown
Contributor Author

hey @lucascolley, saw your #7221 go in so I updated the detached-environments description here to match, and switched the describe code over to a typed error for the into_diagnostic check. since you've been in the config code lately would you be up for reviewing this one? no rush

@lucascolley
lucascolley self-requested a review October 16, 2026 21:57
Adds an annotated TOML-style listing of every available configuration
option with its type, default, and a short explanation. Keys that are
currently set print uncommented with their value; the rest are emitted
as commented stubs showing the default.

`--describe [KEY]` describes one key, including per-bucket keys such as
`s3-options.my-bucket.region`. `--describe --json` emits a structured
array suitable for tooling. The option is also documented in the
configuration reference.

Closes prefix-dev#1457.
prefix-dev#7221 rejects relative `detached-environments` paths, so say so in the
`--describe` output.
Return a `DescribeError` instead of adding `into_diagnostic` calls, as
the ratchet from prefix-dev#7204 asks (see prefix-dev#6707), and print `--describe` output
through the same path as the rest of `config list`.
prefix-dev#7127 added `virtual-package-detectors` and
`cache.virtual-package-detectors`; describe them so `--describe` lists
every key in `get_keys()`.
@ZachFlint

Copy link
Copy Markdown
Contributor Author

thanks for rebasing! the rebase dropped the virtual-package-detectors descriptions (they were only in a merge commit), so I re-added them in a separate commit

An empty list falls back to `conda-forge`, so showing `[]` suggested
that no channels would be used. The description now also lists every
command the option affects, as the reference docs do.
| Before | After |
|---|---|
| ``Unknown configuration key '{0}'. Run `pixi config list --describe` to list every available key.`` | ``unknown configuration key '{0}'``, help: ``run `pixi config list --describe` to list every available key`` |
Given a key, it describes only the matching option.
Inline tables kept the decor of the tables they were built from, which
printed values like `{ solves = 15, downloads = 7}`.
`pixi config list <key>` finds a consent decision whatever the spelling
of its origin, e.g. with a trailing slash. `--describe` looked up the
raw key instead, so it showed the default rather than the saved
decision. It now normalizes keys the same way.
Values come from the merged configuration, so the fields of a
configured table such as `concurrency` show their effective value even
if the user did not set them. We document this rather than track which
keys appear in the config files.
Options such as `s3-options.<bucket>.region` were always shown
commented out as unset, even with buckets configured. They now expand
to one row per configured bucket or consent origin, and keep the
placeholder row when there are none. Describing a placeholder key
directly expands the same way.

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @ZachFlint ! I pushed some minor fixes. One main question for you.

pub default: &'static str,
}

static CONFIG_OPTION_DESCRIPTIONS: &[ConfigOptionDescription] = &[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is there a test that this stays up-to-date as new options are added?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli configuration Configuration of workspace or global behavior enhancement New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): option to exhaustively list all configuration options (like conda config --describe)

2 participants