Implement depot api-token command for envfiles, etc#497
Open
agdphd wants to merge 1 commit intodepot:mainfrom
Open
Implement depot api-token command for envfiles, etc#497agdphd wants to merge 1 commit intodepot:mainfrom
depot api-token command for envfiles, etc#497agdphd wants to merge 1 commit intodepot:mainfrom
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
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.
My org is in the process of adopting Moonrepo with Depot Cache, and the need for each user to manually sign into the Depot user settings page and mint an API token to set up their config is a point of friction. This PR adds a new subcommand
depot api-tokenwhich simply prints the Depot CLI's user token to stdout or errors; if this ships, I can then putDEPOT_CACHE_TOKEN=$(depot api-token || echo '')in a shared envfile configuration and solve this problem for everyone at once.Tested: I built the CLI locally and ran
depot api-tokenin both logged-in and logged-out states and it worked as expected.Note
Low Risk
Low risk: adds a read-only CLI subcommand that prints the locally stored API token; no changes to token storage, auth flows, or network behavior.
Overview
Adds a new
depot api-tokensubcommand that prints the configured API token to stdout and errors with an actionable message if no token is present.Registers the new command in
pkg/cmd/root/root.goso it is available alongside existing CLI subcommands.Reviewed by Cursor Bugbot for commit a092458. Bugbot is set up for automated code reviews on this repo. Configure here.