From ee111d7c12e9bd4e782f066ec9244859400130a2 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Mon, 11 Aug 2025 15:25:42 +0000 Subject: [PATCH] README: Document logging in to gitea (#790) References: #569 #675 #697 #767 #775 Reviewed-on: https://gitea.com/gitea/tea/pulls/790 Reviewed-by: techknowlogick Co-authored-by: Michal Suchanek Co-committed-by: Michal Suchanek --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index fa8e2c6..ad1ba98 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,22 @@ There are different ways to get `tea`: 5. asdf (thirdparty): [mvaldes14/asdf-tea](https://github.com/mvaldes14/asdf-tea) +### Log in to gitea from tea + +gitea can use many different authentication schemes, and not every authentication method will work with every gitea deployment. When you are a gitea instance administrator you can tweak your settings to fit your use case. For the method that is most likely to work with any gitea deployment use the following steps: + +1. Open the gitea web in a web browser + +2. Do whatever it takes to log in to gitea in your web browser. Any MFA, IDP, or whatever else should be available this way. + +3. In gitea settings generate an application token with at least **user read** permissions. If you want to do anything useful with the token add additional permissions/scopes. + +4. Run `tea login add`, select **application token** authentication when asked for authentication type, and answer **yes** to the question if you have a token. Paste the generated token when asked for one. + +You should now be logged in to your gitea instance from tea. + +Since 0.10 gitea supports the much simpler oauth workflow but oauth may not be available on all gitea deployments, and gets much more complex when running tea on a remote system. + ### Shell completion If you installed from source or the package does not provide the completions with it you can add them yourself with `tea completion ` command which is not visible in help. To generate the completions run one of the following commands depending on your shell.