.nh .TH "GT-AUTH-TOKEN" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-auth-token - Print the access token of an account .SH SYNOPSIS \fBgt auth token [flags]\fP .SH DESCRIPTION Print the access token that gt uses for the active account, or for --user, so that scripts can call the API themselves. The GITEA_TOKEN of the instance takes precedence, as it does for other commands, and an expiring OAuth token is refreshed first. Accounts that sign requests with an SSH key have no token. .SH OPTIONS \fB-h\fP, \fB--help\fP[=false] help for token .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--debug\fP[=false] Log the method, URL, status, and duration of each HTTP request to stderr .PP \fB--host\fP="" Gitea instance \fBURL\fR, including any base path .PP \fB--interactive\fP[=false] Allow prompts with machine output .PP \fB--no-input\fP[=false] Disable prompts and implicit editor/browser interactions .PP \fB--sudo\fP="" Perform API requests as this \fBuser\fR (requires an administrator account) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX $ gt auth token $ curl -H "Authorization: token $(gt auth token)" https://gitea.com/api/v1/user $ gt auth token --host gitea.com --user alice .EE .SH SEE ALSO \fBgt-auth(1)\fP