-
Notifications
You must be signed in to change notification settings - Fork 3
[feature] CLI commands for site configuration #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
AlbertDeFusco
wants to merge
38
commits into
main
Choose a base branch
from
feat/config-new-sites
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
mattkram
reviewed
Dec 12, 2025
| is_default = CHECK_MARK if name == sites_config.default_site else "" | ||
| table.add_row(name, site.domain, is_default) | ||
|
|
||
| console.print(table) |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to also include a prompt like "to view site details, use anaconda sites show. Or something like that.
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.
New cli commands are added in
sitessubcommand, see below.CLI
A few important points here on the CLI. When running
showandlistcommands the env vars, secrets, and condarc configuration is always loaded and reported. But when writing values usinganaconda sites setthese sources are ignored to prevent secrets and conda configuration being written to the config.toml.Several fields are hidden with
anaconda sites show [site or domain]and can be displayed with--show-hidden. These same fields are also marked as hidden for theaddandmodifycommands but can be provided, i.e.anaconda sites add --name "my_site" --domain "my.domain" --client-id=fooBy default CLI commands will show the proposed diff of changes and ask for confirmation. To automatically accept the changes use
-yor--yes. To only show the diff and not ask for confirmation use--dry-run.Here's an example of adding a new site and setting it as default, but keeping the out-of-the-box
'anaconda.com'site. The existinguse_device_flow = trueconfiguration in the config.toml, that is applied to all sites, is untouched.AnacondaAuthSite improvements
There is a slight cosmetic change to
AnacondaAuthSite. Thesitefield, which was set as default toanaconda.comnow follows thedomainfield unless explicitly set. This allows the site object to remember its name.When calling
model_dump()on an AnacondaAuthSite thesitefield will be excluded. This ensures that the[plugin.auth]table in the config.toml does not havesite =when configuration updates are written. All site names belong in the[sites.<>]table names.