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.