# gitlab-group-clone

> This project provides a tool to clone all the projects within a group, identified by its id.

Latest version **1.0.1** (published 2021-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install gitlab-group-clone
pnpm add gitlab-group-clone
yarn add gitlab-group-clone
bun add gitlab-group-clone
```

Provides the command `glabgclone`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-03-20 |
| First published | 2021-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 176.1 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | José Alberto Ruiz |
| Maintainers | jalb80 |

## Links

- npm: https://www.npmjs.com/package/gitlab-group-clone
- Repository: https://github.com/jaruizes/gitlab-clone-group
- Homepage: https://github.com/jaruizes/gitlab-clone-group#readme
- Issues: https://github.com/jaruizes/gitlab-clone-group/issues
- npm.io page: https://npm.io/package/gitlab-group-clone

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [figlet](https://npm.io/package/figlet.md) ^1.4.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.4
- [inquirer](https://npm.io/package/inquirer.md) ^3.1.1

## Recent versions

- 1.0.1 (latest) — 2021-03-20
- 1.0.0 — 2021-03-20

## README

# Gitlab Group Clone Tool

This project provides a tool to clone all the projects within a group, identified by its id.

## Features

- Clone every project associated to a group and its subgroups
- If some project is already cloned in the target folder, this tool will perform a "git pull" action

<br />

## Install

### Global
To install this tool, execute this command:

```
npm i gitlab-group-clone -g
```

<br />


### Local
If you don't want to install the tool globally, clone the project from Github and execute it from the project folder.
To clone the project, execute:

```
git clone https://github.com/jaruizes/gitlab-group-clone.git
```

<br />


Then, execute:

```
cd gitlab-group-clone
npm i
```

<br />


## Usage

### Requirements
To use this tool you need:

- **Gitlab Personal Access Token**: this tool asks you for this kind of token but it will never store it. The tool uses this token 
  to call to Gitlab API. To create this token, just go to **Preferences -> Access Tokens** in the Gitlab web application. Then,
  you must create a Token with "API" grants:

  ![gitlab_access_token](./doc/img/gitlab_access_token.png)

- **Be allowed to clone projects in Gitlab (private projects)**: this tool isn't going to ask you for any password or ssh keys to clone private
  projects. It assumes that you have already configured in your system the credentials to clone private projects in Gitlab.

<br />

### Executing the tool
This tool is so easy to use because it's a CLI. The CLI asks you the following questions:

- Gitlab base URL, for instance: https://gitlab.com/
- GroupId to clone: this id is an integer. It's not the group name.
- Destination path: path where the group will be cloned
- Method: ssh / http
- Token: a personal access token with API grants.

<br />

### Globally
If you installed the tool [globally](#global), execute (from any folder):

```
glabgclone
```

<br />

And the tool will begin to ask for the necessary data. For instance:

![gitlab_access_token](./doc/img/cli.png)

<br />

### Locally
If you install the tool [locally](#local), go to the folder where you cloned the project and execute:

```
npm start
```

<br />

#### Group ID

The group ID is the number located below the group name:

![group id](./doc/img/group_id.png)

Just copy this number and paste it when the CLI asks for it.

---
_Source: https://npm.io/package/gitlab-group-clone · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
