Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Roche/gitlab-stats
Gitlab Stats provides more statistics from the GitLab API services
https://github.com/Roche/gitlab-stats
Last synced: 13 days ago
JSON representation
Gitlab Stats provides more statistics from the GitLab API services
- Host: GitHub
- URL: https://github.com/Roche/gitlab-stats
- Owner: Roche
- License: apache-2.0
- Created: 2020-03-23T13:26:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-05T15:33:32.000Z (about 2 years ago)
- Last Synced: 2025-01-16T23:00:30.017Z (15 days ago)
- Language: TypeScript
- Homepage:
- Size: 45.9 KB
- Stars: 19
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- top-pharma50 - **Roche/gitlab-stats** - 12-05 15:33:32 | (Ranked by starred repositories)
- top-pharma50 - **Roche/gitlab-stats** - 12-05 15:33:32 | (Ranked by starred repositories)
README
# Gitlab Stats
Gitlab Stats provides more [GitLab](https://gitlab.com/gitlab-org/gitlab/) statistics from the [GitLab API](https://gitlab.com/gitlab-org/gitlab/tree/master/doc/api) services. Gitlab Stats API is making use of the [gitlab](https://github.com/jdalrymple/gitbeaker#readme) NPM package is heavily inspired by its API.
![Logo](logo.png)
## Install
```bash
# Install as CLI tool
npm i -g gitlab-stats# Install as node dependency
npm i gitlab-stats```
## CLI Support
All the CLI commands have the following structure.
```bash
gitlab-stats [service name] [method name] --arg1 --arg2 --arg3
```
Where `service name` is any of the [supported API](#docs) names, `method name` is any of the supported commands on that API service. `--arg1` are any of the arguments you can supply to the function.
```bash
gitlab-stats users growth --interval month --output csv > user-growth.csv
```
In order to use the CLI tool, you will need to have the following environment variables
```bash
GITLAB_TOKEN=
# Optional
GITLAB_HOST= # e.g. https://gitlab.website.com```
This could be set globally or using a .env file in the project folder.
## Node.js / Web support
The functionalities of the CLI can be imported into your Node.js or web project.
```typescript
import { Gitlab } from "gitlab";
import { GitlabStats } from "gitlab-stats";const gitlab = new Gitlab({
host: "http://example.com",
token: "personaltoken"
});const gitlabStats = new GitlabStats({
gitlab
});gitlabStats.Users.growth({ interval: "month" })
.then(console.log)
.catch(console.error);
```## Docs
The APIs which are currently supported are:
- Pipelines
- Users
- Projects