Skip to content

Conversation

@water-sucks
Copy link
Contributor

@water-sucks water-sucks commented Dec 17, 2025

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

This adds support for multiple accounts, and does a bunch of refactoring to make this possible.

  • Configuration files are now underneath $HOME/.config/pangolin, in a more standard location. In the future, this can use $XDG_CONFIG_HOME, if set.
  • A new file, config.json, controls the log level, log path, and update checks. These can also be set through corresponding env vars, prefaced with PANGOLIN_CLI.
  • A new file, accounts.json, is now being used for setting account information/other mutable state pertaining to them, such as the selected organization. All global viper state is banished!
  • The API client and account store is now passed through a context.Context, inherited by the cobra.Command struct and passed to every function. The client is automatically instantiated with the active client's session token, if set.
  • A new command, pangolin select account, can be used to switch the active account.

How to test?

  • Login to a secondary account using pangolin auth login. You should see two accounts when selecting between them
  • Select account using pangolin select account. If an OLM client is running, it should be shut down.
  • Select accounts using the host's name as a filter. Host names should exactly match the queries; this can be facilitated using command-line completion in the future.

@water-sucks water-sucks marked this pull request as ready for review December 17, 2025 18:23
@miloschwartz
Copy link
Member

Lgtm! Thanks @water-sucks

@miloschwartz miloschwartz merged commit ddfcb65 into fosrl:dev Dec 19, 2025
@water-sucks water-sucks deleted the multi-account-login branch December 19, 2025 03:17
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.

2 participants