-
Notifications
You must be signed in to change notification settings - Fork 369
Description
As always, thanks for
pixi!
elevator pitch
Add some pixi CLI features to emit JSON schema for key pixi files and other features.
references
- JSON schema for
pyproject.toml[tool.pixi]#1089 - Verify pixi schema against CLI #2057
- Autogenerated manifest docs #3021
- Investigate JSON Schema for pixi build backends #3938
- Add
pixi tree --json#4130 - feat(global): add
--dry-run&--jsontoglobal update#4262 - feat(cli): add new pixi global tree command #4427
motivation
As the number of pixi features which provide --json output expands, it may
make sense for a user's installed pixi to be able to tell them exactly,
conclusively, what kind of JSON to expect.
This would make it far easier for external tools to predictably integrate with
pixi, and, crucially, detect when big changes happen.
design ideas
Some potential CLI experiences (not mutually exclusive):
-
a top-level
pixi schemasubcommand:$ pixi schema No schema key given, please provide one of: Key Describes lock a pixi.lock file manifest a pixi.toml file pyproject a pyproject.toml file schema output of `pixi schema --json` task-list output of `pixi task list --json` tree output of `pixi tree --json` # ...
-
a
--schema, a neighbor to--json:pixi list --json --schema pixi task list --json --schema # ...
The generated schemata should have most of the properties of the existing, hand-made
manifest schema for downstreams over time:
- provide
$schema(probably stick withdraft7) - provide
$idwhich would resolve to a versioned URL on the docs site - be sensibly sorted and indented between versions
- be self-contained and not references other URLs
A key enabler, mentioned in a few places, is schemars, already in Cargo.lock as a dependency of uv.