feat(cli): promote profile to a top-level command - #3068
Open
natedemoss wants to merge 1 commit into
Open
Conversation
Profiles were reachable only through `provider list-profiles` and the nested `provider profile` group, which broke the `noun verb` shape the rest of the CLI follows and left no way to read a single profile. Add a top-level `profile` noun with list, describe, export, import, update, lint, and delete. `describe` is new: it renders one profile for reading, and reuses the export serializer for `-o json` and `-o yaml` so the two commands cannot drift apart. `list` gains `--type`, which is a no-op today because `provider` is the only profile type the gateway stores, and exists so callers can pin the type they expect. The new commands call the same `run::provider_profile_*` functions that already backed the nested group, so the original spellings keep working against one shared implementation rather than a parallel code path. Signed-off-by: Nathan DeMoss <ndemoss28@gmail.com>
natedemoss
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 31, 2026 23:56
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Promotes
profileto a top-level CLI noun withlist,describe,export,import,update,lint, anddelete, and adds thedescribeview that did not exist before. The originalprovider list-profilesandprovider profile ...spellings keep working and run the same code, so nothing breaks.Related Issue
Closes #2588
Changes
Commands::Profileand aProfileCommandssubcommand group covering the seven verbs.openshell profile describe <id>, a human-readable detail view for a single profile. Structured output reuses the export serializer sodescribe -o jsonandexport -o jsoncannot drift apart.--typetoprofile list, backed by aProfileTypevalue enum.run::provider_profile_*functions, so the old and new spellings share one implementation rather than being parallel code paths.openshell-cliskill reference to lead with the new commands and record the old ones as aliases.Testing
mise run pre-commitpassesmiseand Docker are not installed on this workstation, so I ran the pre-commit steps individually:cargo fmt --all -- --checkclean.cargo test -p openshell-cli399 passed, 0 failed, across every target in the package. That includes 10 new tests: 7 covering CLI parsing, the--typefilter, the importArgGroup,--global, and continued parsing of the legacy commands; 3 covering thedescriberenderer.cargo clippy -p openshell-cli --all-targets -- -D warningsclean for this crate. I had to add-A clippy::unused_asynclocally because the#[cfg(not(unix))]connect_unixstub inopenshell-extension-coretrips that lint on Windows. The repository already allows it for Windows intasks/scripts/windows-msvc.ps1, so this matches existing project policy and is not a change in this PR.render_profile_describereturns aStringrather than printing, which is what makes the no-ANSI and no-truncation properties directly assertable instead of eyeballed.What I could not verify: every one of these subcommands needs a live gateway to exercise, and I have no gateway, Docker, or Kubernetes available here. I have confirmed that the commands parse, that dispatch compiles, and that the rendering is correct, but I have not run any of them end to end against a gateway. The dispatch calls the same
run::functions the existing commands already use, so the runtime path is shared rather than new, but that is an argument from construction and not a test result.Open question for review
The issue's
profile listmock shows flatNAME / TYPE / CATEGORY / SOURCEcolumns. This PR instead reuses the existingprovider_list_profilesrenderer, which groups by category and usesID / SCOPE / SOURCE / DISPLAY.I chose reuse because the issue also specifies that
provider list-profilesbecomes an alias forprofile list --type provider, and an alias that prints something different from its target seemed like the worse outcome. Matching the mock exactly would mean either a second renderer, which makes the two commands visibly diverge, or changing the existing command's output, which is a user-visible change to a command the issue said should keep working.Happy to switch to the flat layout for both commands if that is the preference. Flagging it rather than deciding it silently.
Checklist
AI assistance: an agent explored the existing profile commands, wrote the implementation, tests, and doc updates, and ran the checks. I reviewed the result and can explain it. The new commands are thin wrappers over the
run::provider_profile_*functions that already backedprovider profile ...; the only genuinely new logic isrender_profile_describeand the--typefilter, and the filter is a no-op today becauseprovideris the only profile type the gateway stores.