GT-ENVIRONMENT(1) gitea-cli Manual GT-ENVIRONMENT(1)

gt-environment - Environment variables and global flags

gt environment

Global flags work with every built-in command, before or after the command name. An extension takes only --host, --repo, --user, --cwd, --no-input and --yes, before its name (see gt help extensions):

      --csv fields        Output CSV with the specified comma-separated fields, or all fields
      --cwd directory     Working directory for repository discovery
      --debug             Log the method, URL, status, and duration of each HTTP request to stderr
      --host URL          Gitea instance URL, including any base path
      --interactive       Allow prompts with machine output
  -q, --jq expression     Filter JSON output using a jq expression; implies --json
      --json fields       Output JSON with the specified comma-separated fields, or all fields
      --no-input          Disable prompts and implicit editor/browser interactions
      --remote remote     Git remote used for repository discovery
  -R, --repo OWNER/REPO   Select a repository as OWNER/REPO or URL
      --sudo user         Perform API requests as this user (requires an administrator account)
      --user name         Account name on the selected instance
  -y, --yes               Accept confirmations without prompting

gt selects the repository from --repo, GITEA_CLI_REPO, the Git remote --remote, git config gt.repository (gt repo set-default) or a Git remote (the remote preference, the base remote pr checkout recorded, the current branch's remote, upstream or origin, skipping remotes on instances without an account, or not on --host or the GITEA_TOKEN instance). Like gh, a clone with upstream and origin targets upstream: a branch tracking origin does not select the fork.

gt selects the instance from the repository URL, --host, GITEA_CLI_HOST or GITEA_INSTANCE_URL, default_host, the only instance with an account, or, among several or none, the instance of the clone's repository. gt repo clone --find-instance looks up a repository named without an instance on each instance with an account.

Environment variables:

  GITEA_CLI_CONFIG_DIR                configuration directory; gt config path prints the files
  GITEA_CLI_HOST, GITEA_INSTANCE_URL  instance URL, overriding default_host
  GITEA_SERVER_URL                    in Gitea Actions, the GITEA_TOKEN instance when no other is set,
                                      else GITHUB_SERVER_URL
  GITEA_TOKEN                         access token for that instance instead of stored credentials
  GITEA_INSTANCE_INSECURE             with GITEA_TOKEN, skip TLS verification when true
  GITEA_INSTANCE_SSH_HOST             with GITEA_TOKEN, SSH host that identifies the instance's remotes
  GITEA_CLI_USER                      account on the selected instance, like --user
  GITEA_CLI_REPO                      repository as OWNER/REPO or URL, like --repo
  GITEA_CLI_EDITOR                    editor, overriding config.yml
  GITEA_CLI_PAGER                     pager, overriding config.yml
  GITEA_CLI_COLOR                     color preference: auto, always or never
  GITEA_CLI_HTTP_TIMEOUT              longest wait for an answer, overriding config.yml
  GITEA_CLI_DATA_DIR                  data directory; installed extensions are in its extensions/
  GITEA_CLI_NO_EXTENSIONS             when set, turns extensions off
  GITEA_CLI_NO_UPDATE_NOTIFIER        when set, gt does not check for a new release (gt upgrade --help)
  GITEA_CLI_DOWNLOAD_URL              where gt upgrade downloads releases from
  NO_COLOR                            disables automatic color when set, even with CLICOLOR_FORCE
  CLICOLOR_FORCE                      unless empty or 0, colors stderr, even when redirected, and
                                      a terminal stdout despite CLICOLOR=0 or TERM=dumb
  CLICOLOR                            disables automatic color on a terminal when 0
  VISUAL, EDITOR, PAGER, BROWSER      editor (VISUAL first), pager and browser when config.yml sets none
  TERM                                dumb asks each prompt as a line of text, for screen readers,
                                      and turns off automatic color

Piped or redirected stdout is data: the color settings never color it. Only a command's own --color always does, such as gt pr diff --color always.

Preferences in config.yml are described in gt config --help.

gt(1)

Nov 2026 gitea-cli