3 releases
0.1.4 | Nov 10, 2021 |
---|---|
0.1.2 | Sep 23, 2021 |
0.1.1 | Sep 21, 2021 |
#2160 in Command line utilities
47 downloads per month
54KB
1K
SLoC
🏭 starship-gitlab
This is not an official starship.rs project.
WIP project for showing GitLab Pipeline status on terminal with starship.rs.
Installation
Currently, starship-gitlab
is only installable through cargo
by running:
cargo install starship-gitlab
Installation from source:
cargo install --git https://gitlab.com/Kores/starship-gitlab
May need additional dependencies, such as
git
Configuration
Update your ~/.config/starship.toml
adding the following lines:
[custom.starship_gitlab]
command = "starship-gitlab"
directories = [".git"]
format = "[$output]($style)"
Example
Configure your PAT token for a Gitlab host
To retrieve Pipeline information of private repos you will need to register an access token.
Personal Token
starship-gitlab token-set --host gitlab.com --personal-token TOKEN
Project Token
starship-gitlab token-set --host gitlab.com --project-token TOKEN
OAuth2 Token
starship-gitlab token-set --host gitlab.com --oauth2-token TOKEN
Caching
starship-gitlab uses sled database for caching, this reduces the amount of queries to Gitlab and avoids expressive lag in command execution.
Rate Limit
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 location
Cache data is stored in ~/.cache/starship-gitlab
,
Cache conditions
In order to be cached, the Pipeline must be in one of those states:
- success
- failed
- canceled
- skipped
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
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
Dependencies
~26–37MB
~649K SLoC