Crates.io | starship-gitlab |
lib.rs | starship-gitlab |
version | 0.1.4 |
source | src |
created_at | 2021-09-21 13:19:32.350764 |
updated_at | 2021-11-10 04:59:54.141736 |
description | GitLab Custom Command for starship.rs |
homepage | https://gitlab.com/Kores/starship-gitlab |
repository | https://gitlab.com/Kores/starship-gitlab |
max_upload_size | |
id | 454404 |
size | 115,963 |
This is not an official starship.rs project.
WIP project for showing GitLab Pipeline status on terminal with starship.rs.
Currently, starship-gitlab
is only installable through cargo
by running:
cargo install starship-gitlab
cargo install --git https://gitlab.com/Kores/starship-gitlab
May need additional dependencies, such as
git
Update your ~/.config/starship.toml
adding the following lines:
[custom.starship_gitlab]
command = "starship-gitlab"
directories = [".git"]
format = "[$output]($style)"
To retrieve Pipeline information of private repos you will need to register an access token.
starship-gitlab token-set --host gitlab.com --personal-token TOKEN
starship-gitlab token-set --host gitlab.com --project-token TOKEN
starship-gitlab token-set --host gitlab.com --oauth2-token TOKEN
starship-gitlab uses sled database for caching, this reduces the amount of queries to Gitlab and avoids expressive lag in command execution.
Gitlab does have a rate-limit, reported in HTTP Headers when requesting resources to Gitlab API. At the time that this documentation was written, there was rate limit of 2000 unauthenticated requests.
These values can be found here, and may change in the future.
However, caching is made to make the experience more fluid (and not because of rate limit), since requests take a bit of time (even in expressively fast connection) and affects the experience negatively.
Cache data is stored in ~/.cache/starship-gitlab
,
In order to be cached, the Pipeline must be in one of those states:
Other states are not cache, this means that a request is done to check the pipeline status everytime, which may slow down commands in projects with Gitlab remote.
Cache invalidation happens for revision when there is a new commit or there is commits that are not pushed to the remote.
Also, cache can be invalidated with --clear
argument:
starship-gitlab --clear