[AI-125] Add a command similar to 'gh auth token' by dev-astro-code-agent[bot] · Pull Request #2050 · astronomer/astro-cli
Add a new 'astro auth token' command similar to 'gh auth token' that outputs the current authentication token to stdout. This is useful for scripting and CI/CD pipelines where the token needs to be used programmatically. Changes: - Created new 'auth' command group with login, logout, and token subcommands - Implemented printAuthToken function that retrieves and outputs the token - Added comprehensive tests for the new token command - Maintained backward compatibility with existing 'astro login' and 'astro logout' commands The token command: - Strips the "Bearer " prefix from the token for easier use in scripts - Returns appropriate error if not authenticated - Outputs only the token to stdout for easy consumption Resolves AI-125 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>