.nh .TH "GT-SECRET-SET" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-secret-set - Create or update a secret .SH SYNOPSIS \fBgt secret set [] [flags]\fP .SH DESCRIPTION Create or update a secret. .PP The value comes from --body, --body-file or standard input when it is not a terminal (one trailing line break is removed), or else from a prompt. --env-file sets every NAME=value of a dotenv file instead. .PP Setting an existing secret without --description clears its description. .SS JSON FIELDS .EX description, name .EE .SH OPTIONS \fB--account\fP[=false] Use the secrets of your user account instead of a repository or organization .PP \fB-b\fP, \fB--body\fP="" The value .PP \fB-F\fP, \fB--body-file\fP="" Read the value from a file, or - for standard input .PP \fB-d\fP, \fB--description\fP="" Description .PP \fB--dry-run\fP[=false] Show the write requests gt would send, without sending them .PP \fB-f\fP, \fB--env-file\fP="" Set every NAME=value of a dotenv file, or - for standard input .PP \fB-h\fP, \fB--help\fP[=false] help for set .PP \fB-o\fP, \fB--org\fP="" Use the secrets of an organization instead of a repository .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--csv\fP[=""] Output CSV with the specified comma-separated \fBfields\fR, or all fields .PP \fB--cwd\fP="" Working \fBdirectory\fR for repository discovery .PP \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-q\fP, \fB--jq\fP="" Filter JSON output using a jq \fBexpression\fR; implies --json .PP \fB--json\fP[=""] Output JSON with the specified comma-separated \fBfields\fR, or all fields .PP \fB--no-input\fP[=false] Disable prompts and implicit editor/browser interactions .PP \fB--remote\fP="" Git \fBremote\fR used for repository discovery .PP \fB-R\fP, \fB--repo\fP="" Select a repository as \fBOWNER/REPO\fR or URL .PP \fB--sudo\fP="" Perform API requests as this \fBuser\fR (requires an administrator account) .PP \fB--template\fP="" Format JSON output using a Go \fBtemplate\fR; implies --json (see gt help formatting) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX # paste the value of a repository secret at a prompt $ gt secret set DEPLOY_TOKEN # set an organization secret from standard input $ echo -n "$TOKEN" | gt secret set NPM_TOKEN --org acme # set the secrets of a dotenv file $ gt secret set --env-file .env .EE .SH SEE ALSO \fBgt-secret(1)\fP