Skip to content

Implement depot api-token command for envfiles, etc#497

Open
agdphd wants to merge 1 commit intodepot:mainfrom
agdphd:agdphd/api-token
Open

Implement depot api-token command for envfiles, etc#497
agdphd wants to merge 1 commit intodepot:mainfrom
agdphd:agdphd/api-token

Conversation

@agdphd
Copy link
Copy Markdown
Contributor

@agdphd agdphd commented May 1, 2026

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-token which simply prints the Depot CLI's user token to stdout or errors; if this ships, I can then put DEPOT_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-token in 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-token subcommand 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.go so 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.

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.

1 participant