Add TEAMS_CLI_PROFILE and stop shadowing the "default" profile - #58
Open
aberoham wants to merge 1 commit into
Open
Add TEAMS_CLI_PROFILE and stop shadowing the "default" profile#58aberoham wants to merge 1 commit into
aberoham wants to merge 1 commit into
Conversation
The global --profile flag becomes Option<String> with a TEAMS_CLI_PROFILE env fallback, so scripts and agents can select a profile once per session instead of repeating the flag on every invocation. Precedence: flag, then env var, then the config's default.profile, then "default". Making the flag optional also distinguishes "not given" from an explicit --profile default. Previously the two were identical, so after `teams auth switch <other>` the switched profile shadowed the profile literally named "default" and it became unreachable from the command line; even `--profile default auth login` stored its token under the switched name. An explicit value now always wins. Fixes osodevops#53. Fixes osodevops#55. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NXWLJ9g87M3GtLSACr2gmi
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.
Fixes #53.
Fixes #55.
The global
--profileflag becomesOption<String>with aTEAMS_CLI_PROFILEenvironment fallback, so scripts and agents can select a profile once per session instead of repeating the flag on every invocation. Precedence:--profileflag, thenTEAMS_CLI_PROFILE, then the config'sdefault.profile, thendefault— the same shape as the other auth environment variables.Making the flag optional also distinguishes "not given" from an explicit
--profile default. Previously the two were identical, so afterteams auth switch <other>the switched profile shadowed the profile literally named "default" and it became unreachable from the command line; even--profile default auth loginstored its token under the switched name. An explicit value now always wins, even when it is the literaldefault.Unit tests cover the new
resolve_profileprecedence including the shadowing regression; integration tests cover environment selection, flag-beats-environment, and explicit-default-beats-config-default. The test harness now scrubsTEAMS_CLI_PROFILEalongside the other inherited auth variables. README andteams(1)document the variable.cargo fmt,cargo clippy --all-targets -- -D warnings, andcargo test --all-targetspass (134 unit + 56 integration tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01NXWLJ9g87M3GtLSACr2gmi