Print the access token of a stored sign-in on stdout, with no newline and
nothing else, because Claude Code refuses a helper that prints anything beside
the key. When the token has less than --refresh-margin left, the command
refreshes it with the stored refresh token first. When the refresh fails, the
command prints the reason on stderr, prints nothing on stdout and exits
non-zero.
Set it as Claude Code's apiKeyHelper, which runs it again every 5 minutes and
after a 401.
Usage:
tetrate agentrouter idp token [flags]
Examples:
tetrate agentrouter idp token
tetrate agentrouter idp token --profile work --refresh-margin 15m
Flags:
--profile string name of the stored sign-in (default "default")
--refresh-margin duration refresh the access token when it has less than this left (default 10m0s)
Global Flags:
-q, --quiet Suppress progress output; only errors and the final summary go to stderr
-v, --verbose Verbose output: plain-mode progress lines plus full per-blob chunk logs to stderr