Get dynamically generated GitLab stats on your readmes!
Copy paste this into your markdown content and that is it. Simple huh?
change the ?username=
value to your GitLab's username
![Oregand's gitlab stats](https://gitlab-readme-stats.vercel.app/api?username=oregand)
If you notice an error using the example above, please see how to deploy your own.
To hide any specific stats you can pass a query parameter ?hide=
with an array of items you wanna hide.
Options:
&hide=["todos","projects","groups","mrs"]
![Oregand's gitlab stats](https://gitlab-readme-stats.vercel.app/api?username=oregand&hide=["groups","mrs"])
To enable icons you can pass show_icons=true
in the query param like so
![Oregand's gitlab stats](https://gitlab-readme-stats.vercel.app/api?username=oregand&show_icons=true)
With inbuilt themes you can customize the look of the card without doing any manual customization.
Use ?theme=THEME_NAME
parameter like so :-
![Oregand's gitlab stats](https://gitlab-readme-stats.vercel.app/api?username=oregand&show_icons=true&theme=dark)
default
dark
You can customize the appearance of your Stats Card
however you like with URL params.
Card Customization Options:
Option | type | description | Stats Card |
---|---|---|---|
title_color | hex color | title color | 41419f |
text_color | hex color | body color | 1f1f1f |
icon_color | hex color | icon color | 41419f |
bg_color | hex color | card bg color | FFFEFE |
line_height | number | control the line-height between text | 30 |
hide_rank | boolean | hides the ranking | false |
hide_title | boolean | hides the stats title | false |
hide_border | boolean | hides the stats card border | false |
show_icons | boolean | shows icons | false |
theme | string | sets inbuilt theme | 'default' |
As GitLab makes it easy to deploy your own instance of GitLab, there might be a desire to track your GitLab stats across
more than just gitlab.com
.
GitLab readme stats has the capability to generate stats for a remote instance of GitLab. It currently requires you to deploy an instance of GitLab readme stats yourself to vercel as you will need to add your remote gitlab token to your vercel deployment.
Follow the steps outlined in how to deploy your own instance of GitLab readme stats for a general
guide on how to deploy to vercel, but configure the environment variables so that GITLAB_TOKEN_1
through
GITLAB_TOKEN_7
contain tokens generated from your remote GitLab instances. When the retryer fails to
authenticate one token against a datasource, it will try the next numbered token in the environment.
Data Source Parameter Options:
Option | Type | Description |
---|---|---|
username | string | username that maps to your gitlab.com account |
remote_username | string | username that maps to your $remote_gitlab account |
remote_gitlab | string | base url of your remote instance including https:// |
combine_remote_and_public | boolean | setting to true will combine your stats from your remote gitlab and public gitlab accounts |
To create a stats card for the user shnaru
at the remote GitLab instance gitlab.notreal.com
(with the gitlab token
generated and added to your vercel instance) and combine it with shnaru
's public gitlab.com
stats in one card, use
the following parameters:
?username=shnaru&remote_username=shnaru&remote_gitlab=gitlab.notreal.com&combine_remote_and_public=true
- Default
- Hiding specific stats
- Showing icons
- Themes
Choose from any of the default themes
Currently https://gitlab-readme-stats.vercel.app is not deployed, and using the above will cause an error to be displayed. If you are interested in using gitlab-readme-stats for your profile, it may be useful to deploy an instance of the app to vercel.
- Go to vercel.com.
- Click on
Log in
. - Sign in with GitLab by pressing
Continue with GitLab
. - Sign in to GitLab and allow access to all repositories.
- Fork the current repo.
- Navigate to Vercel dashboard.
- To import a project, click the
Add New...
button and select theProject
option. - Click the
Continue with GitLab
button, and import your newly forked repo. - Create a gitlab token here and add
read_api
,read_user
,read_repository
. - Add the token as an environment variable named
GITLAB_TOKEN_1
. - Click deploy, and note the domain set by vercel so you can use it for your profile!
After deploying your own instance of gitlab-readme-stats, you will now be able to use the above examples with your own vercel domain.
Use the GitLab GraphQL Explorer to see more options for a User
. An example query:
{
user(username: "oregand") {
name
authoredMergeRequests {
count
totalTimeToMerge
nodes {
commitCount
}
}
assignedMergeRequests {
count
nodes {
commitCount
}
}
projectMemberships {
nodes {
id
}
}
groupMemberships {
nodes {
id
}
}
todos {
nodes {
id
}
}
}
}
Inspired heavily(almost entirely) by github-readme-stats!
Made with ❤️ and JavaScript.