Skip to content

feat(package): Add azldev package list command#53

Merged
reubeno merged 5 commits intomicrosoft:mainfrom
liunan-ms:liunan/package_list
Apr 1, 2026
Merged

feat(package): Add azldev package list command#53
reubeno merged 5 commits intomicrosoft:mainfrom
liunan-ms:liunan/package_list

Conversation

@liunan-ms
Copy link
Copy Markdown
Contributor

This PR adds a new azldev package list (alias azldev pkg list) command that resolves and displays binary package configuration across all config layers, and adds new how-to guide (docs/user/how-to/inspect-package-config.md).

azldev package list provides -a (all explicitly-configured packages) and -p (specific package by name) flags, leverages the resolver (added in #38) to resolve package configuration through all layers and outputs Table or JSON (-q -O json) output formats.

Examples

  • Create a packages.toml with the content below and imported in project.toml:
# Project-level package publish configuration

[default-package-config]
publish = { channel = "none" }

[package-groups.devel-packages]
description = "Development subpackages"
packages = ["libcurl-devel", "curl-static", "wget2-devel"]

[package-groups.devel-packages.default-package-config.publish]
channel = "rpm-build-only"

[package-groups.debug-packages]
description = "Debug info and source"
packages = [
    "libcurl-debuginfo",
    "libcurl-minimal-debuginfo",
    "curl-debugsource",
    "wget2-debuginfo",
    "wget2-debugsource",
    "wget2-libs-debuginfo"
]

[package-groups.debug-packages.default-package-config.publish]
channel = "rpm-debug"

  • Component level configuration:
[components.wget2.packages.wget2-wget.publish]
channel = "rpm-base"
  • Output:
image

Add a new 'azldev package list' (alias: 'azldev pkg list') command that
resolves and displays binary package configuration without running a build.

Flags:
  -a  enumerate all packages that appear in any package-group or component
      packages override
  -p  look up one or more specific packages by exact name; packages not in
      any explicit config are still resolved using project defaults
  Positional args are merged into -p for convenience.

The resolved output includes the package name, package-group membership,
component override source, and the effective publish channel after applying
all four config layers (project default → group → component default →
component per-package override).

When neither -a nor -p is given the command warns and returns no results,
consistent with 'component list' behavior.
Copilot AI review requested due to automatic review settings March 31, 2026 22:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new top-level azldev package command group with a list subcommand for inspecting resolved binary package configuration (including publish channel resolution across config layers), along with documentation and updated scenario snapshots.

Changes:

  • Register new package / pkg top-level CLI command and package list subcommand.
  • Implement package config enumeration + resolution via projectconfig.ResolvePackageConfig, with table/JSON reporting.
  • Add a new how-to guide and update reference docs/snapshots to include the new command.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scenario/snapshots/TestSnapshotsContainer_help_stdout_1.snap Updates help snapshot to include new package command
scenario/snapshots/TestSnapshotsContainer_--help_stdout_1.snap Updates help snapshot to include new package command
scenario/snapshots/TestSnapshotsContainer_--bogus-flag_stderr_1.snap Updates help-on-error snapshot to include new package command
scenario/snapshots/TestSnapshots_help_stdout_1.snap Updates help snapshot to include new package command
scenario/snapshots/TestSnapshots_--help_with_color_stdout_1.snap Updates colorized help snapshot to include new package command
scenario/snapshots/TestSnapshots_--help_stdout_1.snap Updates help snapshot to include new package command
scenario/snapshots/TestSnapshots_--bogus-flag_stderr_1.snap Updates help-on-error snapshot to include new package command
scenario/snapshots/TestMCPServerMode_1.snap.json Adds MCP tool schema entry for package-list
pkg/app/azldev_cli/azldev.go Wires cmds/pkg into app initialization
pkg/app/azldev_cli/azldev_test.go Updates instantiated command list to include package
internal/projectconfig/project.go Fixes typo in comment about package group membership
internal/app/azldev/cmds/pkg/package.go Introduces azldev package / azldev pkg command group
internal/app/azldev/cmds/pkg/list.go Implements azldev package list command + ListPackages logic
internal/app/azldev/cmds/pkg/list_test.go Adds unit tests for package listing/resolution behavior
internal/app/azldev/cmds/component/build.go Adjusts error formatting to quote component name with %#q
docs/user/reference/config/project.md Clarifies top-level vs [project] nesting for package config sections
docs/user/reference/cli/azldev.md Adds azldev package to CLI reference index
docs/user/reference/cli/azldev_package.md Auto-generated CLI doc for azldev package
docs/user/reference/cli/azldev_package_list.md Auto-generated CLI doc for azldev package list
docs/user/how-to/inspect-package-config.md New how-to guide describing azldev package list usage

@binujp
Copy link
Copy Markdown
Contributor

binujp commented Apr 1, 2026

Thanks for the feature, Nan. Skimmed through the changes and cli, looks good.

Looking at this purely from a dev pov, is there a way I can list where each package in a component would go to? The use case I have is, from not knowing what packages a component delivers to knowing what packages and where each of them go to. Maybe that is out of context for this PR. If so, is that a feature that can be implemented easily? (Maybe I asked this already?)

@reubeno reubeno merged commit 3c58863 into microsoft:main Apr 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants